mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Workaround issues with lldp information from GS108Tv1 (#13971)
The GS108Tv1 doesn't present the same information over snmp as they do over lldp. This tries to detect such a remote device and figure out which remote port we actually should map it to.
This commit is contained in:
@@ -347,6 +347,18 @@ if (($device['os'] == 'routeros')) {
|
||||
$remote_port_name = (string) ($n_slot * 1000 + $n_port);
|
||||
}
|
||||
|
||||
if ($remote_device['os'] == 'netgear' &&
|
||||
$remote_device['sysDescr'] == 'GS108T' &&
|
||||
$lldp['lldpRemSysDesc'] == 'Smart Switch') {
|
||||
// Some netgear switches, as Netgear GS108Tv1 presents it's port name over snmp as
|
||||
// "Port 1 Gigabit Ethernet" but as 'lldpRemPortId' => 'g1' and
|
||||
// 'lldpRemPortDesc' => 'Port #1' over lldp.
|
||||
// So remap g1 to 1 so it matches ifIndex
|
||||
if (preg_match("/^g(\d+)$/", $lldp['lldpRemPortId'], $matches)) {
|
||||
$remote_port_name = $matches[1];
|
||||
}
|
||||
}
|
||||
|
||||
$remote_port_id = find_port_id(
|
||||
$lldp['lldpRemPortDesc'],
|
||||
$remote_port_name,
|
||||
|
||||
Reference in New Issue
Block a user