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 poller
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
* @package observium
* @subpackage poller
* @copyright (C) Adam Armstrong
*
*/
@ -14,8 +14,8 @@
$port_module = 'vlan';
if (!$ports_modules[$port_module]) {
// Module disabled
return FALSE; // False for do not collect stats
// Module disabled
return FALSE; // False for do not collect stats
}
$start = microtime(TRUE); // Module timing start
@ -27,44 +27,38 @@ $start = microtime(TRUE); // Module timing start
echo("atiStkSwVlanTaggedPortListModule1 atiStkSwVlanUntaggedPortListModule1 ");
$entries = snmpwalk_cache_oid($device, 'atiStkSwVlanTaggedPortListModule1', [], $mib);
$entries = snmpwalk_cache_oid($device, 'atiStkSwVlanTaggedPortListModule1', [], $mib);
$entries = snmpwalk_cache_oid($device, 'atiStkSwVlanUntaggedPortListModule1', $entries, $mib);
print_debug_vars($entries);
$ports_vlans = [];
foreach ($entries as $vlan_num => $vlan)
{
foreach (list_to_range($vlan['atiStkSwVlanTaggedPortListModule1']) as $ifIndex)
{
$ports_vlans[$ifIndex]['tagged'][] = $vlan_num;
}
foreach (list_to_range($vlan['atiStkSwVlanUntaggedPortListModule1']) as $ifIndex)
{
$ports_vlans[$ifIndex]['untagged'][] = $vlan_num;
}
foreach ($entries as $vlan_num => $vlan) {
foreach (list_to_range($vlan['atiStkSwVlanTaggedPortListModule1']) as $ifIndex) {
$ports_vlans[$ifIndex]['tagged'][] = $vlan_num;
}
foreach (list_to_range($vlan['atiStkSwVlanUntaggedPortListModule1']) as $ifIndex) {
$ports_vlans[$ifIndex]['untagged'][] = $vlan_num;
}
}
$vlan_rows = array();
foreach ($ports_vlans as $ifIndex => $vlan)
{
$trunk = '';
if (isset($vlan['tagged']))
{
$trunk = 'dot1Q';
}
$vlan_rows = [];
foreach ($ports_vlans as $ifIndex => $vlan) {
$trunk = '';
if (isset($vlan['tagged'])) {
$trunk = 'dot1Q';
}
foreach ($vlan['untagged'] as $vlan_num)
{
$vlan_rows[] = array($ifIndex, $vlan_num, $trunk);
}
foreach ($vlan['untagged'] as $vlan_num) {
$vlan_rows[] = [$ifIndex, $vlan_num, $trunk];
}
// Set Vlan and Trunk
$port_stats[$ifIndex]['ifVlan'] = $vlan_num;
$port_stats[$ifIndex]['ifTrunk'] = $trunk;
// Set Vlan and Trunk
$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);
// EOF