Interfae parsing not working for me

Hello,

I am trying to parse interface descriptions to use the customer, peering, and transit ports. In my specific case, I have roughly 4 transit ports and 2 peering ports. I attempt to play around with the ’ $config[‘transit_descr’] ’ or ’ $config[‘peering_descr’] ’ in the config.php without much success. I even put in the entire port description onto each line for the " transit_descr " and LibreNMS continues to tell me that there are no transit ports.

For what it’s worth, our description are much longer compared to what is being parsed on LibreNMS (as in when clicking on Ports, the full description is cutoff). I am unsure if that is causing difficulty for me?

Anyway to get peering/transit/customer interface description parsed and shown? The documentation is a little light unfortunately.

The docs are light because it’s actually pretty simple. If you gave us examples of what you are trying we could probably advice you further.

I have removed information for privacy sake, but I basically have the following in config.php:

$config[‘transit_descr’] = ‘TransitA’;
$config[‘transit_descr’] = ‘TransitB’;
$config[‘transit_descr’] = ‘TransitC’;
$config[‘transit_descr’] = ‘TransitD’;

‘TransitA’ is an exact copy of the interface description from my router, etc etc.
Only difference is that TransitA is about 90 characters long, TransitB maybe 70 characters long, etc.

I found out my problem.
I’m good now … thank you.

What was your solution?

I expect at least it was that those config options overwrite one another because they are just defining strings. You need to do $config['transit_descr'][] = 'TransitA'; and so on to ensure it’s an array

Hello,

Same problem for me, here my conf:

$config[‘transit_descr’] = array(‘TransitA’,‘TransitB’,’…’);

‘TransitA’ is an exact copy of the interface description from my devices (ifalias)

Still anything in Transit Port.

I aslo tried with only one interface:

$config[‘transit_descr’] = ‘TransitA’;

This does not work too.

In my database, all the ‘port_descr_type’ are set to “NULL”.

My issue was attempting to apply the parser into our description standardization on our devices. The key function I missed while reading was the colon " : " placement.
After that, everything clicked in.

I am aware of creating my own custom parser, however I am not skillful in any programming/scripting…

@taking-care-of-busin

Thanks for your answer, I don’t really understand what you mean with the colon " : " placement.

Could you provide an example ?

You should really show what you are trying to do but as an example http://docs.librenms.org/Extensions/Interface-Description-Parsing/#examples

If your port description is the following:

THIS_IS_MY_PORT_DESCRIPTION: SERVER NAME

The text to the left of the " : " position is what you add into config.php:

$config[‘transit_descr’] = ‘THIS_IS_MY_PORT_DESCRIPTION’;

to the right of the colon is where LibreNMS detects your server name (or customer name, or whatever you like).
Optionally, you can add speed, notes, other useful information by parsing them around specific variables:

THIS_IS_MY_PORT_DESCRIPTION: CUSTOMER NAME [SPEED] {CIRCUIT ID}

So you speed of 100M would show as " [100M] ", circuit ID would shown as " {random circuit ID} ", and your customer description of the port would be without any markings in the beginning and end.

The URL pasted by laf does go into those details further.

1 Like