mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Modify to fix neighbours on EXOS switch problem (#10013)
https://community.librenms.org/t/modify-discovery-protocols-inc-php-to-fix-neighbours-problem-on-extreme-networks-exos-switch/7797 The bug is caused by SNMP polling switch-1 with ifIndex to DB (associate ifIndex when adding switch), the port “1” is “1001”. Another switch-2 discover the switch-1 port “1” by LLDP is “1” (after LiberNMS get this information). Two values are not equal (“1001” != “1”). If I change to use ifName associate when adding device, because ifName is “1:1”, so it can not equal to LLDP too (“1:1” != “1”).
This commit is contained in:
committed by
PipoCanaja
parent
6b4f2476a6
commit
2eb5e30aa7
@@ -240,6 +240,18 @@ if (($device['os'] == 'routeros') && Config::get('autodiscovery.xdp') === true)
|
||||
$lldp['lldpRemPortId'] = 'EthPort ' . $lldp['lldpRemPortId'];
|
||||
}
|
||||
|
||||
if ($remote_device['os'] == 'xos') {
|
||||
$slot_port = explode(':', $lldp['lldpRemPortId']);
|
||||
if (sizeof($slot_port) == 2) {
|
||||
$n_slot = (int)$slot_port[0];
|
||||
$n_port = (int)$slot_port[1];
|
||||
} else {
|
||||
$n_slot = 1;
|
||||
$n_port = (int)$slot_port[0];
|
||||
}
|
||||
$lldp['lldpRemPortId'] = (string)($n_slot * 1000 + $n_port);
|
||||
}
|
||||
|
||||
$remote_port_id = find_port_id(
|
||||
$lldp['lldpRemPortDesc'],
|
||||
$lldp['lldpRemPortId'],
|
||||
|
Reference in New Issue
Block a user