mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Alcatel-Lucent aos7 LLDP Neighbors (#12886)
* first commit * fix style * fix style * fix style * fix style * fix style * fix style * fix style * change local_port_id * fix style * fix style * fix style
This commit is contained in:
@@ -221,20 +221,29 @@ if (($device['os'] == 'routeros')) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$dot1d_array = snmpwalk_group($device, 'dot1dBasePortIfIndex', 'BRIDGE-MIB');
|
||||
$lldp_ports = snmpwalk_group($device, 'lldpLocPortId', 'LLDP-MIB');
|
||||
if (($device['os'] == 'aos7')) {
|
||||
$lldp_local = snmpwalk_cache_oid($device, 'lldpLocPortEntry', [], 'LLDP-MIB');
|
||||
$lldp_ports = snmpwalk_group($device, 'lldpLocPortId', 'LLDP-MIB');
|
||||
} else {
|
||||
$dot1d_array = snmpwalk_group($device, 'dot1dBasePortIfIndex', 'BRIDGE-MIB');
|
||||
$lldp_ports = snmpwalk_group($device, 'lldpLocPortId', 'LLDP-MIB');
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($lldp_array as $key => $lldp_if_array) {
|
||||
foreach ($lldp_if_array as $entry_key => $lldp_instance) {
|
||||
if (is_numeric($dot1d_array[$entry_key]['dot1dBasePortIfIndex'])) {
|
||||
if (($device['os'] == 'aos7')) {
|
||||
$ifName = $lldp_local[$entry_key]['lldpLocPortDesc'];
|
||||
} elseif (is_numeric($dot1d_array[$entry_key]['dot1dBasePortIfIndex'])) {
|
||||
$ifIndex = $dot1d_array[$entry_key]['dot1dBasePortIfIndex'];
|
||||
} else {
|
||||
$ifIndex = $entry_key;
|
||||
}
|
||||
|
||||
$local_port_id = find_port_id($lldp_ports[$entry_key]['lldpLocPortId'], $ifIndex, $device['device_id']);
|
||||
if (($device['os'] == 'aos7')) {
|
||||
$local_port_id = find_port_id($ifName, null, $device['device_id']);
|
||||
} else {
|
||||
$local_port_id = find_port_id($lldp_ports[$entry_key]['lldpLocPortId'], $ifIndex, $device['device_id']);
|
||||
}
|
||||
$interface = get_port_by_id($local_port_id);
|
||||
|
||||
d_echo($lldp_instance);
|
||||
|
||||
Reference in New Issue
Block a user