Commit version 24.12.13800
This commit is contained in:
@ -4,9 +4,9 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
@ -17,37 +17,37 @@
|
||||
// ARISTA-VRF-MIB::aristaVrfState."mgmt" = INTEGER: inactive(2)
|
||||
// ARISTA-VRF-MIB::aristaVrfState."mai_internal" = INTEGER: active(1)
|
||||
|
||||
$mpls_vpn_vrf = snmpwalk_cache_oid($device, 'aristaVrfEntry', [], 'ARISTA-VRF-MIB');
|
||||
$mpls_vpn_vrf = snmpwalk_cache_oid($device, 'aristaVrfEntry', [], 'ARISTA-VRF-MIB');
|
||||
$vrf_discovered = snmp_endtime();
|
||||
print_debug_vars($mpls_vpn_vrf);
|
||||
|
||||
foreach ($mpls_vpn_vrf as $vrf_name => $entry) {
|
||||
//if ($entry['aristaVrfState'] !== 'active') { continue; } // Skip inactive
|
||||
//if ($entry['aristaVrfState'] !== 'active') { continue; } // Skip inactive
|
||||
|
||||
$discovery_vrf[$vrf_name] = [
|
||||
'vrf_mib' => $mib,
|
||||
'vrf_name' => $vrf_name,
|
||||
'vrf_descr' => '',
|
||||
'vrf_rd' => $entry['aristaVrfState'] === 'active' ? $entry['aristaVrfRouteDistinguisher'] : '',
|
||||
$discovery_vrf[$vrf_name] = [
|
||||
'vrf_mib' => $mib,
|
||||
'vrf_name' => $vrf_name,
|
||||
'vrf_descr' => '',
|
||||
'vrf_rd' => $entry['aristaVrfState'] === 'active' ? $entry['aristaVrfRouteDistinguisher'] : '',
|
||||
|
||||
'vrf_admin_status' => 'up',
|
||||
'vrf_oper_status' => $entry['aristaVrfState'] === 'active' ? 'up' : 'down',
|
||||
/*
|
||||
'vrf_active_ports' => $entry['mplsL3VpnVrfActiveInterfaces'],
|
||||
'vrf_total_ports' => $entry['mplsL3VpnVrfAssociatedInterfaces'],
|
||||
'vrf_added_routes' => $entry['mplsL3VpnVrfPerfRoutesAdded'],
|
||||
'vrf_deleted_routes' => $entry['mplsL3VpnVrfPerfRoutesDeleted'],
|
||||
'vrf_total_routes' => $entry['mplsL3VpnVrfPerfCurrNumRoutes'],
|
||||
//'vrf_added' => $vrf_discovered - timeticks_to_sec($entry['mplsL3VpnVrfCreationTime']),
|
||||
'vrf_added' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsL3VpnVrfCreationTime']),
|
||||
'vrf_last_change' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsL3VpnVrfConfLastChanged']),
|
||||
*/
|
||||
];
|
||||
'vrf_admin_status' => 'up',
|
||||
'vrf_oper_status' => $entry['aristaVrfState'] === 'active' ? 'up' : 'down',
|
||||
/*
|
||||
'vrf_active_ports' => $entry['mplsL3VpnVrfActiveInterfaces'],
|
||||
'vrf_total_ports' => $entry['mplsL3VpnVrfAssociatedInterfaces'],
|
||||
'vrf_added_routes' => $entry['mplsL3VpnVrfPerfRoutesAdded'],
|
||||
'vrf_deleted_routes' => $entry['mplsL3VpnVrfPerfRoutesDeleted'],
|
||||
'vrf_total_routes' => $entry['mplsL3VpnVrfPerfCurrNumRoutes'],
|
||||
//'vrf_added' => $vrf_discovered - timeticks_to_sec($entry['mplsL3VpnVrfCreationTime']),
|
||||
'vrf_added' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsL3VpnVrfCreationTime']),
|
||||
'vrf_last_change' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsL3VpnVrfConfLastChanged']),
|
||||
*/
|
||||
];
|
||||
|
||||
// Detect if VRF SNMP context exist
|
||||
if (snmp_virtual_exist($device, $vrf_name)) {
|
||||
$vrf_contexts[$vrf_name] = $vrf_name;
|
||||
}
|
||||
// Detect if VRF SNMP context exist
|
||||
if (snmp_virtual_exist($device, $vrf_name)) {
|
||||
$vrf_contexts[$vrf_name] = $vrf_name;
|
||||
}
|
||||
}
|
||||
|
||||
// ARISTA-VRF-MIB::aristaVrfIfMembership.999001 = STRING: mgmt
|
||||
@ -56,13 +56,13 @@ foreach ($mpls_vpn_vrf as $vrf_name => $entry) {
|
||||
$mpls_vpn_if = snmpwalk_cache_oid($device, 'aristaVrfIfMembership', [], 'ARISTA-VRF-MIB');
|
||||
print_debug_vars($mpls_vpn_if);
|
||||
foreach ($mpls_vpn_if as $vrf_ifIndex => $entry) {
|
||||
$vrf_name = $entry['aristaVrfIfMembership'];
|
||||
if (!isset($discovery_vrf[$vrf_name])) {
|
||||
print_debug("Unknown VRF name '$vrf_name'.");
|
||||
continue;
|
||||
}
|
||||
$vrf_name = $entry['aristaVrfIfMembership'];
|
||||
if (!isset($discovery_vrf[$vrf_name])) {
|
||||
print_debug("Unknown VRF name '$vrf_name'.");
|
||||
continue;
|
||||
}
|
||||
|
||||
$discovery_vrf[$vrf_name]['ifIndex'][] = $vrf_ifIndex;
|
||||
$discovery_vrf[$vrf_name]['ifIndex'][] = $vrf_ifIndex;
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
||||
@ -4,15 +4,15 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
if (safe_count($discovery_vrf)) {
|
||||
// VRF already discovered by better MIBs
|
||||
return;
|
||||
// VRF already discovered by better MIBs
|
||||
return;
|
||||
}
|
||||
|
||||
// CISCO-VRF-MIB::cvVrfName.1 = STRING: ISP-VZ
|
||||
@ -27,37 +27,39 @@ if (safe_count($discovery_vrf)) {
|
||||
// CISCO-VRF-MIB::cvVrfStorageType.2 = INTEGER: nonVolatile(3)
|
||||
// CISCO-VRF-MIB::cvVrfRowStatus.1 = INTEGER: active(1)
|
||||
// CISCO-VRF-MIB::cvVrfRowStatus.2 = INTEGER: active(1)
|
||||
$vrfs = snmpwalk_cache_oid($device, 'cvVrfTable', [], 'CISCO-VRF-MIB');
|
||||
$vrfs = snmpwalk_cache_oid($device, 'cvVrfTable', [], 'CISCO-VRF-MIB');
|
||||
$vrf_discovered = snmp_endtime();
|
||||
print_debug_vars($vrf);
|
||||
|
||||
$vrf_ids = [];
|
||||
foreach ($vrfs as $index => $entry) {
|
||||
if ($entry['cvVrfRowStatus'] !== 'active') { continue; } // Skip inactive
|
||||
if ($entry['cvVrfRowStatus'] !== 'active') {
|
||||
continue;
|
||||
} // Skip inactive
|
||||
|
||||
$vrf_name = $entry['cvVrfName'];
|
||||
$vrf_name = $entry['cvVrfName'];
|
||||
|
||||
$discovery_vrf[$vrf_name] = [
|
||||
'vrf_mib' => $mib,
|
||||
'vrf_name' => $vrf_name,
|
||||
'vrf_descr' => '',
|
||||
'vrf_rd' => '',
|
||||
$discovery_vrf[$vrf_name] = [
|
||||
'vrf_mib' => $mib,
|
||||
'vrf_name' => $vrf_name,
|
||||
'vrf_descr' => '',
|
||||
'vrf_rd' => '',
|
||||
|
||||
'vrf_admin_status' => 'up',
|
||||
'vrf_oper_status' => $entry['cvVrfOperStatus'],
|
||||
/*
|
||||
'vrf_active_ports' => $entry['mplsL3VpnVrfActiveInterfaces'],
|
||||
'vrf_total_ports' => $entry['mplsL3VpnVrfAssociatedInterfaces'],
|
||||
'vrf_added_routes' => $entry['mplsL3VpnVrfPerfRoutesAdded'],
|
||||
'vrf_deleted_routes' => $entry['mplsL3VpnVrfPerfRoutesDeleted'],
|
||||
'vrf_total_routes' => $entry['mplsL3VpnVrfPerfCurrNumRoutes'],
|
||||
//'vrf_added' => $vrf_discovered - timeticks_to_sec($entry['mplsL3VpnVrfCreationTime']),
|
||||
'vrf_added' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsL3VpnVrfCreationTime']),
|
||||
'vrf_last_change' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsL3VpnVrfConfLastChanged']),
|
||||
*/
|
||||
];
|
||||
'vrf_admin_status' => 'up',
|
||||
'vrf_oper_status' => $entry['cvVrfOperStatus'],
|
||||
/*
|
||||
'vrf_active_ports' => $entry['mplsL3VpnVrfActiveInterfaces'],
|
||||
'vrf_total_ports' => $entry['mplsL3VpnVrfAssociatedInterfaces'],
|
||||
'vrf_added_routes' => $entry['mplsL3VpnVrfPerfRoutesAdded'],
|
||||
'vrf_deleted_routes' => $entry['mplsL3VpnVrfPerfRoutesDeleted'],
|
||||
'vrf_total_routes' => $entry['mplsL3VpnVrfPerfCurrNumRoutes'],
|
||||
//'vrf_added' => $vrf_discovered - timeticks_to_sec($entry['mplsL3VpnVrfCreationTime']),
|
||||
'vrf_added' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsL3VpnVrfCreationTime']),
|
||||
'vrf_last_change' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsL3VpnVrfConfLastChanged']),
|
||||
*/
|
||||
];
|
||||
|
||||
$vrf_ids[$index] = $vrf_name;
|
||||
$vrf_ids[$index] = $vrf_name;
|
||||
}
|
||||
|
||||
// CISCO-VRF-MIB::cvVrfInterfaceType.1.2 = INTEGER: vrfEdge(3)
|
||||
@ -72,15 +74,19 @@ $vrf_interfaces = snmpwalk_cache_twopart_oid($device, 'cvVrfInterfaceTable', [],
|
||||
print_debug_vars($vrf_interfaces);
|
||||
|
||||
foreach ($vrf_interfaces as $vrf_id => $int) {
|
||||
if (!isset($vrf_ids[$vrf_id])) { continue; } // skip unknown VRFs
|
||||
if (!isset($vrf_ids[$vrf_id])) {
|
||||
continue;
|
||||
} // skip unknown VRFs
|
||||
|
||||
$vrf_name = $vrf_ids[$vrf_id];
|
||||
$vrf_name = $vrf_ids[$vrf_id];
|
||||
|
||||
foreach ($int as $vrf_ifIndex => $entry) {
|
||||
if ($entry['cvVrfInterfaceRowStatus'] !== 'active') { continue; } // Skip inactive
|
||||
foreach ($int as $vrf_ifIndex => $entry) {
|
||||
if ($entry['cvVrfInterfaceRowStatus'] !== 'active') {
|
||||
continue;
|
||||
} // Skip inactive
|
||||
|
||||
$discovery_vrf[$vrf_name]['ifIndex'][] = $vrf_ifIndex;
|
||||
}
|
||||
$discovery_vrf[$vrf_name]['ifIndex'][] = $vrf_ifIndex;
|
||||
}
|
||||
}
|
||||
|
||||
unset($vrfs, $vrf_interfaces, $vrf_ids, $int);
|
||||
|
||||
@ -4,15 +4,15 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
if (snmp_get_oid($device, 'mplsL3VpnConfiguredVrfs.0', 'MPLS-L3VPN-STD-MIB') <= 0) {
|
||||
print_debug("Not found VRFs by MPLS-L3VPN-STD-MIB.");
|
||||
return;
|
||||
print_debug("Not found VRFs by MPLS-L3VPN-STD-MIB.");
|
||||
return;
|
||||
}
|
||||
|
||||
// MPLS-L3VPN-STD-MIB::mplsL3VpnVrfDescription."SA_MPLS" = STRING:
|
||||
@ -90,34 +90,36 @@ $vrf_discovered = snmp_endtime();
|
||||
// MPLS-L3VPN-STD-MIB::mplsL3VpnVrfPerfDiscTime."INTERNET" = Timeticks: (0) 0:00:00.00
|
||||
// MPLS-L3VPN-STD-MIB::mplsL3VpnVrfPerfDiscTime."ELEC_MPLS" = Timeticks: (0) 0:00:00.00
|
||||
// MPLS-L3VPN-STD-MIB::mplsL3VpnVrfPerfDiscTime."SAPAT_MPLS" = Timeticks: (0) 0:00:00.00
|
||||
$mpls_vpn_vrf = snmpwalk_cache_oid($device, 'mplsL3VpnVrfPerfEntry', $mpls_vpn_vrf, 'MPLS-L3VPN-STD-MIB');
|
||||
$mpls_vpn_vrf = snmpwalk_cache_oid($device, 'mplsL3VpnVrfPerfEntry', $mpls_vpn_vrf, 'MPLS-L3VPN-STD-MIB');
|
||||
print_debug_vars($mpls_vpn_vrf);
|
||||
|
||||
foreach ($mpls_vpn_vrf as $vrf_name => $entry) {
|
||||
if ($entry['mplsL3VpnVrfConfRowStatus'] !== 'active') { continue; } // Skip inactive
|
||||
if ($entry['mplsL3VpnVrfConfRowStatus'] !== 'active') {
|
||||
continue;
|
||||
} // Skip inactive
|
||||
|
||||
/* Juniper specific case:
|
||||
mplsL3VpnVrfRD."BeamMGMT" = "10.51.0.236:666"
|
||||
mplsL3VpnVrfRD."CUST_ALX" = "134743L:12007"
|
||||
mplsL3VpnVrfRD."Mgmt-intf" = "10.51.0.236:667"
|
||||
*/
|
||||
$discovery_vrf[$vrf_name] = [
|
||||
'vrf_mib' => $mib,
|
||||
'vrf_name' => $vrf_name,
|
||||
'vrf_descr' => $entry['mplsL3VpnVrfDescription'],
|
||||
'vrf_rd' => str_replace('L', '', $entry['mplsL3VpnVrfRD']),
|
||||
/* Juniper specific case:
|
||||
mplsL3VpnVrfRD."BeamMGMT" = "10.51.0.236:666"
|
||||
mplsL3VpnVrfRD."CUST_ALX" = "134743L:12007"
|
||||
mplsL3VpnVrfRD."Mgmt-intf" = "10.51.0.236:667"
|
||||
*/
|
||||
$discovery_vrf[$vrf_name] = [
|
||||
'vrf_mib' => $mib,
|
||||
'vrf_name' => $vrf_name,
|
||||
'vrf_descr' => $entry['mplsL3VpnVrfDescription'],
|
||||
'vrf_rd' => str_replace('L', '', $entry['mplsL3VpnVrfRD']),
|
||||
|
||||
'vrf_admin_status' => $entry['mplsL3VpnVrfConfAdminStatus'],
|
||||
'vrf_oper_status' => $entry['mplsL3VpnVrfOperStatus'],
|
||||
'vrf_active_ports' => $entry['mplsL3VpnVrfActiveInterfaces'],
|
||||
'vrf_total_ports' => $entry['mplsL3VpnVrfAssociatedInterfaces'],
|
||||
'vrf_added_routes' => $entry['mplsL3VpnVrfPerfRoutesAdded'],
|
||||
'vrf_deleted_routes' => $entry['mplsL3VpnVrfPerfRoutesDeleted'],
|
||||
'vrf_total_routes' => $entry['mplsL3VpnVrfPerfCurrNumRoutes'],
|
||||
//'vrf_added' => $vrf_discovered - timeticks_to_sec($entry['mplsL3VpnVrfCreationTime']),
|
||||
'vrf_added' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsL3VpnVrfCreationTime']),
|
||||
'vrf_last_change' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsL3VpnVrfConfLastChanged']),
|
||||
];
|
||||
'vrf_admin_status' => $entry['mplsL3VpnVrfConfAdminStatus'],
|
||||
'vrf_oper_status' => $entry['mplsL3VpnVrfOperStatus'],
|
||||
'vrf_active_ports' => $entry['mplsL3VpnVrfActiveInterfaces'],
|
||||
'vrf_total_ports' => $entry['mplsL3VpnVrfAssociatedInterfaces'],
|
||||
'vrf_added_routes' => $entry['mplsL3VpnVrfPerfRoutesAdded'],
|
||||
'vrf_deleted_routes' => $entry['mplsL3VpnVrfPerfRoutesDeleted'],
|
||||
'vrf_total_routes' => $entry['mplsL3VpnVrfPerfCurrNumRoutes'],
|
||||
//'vrf_added' => $vrf_discovered - timeticks_to_sec($entry['mplsL3VpnVrfCreationTime']),
|
||||
'vrf_added' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsL3VpnVrfCreationTime']),
|
||||
'vrf_last_change' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsL3VpnVrfConfLastChanged']),
|
||||
];
|
||||
}
|
||||
|
||||
// MPLS-L3VPN-STD-MIB::mplsL3VpnIfConfRowStatus."SA_MPLS".32 = INTEGER: active(1)
|
||||
@ -130,15 +132,17 @@ foreach ($mpls_vpn_vrf as $vrf_name => $entry) {
|
||||
$mpls_vpn_if = snmpwalk_cache_twopart_oid($device, 'mplsL3VpnIfConfRowStatus', [], 'MPLS-L3VPN-STD-MIB');
|
||||
print_debug_vars($mpls_vpn_if);
|
||||
foreach ($mpls_vpn_if as $vrf_name => $entry) {
|
||||
if (!isset($discovery_vrf[$vrf_name])) {
|
||||
print_debug("Unknown VRF name '$vrf_name'.");
|
||||
continue;
|
||||
}
|
||||
if (!isset($discovery_vrf[$vrf_name])) {
|
||||
print_debug("Unknown VRF name '$vrf_name'.");
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($entry as $vrf_ifIndex => $entry2) {
|
||||
if ($entry2['mplsL3VpnIfConfRowStatus'] !== 'active') { continue; } // Skip inactive interfaces
|
||||
$discovery_vrf[$vrf_name]['ifIndex'][] = $vrf_ifIndex;
|
||||
}
|
||||
foreach ($entry as $vrf_ifIndex => $entry2) {
|
||||
if ($entry2['mplsL3VpnIfConfRowStatus'] !== 'active') {
|
||||
continue;
|
||||
} // Skip inactive interfaces
|
||||
$discovery_vrf[$vrf_name]['ifIndex'][] = $vrf_ifIndex;
|
||||
}
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
||||
@ -4,20 +4,20 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
if (snmp_get_oid($device, 'mplsVpnConfiguredVrfs.0', 'MPLS-VPN-MIB') <= 0) {
|
||||
print_debug("Not found VRFs by MPLS-VPN-MIB.");
|
||||
return;
|
||||
print_debug("Not found VRFs by MPLS-VPN-MIB.");
|
||||
return;
|
||||
}
|
||||
if (safe_count($discovery_vrf) &&
|
||||
$discovery_vrf[array_key_first($discovery_vrf)]['vrf_mib'] === 'MPLS-L3VPN-STD-MIB') {
|
||||
print_debug("VRFs already discovered by MPLS-L3VPN-STD-MIB, skip MPLS-VPN-MIB.");
|
||||
return;
|
||||
print_debug("VRFs already discovered by MPLS-L3VPN-STD-MIB, skip MPLS-VPN-MIB.");
|
||||
return;
|
||||
}
|
||||
|
||||
// MPLS-VPN-MIB::mplsVpnVrfDescription."hostcomm-private" = STRING:
|
||||
@ -33,7 +33,7 @@ if (safe_count($discovery_vrf) &&
|
||||
// MPLS-VPN-MIB::mplsVpnVrfConfRowStatus."hostcomm-private" = INTEGER: active(1)
|
||||
// MPLS-VPN-MIB::mplsVpnVrfConfStorageType."hostcomm-private" = INTEGER: volatile(2)
|
||||
|
||||
$mpls_vpn_vrf = snmpwalk_cache_oid($device, 'mplsVpnVrfEntry', [], 'MPLS-VPN-MIB');
|
||||
$mpls_vpn_vrf = snmpwalk_cache_oid($device, 'mplsVpnVrfEntry', [], 'MPLS-VPN-MIB');
|
||||
$vrf_discovered = snmp_endtime();
|
||||
|
||||
#$mpls_vpn_target = snmpwalk_cache_oid($device, 'mplsVpnVrfRouteTargetEntry', [], 'MPLS-VPN-MIB');
|
||||
@ -44,28 +44,30 @@ $vrf_discovered = snmp_endtime();
|
||||
// MPLS-VPN-MIB::mplsVpnVrfPerfRoutesAdded."hostcomm-private" = Counter32: 723
|
||||
// MPLS-VPN-MIB::mplsVpnVrfPerfRoutesDeleted."hostcomm-private" = Counter32: 585
|
||||
// MPLS-VPN-MIB::mplsVpnVrfPerfCurrNumRoutes."hostcomm-private" = Gauge32: 138
|
||||
$mpls_vpn_vrf = snmpwalk_cache_oid($device, 'mplsVpnVrfPerfEntry', $mpls_vpn_vrf, 'MPLS-VPN-MIB');
|
||||
$mpls_vpn_vrf = snmpwalk_cache_oid($device, 'mplsVpnVrfPerfEntry', $mpls_vpn_vrf, 'MPLS-VPN-MIB');
|
||||
print_debug_vars($mpls_vpn_vrf);
|
||||
|
||||
foreach ($mpls_vpn_vrf as $vrf_name => $entry) {
|
||||
if ($entry['mplsVpnVrfConfRowStatus'] !== 'active') { continue; } // Skip inactive
|
||||
if ($entry['mplsVpnVrfConfRowStatus'] !== 'active') {
|
||||
continue;
|
||||
} // Skip inactive
|
||||
|
||||
$discovery_vrf[$vrf_name] = [
|
||||
'vrf_mib' => $mib,
|
||||
'vrf_name' => $vrf_name,
|
||||
'vrf_descr' => $entry['mplsVpnVrfDescription'],
|
||||
'vrf_rd' => str_replace('L', '', $entry['mplsVpnVrfRouteDistinguisher']),
|
||||
//'vrf_admin_status' => 'up',
|
||||
'vrf_oper_status' => $entry['mplsVpnVrfOperStatus'],
|
||||
'vrf_active_ports' => $entry['mplsVpnVrfActiveInterfaces'],
|
||||
'vrf_total_ports' => $entry['mplsVpnVrfAssociatedInterfaces'],
|
||||
'vrf_added_routes' => $entry['mplsVpnVrfPerfRoutesAdded'],
|
||||
'vrf_deleted_routes' => $entry['mplsVpnVrfPerfRoutesDeleted'],
|
||||
'vrf_total_routes' => $entry['mplsVpnVrfPerfCurrNumRoutes'],
|
||||
// device starttime + time
|
||||
'vrf_added' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsVpnVrfCreationTime']),
|
||||
'vrf_last_change' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsVpnVrfConfLastChanged']),
|
||||
];
|
||||
$discovery_vrf[$vrf_name] = [
|
||||
'vrf_mib' => $mib,
|
||||
'vrf_name' => $vrf_name,
|
||||
'vrf_descr' => $entry['mplsVpnVrfDescription'],
|
||||
'vrf_rd' => str_replace('L', '', $entry['mplsVpnVrfRouteDistinguisher']),
|
||||
//'vrf_admin_status' => 'up',
|
||||
'vrf_oper_status' => $entry['mplsVpnVrfOperStatus'],
|
||||
'vrf_active_ports' => $entry['mplsVpnVrfActiveInterfaces'],
|
||||
'vrf_total_ports' => $entry['mplsVpnVrfAssociatedInterfaces'],
|
||||
'vrf_added_routes' => $entry['mplsVpnVrfPerfRoutesAdded'],
|
||||
'vrf_deleted_routes' => $entry['mplsVpnVrfPerfRoutesDeleted'],
|
||||
'vrf_total_routes' => $entry['mplsVpnVrfPerfCurrNumRoutes'],
|
||||
// device starttime + time
|
||||
'vrf_added' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsVpnVrfCreationTime']),
|
||||
'vrf_last_change' => $device['last_rebooted'] + timeticks_to_sec($entry['mplsVpnVrfConfLastChanged']),
|
||||
];
|
||||
}
|
||||
|
||||
// MPLS-VPN-MIB::mplsVpnInterfaceConfRowStatus."hostcomm-private".143 = INTEGER: active(1)
|
||||
@ -76,15 +78,17 @@ $mpls_vpn_if = snmpwalk_cache_twopart_oid($device, 'mplsVpnInterfaceConfRowStatu
|
||||
print_debug_vars($mpls_vpn_if);
|
||||
|
||||
foreach ($mpls_vpn_if as $vrf_name => $entry) {
|
||||
if (!isset($discovery_vrf[$vrf_name])) {
|
||||
print_debug("Unknown VRF name '$vrf_name'.");
|
||||
continue;
|
||||
}
|
||||
if (!isset($discovery_vrf[$vrf_name])) {
|
||||
print_debug("Unknown VRF name '$vrf_name'.");
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($entry as $vrf_ifIndex => $entry2) {
|
||||
if ($entry2['mplsVpnInterfaceConfRowStatus'] !== 'active') { continue; } // Skip inactive interfaces
|
||||
$discovery_vrf[$vrf_name]['ifIndex'][] = $vrf_ifIndex;
|
||||
}
|
||||
foreach ($entry as $vrf_ifIndex => $entry2) {
|
||||
if ($entry2['mplsVpnInterfaceConfRowStatus'] !== 'active') {
|
||||
continue;
|
||||
} // Skip inactive interfaces
|
||||
$discovery_vrf[$vrf_name]['ifIndex'][] = $vrf_ifIndex;
|
||||
}
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
||||
Reference in New Issue
Block a user