Hello - trying to use custom separators with our network interface descriptions to categorize ports.
Here’s our current interface description setup:
acc__server1__eth0
bb__another router__xe-2/0/1
I’ve messed around a bit with custom port description parsing but can’t seem to get it to work properly. Here is my config:
<?php
// Parser should populate $port_ifAlias array with type, descr, circuit, speed and notes
unset($port_ifAlias);
echo $this_port['ifAlias'];
list($type,$descr) = preg_split('/[\_\_]/', $this_port['ifAlias']);
$descr = trim($descr);
if ($type && $descr) {
$type = strtolower($type);
$port_ifAlias['type'] = $type;
$port_ifAlias['descr'] = $descr;
d_echo($port_ifAlias);
}
unset($port_type, $port_descr);
And here is the conf.php for custom stuff:
$config['customers_descr'] = 'acc';
$config['transit_descr'] = 'trn';
$config['core_descr'] = 'bb';
$config['port_descr_parser'] = "includes/custom/my-port-descr-parser.inc.php";
Any help here is greatly appreciated.
Thank you!