mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Pop returned value from snmpwalk_group for lldp on mikrotik routeros (#12768)
* Pop returned value from snmpwalk_group for lldp on mikrotik routeros * Account for non-multiarray response then pull out the inner-array * StyleCl suggested format * Add comment Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -86,6 +86,11 @@ if (($device['os'] == 'routeros')) {
|
||||
echo ' LLDP-MIB: ';
|
||||
$lldp_array = snmpwalk_group($device, 'lldpRemEntry', 'LLDP-MIB', 3);
|
||||
if (! empty($lldp_array)) {
|
||||
// workaround for routeros returning the incorrect index
|
||||
if (! empty($lldp_array[0][0])) {
|
||||
$lldp_array = $lldp_array[0][0];
|
||||
}
|
||||
|
||||
$lldp_ports = snmpwalk_group($device, 'mtxrInterfaceStatsName', 'MIKROTIK-MIB');
|
||||
$lldp_ports_num = snmpwalk_group($device, 'mtxrNeighborInterfaceID', 'MIKROTIK-MIB');
|
||||
|
||||
|
Reference in New Issue
Block a user