Commit version 24.12.13800

This commit is contained in:
2025-01-06 17:35:06 -05:00
parent b7f6a79c2c
commit 55d9218816
6133 changed files with 4239740 additions and 1374287 deletions

View File

@ -4,9 +4,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -22,19 +22,16 @@
$oids = snmp_get_multi_oid($device, 'agentNetworkIPAddress.0 agentNetworkSubnetMask.0 agentNetworkBurnedInMacAddress.0 agentNetworkMgmtVlan.0', [], $mib);
print_debug_vars($oids);
$entry = $oids[0];
if ($port_id = get_port_id_by_ifDescr($device['device_id'], 'Vl'.$entry['agentNetworkMgmtVlan']))
{
// By Vlan
$port = get_port_by_id_cache($port_id);
$ifIndex = $port['ifIndex'];
}
elseif ($port_id = get_port_id_by_mac($device['device_id'], $entry['agentNetworkBurnedInMacAddress']))
{
// By MAC address
$port = get_port_by_id_cache($port_id);
$ifIndex = $port['ifIndex'];
if ($port_id = get_port_id_by_ifDescr($device['device_id'], 'Vl' . $entry['agentNetworkMgmtVlan'])) {
// By Vlan
$port = get_port_by_id_cache($port_id);
$ifIndex = $port['ifIndex'];
} elseif ($port_id = get_port_id_by_mac($device['device_id'], $entry['agentNetworkBurnedInMacAddress'])) {
// By MAC address
$port = get_port_by_id_cache($port_id);
$ifIndex = $port['ifIndex'];
} else {
$ifIndex = 0;
$ifIndex = 0;
}
$data = [
@ -50,23 +47,23 @@ discover_add_ip_address($device, $mib, $data);
// DNOS-SWITCHING-MIB::agentNetworkIpv6AddrStatus."........jOd....." = INTEGER: active(1)
// DNOS-SWITCHING-MIB::agentNetworkIpv6AddressAutoConfig.0 = INTEGER: disable(2)
// DNOS-SWITCHING-MIB::agentNetworkIpv6ConfigProtocol.0 = INTEGER: none(1)
if (snmp_get_oid($device, 'agentNetworkIpv6AdminMode.0', $mib) === 'enabled')
{
// IPv6
$oids = snmpwalk_cache_oid($device, 'agentNetworkIpv6AddrPrefixLength', [], $mib, NULL, OBS_SNMP_ALL_TABLE);
$oids = snmpwalk_cache_oid($device, 'agentNetworkIpv6AddrStatus', $oids, $mib, NULL, OBS_SNMP_ALL_TABLE);
print_debug_vars($oids);
foreach ($oids as $ip_address => $entry)
{
if ($entry['agentNetworkIpv6AddrStatus'] !== 'active') { continue; }
if (snmp_get_oid($device, 'agentNetworkIpv6AdminMode.0', $mib) === 'enabled') {
// IPv6
$oids = snmpwalk_cache_oid($device, 'agentNetworkIpv6AddrPrefixLength', [], $mib, NULL, OBS_SNMP_ALL_TABLE);
$oids = snmpwalk_cache_oid($device, 'agentNetworkIpv6AddrStatus', $oids, $mib, NULL, OBS_SNMP_ALL_TABLE);
print_debug_vars($oids);
foreach ($oids as $ip_address => $entry) {
if ($entry['agentNetworkIpv6AddrStatus'] !== 'active') {
continue;
}
$data = [
'ifIndex' => $ifIndex,
'ip' => $ip_address,
'prefix' => $entry['agentNetworkIpv6AddrPrefixLength']
];
discover_add_ip_address($device, $mib, $data);
}
$data = [
'ifIndex' => $ifIndex,
'ip' => $ip_address,
'prefix' => $entry['agentNetworkIpv6AddrPrefixLength']
];
discover_add_ip_address($device, $mib, $data);
}
}
// EOF