Commit version 24.12.13800
This commit is contained in:
@ -4,9 +4,9 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
$port_module = 'vlan';
|
||||
|
||||
if (!$ports_modules[$port_module]) {
|
||||
return FALSE; // False for do not collect stats
|
||||
return FALSE; // False for do not collect stats
|
||||
}
|
||||
|
||||
//CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB::cviRoutedVlanIfIndex.1.8 = INTEGER: 8
|
||||
@ -25,34 +25,31 @@ if (!$ports_modules[$port_module]) {
|
||||
//CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB::cviRoutedVlanIfIndex.210.8 = INTEGER: 16
|
||||
//CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB::cviRoutedVlanIfIndex.222.8 = INTEGER: 24
|
||||
|
||||
$vlan_oids = snmpwalk_cache_oid($device, "cviRoutedVlanIfIndex", array(), "CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB"); // Routed ports only
|
||||
$vlan_oids = snmpwalk_cache_oid($device, "cviRoutedVlanIfIndex", [], "CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB"); // Routed ports only
|
||||
|
||||
if (snmp_status())
|
||||
{
|
||||
echo("cviRoutedVlanIfIndex ");
|
||||
print_debug_vars($vlan_oids);
|
||||
if (snmp_status()) {
|
||||
echo("cviRoutedVlanIfIndex ");
|
||||
print_debug_vars($vlan_oids);
|
||||
|
||||
$vlan_rows = array();
|
||||
foreach ($vlan_oids as $index => $entry)
|
||||
{
|
||||
$vlan_rows = [];
|
||||
foreach ($vlan_oids as $index => $entry) {
|
||||
|
||||
list($vlan_num, $phyifIndex) = explode('.', $index);
|
||||
$ifIndex = $entry['cviRoutedVlanIfIndex'];
|
||||
$trunk = 'routed';
|
||||
[$vlan_num, $phyifIndex] = explode('.', $index);
|
||||
$ifIndex = $entry['cviRoutedVlanIfIndex'];
|
||||
$trunk = 'routed';
|
||||
|
||||
$vlan_rows[] = array($ifIndex, $vlan_num, $trunk);
|
||||
$vlan_rows[] = [$ifIndex, $vlan_num, $trunk];
|
||||
|
||||
// Set Vlan and Trunk
|
||||
if (isset($port_stats[$ifIndex]) && !is_numeric($port_stats[$ifIndex]['ifVlan']))
|
||||
{
|
||||
$port_stats[$ifIndex]['ifVlan'] = $vlan_num;
|
||||
$port_stats[$ifIndex]['ifTrunk'] = $trunk;
|
||||
// Set Vlan and Trunk
|
||||
if (isset($port_stats[$ifIndex]) && !is_numeric($port_stats[$ifIndex]['ifVlan'])) {
|
||||
$port_stats[$ifIndex]['ifVlan'] = $vlan_num;
|
||||
$port_stats[$ifIndex]['ifTrunk'] = $trunk;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$headers = array('%WifIndex%n', '%WVlan%n', '%WTrunk%n');
|
||||
$headers = ['%WifIndex%n', '%WVlan%n', '%WTrunk%n'];
|
||||
print_cli_table($vlan_rows, $headers);
|
||||
|
||||
//$process_port_functions[$port_module] = $GLOBALS['snmp_status'];
|
||||
|
Reference in New Issue
Block a user