Interface Description Parsing not work for me


I am having trouble with custom Interface Description Parsing.

I created my own parser:

librenms:/opt/librenms/includes/custom# ls -la
total 12
d-wx–x–x 2 nobody nogroup 4096 Apr 11 12:06 .
drwxr-xr-x 1 nobody nogroup 4096 Apr 11 12:06 .
-rw-r–r-- 1 nobody nogroup 746 Apr 11 22:55

Next, in the config.php file, I specified where to look for my parser:

custom int_descr_parsing

$config[‘port_descr_parser’] = “includes/custom/”;

The parser code is shown below.


// Parser should populate $port_ifAlias array with type, descr, circuit, speed and notes

echo $this_port['ifAlias'];

$split = preg_split('[#]', $this_port['ifAlias']);
$descr = isset($split[0]) ? trim($split[0], '/n/t') : null;
$type = isset($split[1]) ? trim($split[1], '/n/t') : null;
$circuit = "";
$notes = "";
$speed = "";

if ($type && $descr) {
    $type = strtolower($type);
    $port_ifAlias['type'] = $type;
    $port_ifAlias['descr'] = $descr;
    $port_ifAlias['circuit'] = $circuit;
    $port_ifAlias['speed'] = $speed;
    $port_ifAlias['notes'] = $notes;


unset($type, $descr, $circuit, $notes, $speed, $split);

Description on the hardware has the following look:

xe-2/2/0.0 up up ISP #UPLINK#

I also did a comparison in WebGUI

But it still doesn’t display anything in the WebGUI.

Please tell me what I can do wrong.

Thank you!

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