diff --git a/includes/discovery/discovery-protocols.inc.php b/includes/discovery/discovery-protocols.inc.php index ef1e7670cd..1f30bbe2b2 100644 --- a/includes/discovery/discovery-protocols.inc.php +++ b/includes/discovery/discovery-protocols.inc.php @@ -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,