Interface Description Parsing Regex + 'port_descr_type' + 'port_descr_descr' not populated in database

I’m having some issues with the regex for the Interface Description Parser and hoping someone can help. We are looking to change the regex for all Peering, Transit, Core and Customer ports. Here is our current config:
Peering Port Types: peering
Transit Port Types: transit
Core Port Types: core
Customer Port Types: cust

We use the following standard for interface descriptions on our devices and we want to exclude certain port states.
[port type]:[port state]:[port description]
CUST:BH: CustomerTest
With the current port type config, this shows everything under ‘CUST:’. As an example below, we want to include only some of these.
CUST:A: ← include
CUST:B: ← include
CUST:C: ← exclude
CUST:D: ← exclude

We also have a separate issue. It appears that a significant number of entries in the database (DB: librenms, Table: ports) are NULL. This means that they are not appearing in the list of ports altogether. (GUI: Ports > Customers). Once these two fields are manually updated, they then appear in the GUI. I’d like to know if there are any alternate solutions to fixing this instead of running loads of MySQL updates to populate these fields, as it’s not clear what has caused these fields to become null in the first place.

MariaDB [librenms]> SELECT port_id, ifDescr, ifAlias, device_id, port_descr_type, port_descr_descr FROM ports WHERE device_id=1 AND ifDescr='GigabitEthernet1/13';
| port_id | ifDescr             | ifAlias             | device_id | port_descr_type | port_descr_descr |
|      18 | GigabitEthernet1/13 | GigabitEthernet1/13 |         1 | NULL            | NULL             |
1 row in set (0.001 sec)

If someone can assist with either of these issues that would be great.

You will need to write your own custom parser script to deal with this: Interface Description Parsing - LibreNMS Docs

For the 2nd question, the descr on the interface must not be in the correct format for parsing to pick it up but without an example we can’t help.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.