initial commit; version 22.5.12042
This commit is contained in:
49
includes/polling/fdb/atistackswitch9424-mib.inc.php
Normal file
49
includes/polling/fdb/atistackswitch9424-mib.inc.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// Exit if already founded fdb entries
|
||||
if (safe_count($fdbs)) { return; }
|
||||
|
||||
/*
|
||||
AtiStackSwitch9424-MIB::atiStkSwMacAddrPortId[0:1:80:4a:17:19][30] = 23
|
||||
*/
|
||||
|
||||
$entries = snmpwalk_cache_twopart_oid($device, 'atiStkSwMacAddrPortId', [], $mib, NULL, OBS_SNMP_ALL_TABLE);
|
||||
print_debug_vars($entries);
|
||||
|
||||
foreach($entries as $mac => $data1)
|
||||
{
|
||||
foreach ($data1 as $vlan => $entry)
|
||||
{
|
||||
// Make sure the ifIndex is actually valid
|
||||
if ($entry['atiStkSwMacAddrPortId'] != 0 && is_array($port_ifIndex_table[$entry['atiStkSwMacAddrPortId']]))
|
||||
{
|
||||
$port = $port_ifIndex_table[$entry['atiStkSwMacAddrPortId']];
|
||||
|
||||
$mac = mac_zeropad($mac);
|
||||
|
||||
$data = [];
|
||||
|
||||
$data['port_id'] = $port['port_id'];
|
||||
$data['port_index'] = $entry['atiStkSwMacAddrPortId'];
|
||||
$data['fdb_status'] = 'learned';
|
||||
|
||||
$fdbs[$vlan][$mac] = $data;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
unset($entries);
|
||||
|
||||
// EOF
|
62
includes/polling/fdb/extreme-fdb-mib.inc.php
Normal file
62
includes/polling/fdb/extreme-fdb-mib.inc.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// Exit if already founded fdb entries
|
||||
if (safe_count($fdbs)) { return; }
|
||||
|
||||
// EXTREME-FDB-MIB::extremeFdbMacExosFdbPortIfIndex[0:4:96:52:f1:1d][1000053] = 1052
|
||||
// EXTREME-FDB-MIB::extremeFdbMacExosFdbStatus[0:4:96:52:f1:1d][1000053] = learned
|
||||
$entries = snmpwalk_cache_twopart_oid($device, 'extremeFdbMacExosFdbPortIfIndex', array(), 'EXTREME-FDB-MIB', NULL, OBS_SNMP_ALL_TABLE);
|
||||
|
||||
if (snmp_status())
|
||||
{
|
||||
$entries = snmpwalk_cache_twopart_oid($device, 'extremeFdbMacExosFdbStatus', $entries, 'EXTREME-FDB-MIB', NULL, OBS_SNMP_ALL_TABLE);
|
||||
print_debug_vars($entries);
|
||||
|
||||
foreach($entries as $mac => $data1)
|
||||
{
|
||||
foreach ($data1 as $vlan_index => $entry)
|
||||
{
|
||||
|
||||
// Seach vlan number by discovered vlans
|
||||
$vlan_port = $port_ifIndex_table[$vlan_index];
|
||||
if (preg_match('/^VLAN\s*0*(\d+)/i', $vlan_port['ifDescr'], $matches))
|
||||
{
|
||||
$vlan = $matches[1];
|
||||
} else {
|
||||
$vlan = $vlan_index; // Incorrect, but better than nothing
|
||||
}
|
||||
|
||||
// Make sure the ifIndex is actually valid
|
||||
if ($entry['extremeFdbMacExosFdbPortIfIndex'] != 0 && is_array($port_ifIndex_table[$entry['extremeFdbMacExosFdbPortIfIndex']]))
|
||||
{
|
||||
$port = $port_ifIndex_table[$entry['extremeFdbMacExosFdbPortIfIndex']];
|
||||
|
||||
$mac = mac_zeropad($mac);
|
||||
|
||||
$data = array();
|
||||
|
||||
$data['port_id'] = $port['port_id'];
|
||||
$data['port_index'] = $entry['extremeFdbMacExosFdbPortIfIndex'];
|
||||
$data['fdb_status'] = $entry['extremeFdbMacExosFdbStatus'];
|
||||
|
||||
$fdbs[$vlan][$mac] = $data;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($entries);
|
||||
|
||||
// EOF
|
52
includes/polling/fdb/huawei-l2mam-mib.inc.php
Normal file
52
includes/polling/fdb/huawei-l2mam-mib.inc.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// Exit if already founded fdb entries
|
||||
if (safe_count($fdbs)) { return; }
|
||||
|
||||
// hwDynFdbPort[0:e0:4c:xx:xx:xx][99][0] 7
|
||||
$entries = snmpwalk_cache_threepart_oid($device, 'hwDynFdbPort', array(), 'HUAWEI-L2MAM-MIB', NULL, OBS_SNMP_ALL_TABLE);
|
||||
print_debug_vars($entries);
|
||||
|
||||
if (snmp_status()) {
|
||||
foreach ($entries as $mac => $data1) {
|
||||
foreach ($data1 as $vlan => $data2) {
|
||||
foreach ($data2 as $vsi => $entry) {
|
||||
|
||||
// Make sure the ifIndex is actually valid
|
||||
if ($entry['hwDynFdbPort'] != 0 && is_array($port_ifIndex_table[$entry['hwDynFdbPort']])) {
|
||||
$port = $port_ifIndex_table[$entry['hwDynFdbPort']];
|
||||
$mac = mac_zeropad($mac);
|
||||
|
||||
$data = array();
|
||||
|
||||
$data['port_id'] = $port['port_id'];
|
||||
$data['port_index'] = $entry['hwDynFdbPort'];
|
||||
$data['fdb_status'] = 'learned'; // Hardcoded for this MIB
|
||||
|
||||
$fdbs[$vlan][$mac] = $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($entries);
|
||||
//return;
|
||||
}
|
||||
|
||||
// Alternative entries
|
||||
// HUAWEI-L2MAM-MIB::hwDynMacAddrQueryIfIndex.18."0"."0".0.'...#.<'.showall."0"."0".0.0.0 = INTEGER: 28
|
||||
/* DEV
|
||||
$entries = snmpwalk_multipart_oid($device, 'hwDynMacAddrQueryIfIndex', [], 'HUAWEI-L2MAM-MIB', NULL, OBS_SNMP_ALL_TABLE);
|
||||
print_debug_vars($entries);
|
||||
*/
|
||||
|
||||
// EOF
|
99
includes/polling/fdb/rapid-city.inc.php
Normal file
99
includes/polling/fdb/rapid-city.inc.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// Exit if already founded fdb entries
|
||||
if (safe_count($fdbs)) { return; }
|
||||
|
||||
/*
|
||||
RAPID-CITY::rcBridgeNewFdbStatus[0:1:59:2:36:40][6] = learned
|
||||
RAPID-CITY::rcBridgeNewFdbPort[0:1:59:2:36:40][6] = 662
|
||||
*/
|
||||
|
||||
$entries = snmpwalk_cache_twopart_oid($device, 'rcBridgeNewFdbPort', array(), 'RAPID-CITY', NULL, OBS_SNMP_ALL_TABLE);
|
||||
|
||||
if (snmp_status())
|
||||
{
|
||||
$entries = snmpwalk_cache_twopart_oid($device, 'rcBridgeNewFdbStatus', $entries, 'RAPID-CITY', NULL, OBS_SNMP_ALL_TABLE);
|
||||
print_debug_vars($entries);
|
||||
|
||||
foreach($entries as $mac => $data1)
|
||||
{
|
||||
foreach ($data1 as $vlan => $entry)
|
||||
{
|
||||
|
||||
// Make sure the ifIndex is actually valid
|
||||
if ($entry['rcBridgeNewFdbPort'] != 0 && is_array($port_ifIndex_table[$entry['rcBridgeNewFdbPort']]))
|
||||
{
|
||||
$port = $port_ifIndex_table[$entry['rcBridgeNewFdbPort']];
|
||||
|
||||
$mac = mac_zeropad($mac);
|
||||
|
||||
$data = array();
|
||||
|
||||
$data['port_id'] = $port['port_id'];
|
||||
$data['port_index'] = $entry['rcBridgeNewFdbPort'];
|
||||
$data['fdb_status'] = $entry['rcBridgeNewFdbStatus'];
|
||||
|
||||
$fdbs[$vlan][$mac] = $data;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// if its not rcBridge then may be its spbm
|
||||
|
||||
// rcBridgeSpbmMacStatus[1500050][14:61:2f:ec:49:1] = learned
|
||||
// rcBridgeSpbmMacCPort[1500050][14:61:2f:ec:49:1] = 50
|
||||
$entries = snmpwalk_cache_twopart_oid($device, 'rcBridgeSpbmMacCPort', array(), 'RAPID-CITY', NULL, OBS_SNMP_ALL_TABLE);
|
||||
if (snmp_status())
|
||||
{
|
||||
$entries = snmpwalk_cache_twopart_oid($device, 'rcBridgeSpbmMacStatus', $entries, 'RAPID-CITY', NULL, OBS_SNMP_ALL_TABLE);
|
||||
print_debug_vars($entries);
|
||||
|
||||
$entries = snmpwalk_cache_twopart_oid($device, 'rcBridgeSpbmMacType', $entries, 'RAPID-CITY', NULL, OBS_SNMP_ALL_TABLE);
|
||||
print_debug_vars($entries);
|
||||
|
||||
$entries = snmpwalk_cache_twopart_oid($device, 'rcBridgeSpbmMacCVlanId', $entries, 'RAPID-CITY', NULL, OBS_SNMP_ALL_TABLE);
|
||||
print_debug_vars($entries);
|
||||
|
||||
foreach($entries as $isid => $data1)
|
||||
{
|
||||
foreach ($data1 as $mac => $entry)
|
||||
{
|
||||
|
||||
// Make sure the ifIndex is actually valid
|
||||
if ($entry['rcBridgeSpbmMacType'] == "local" && is_array($port_ifIndex_table[$entry['rcBridgeSpbmMacCPort']]))
|
||||
{
|
||||
$port = $port_ifIndex_table[$entry['rcBridgeSpbmMacCPort']];
|
||||
|
||||
$mac = mac_zeropad($mac);
|
||||
|
||||
$data = array();
|
||||
|
||||
$data['port_id'] = $port['port_id'];
|
||||
$data['port_index'] = $entry['rcBridgeSpbmMacCPort'];
|
||||
$data['fdb_status'] = $entry['rcBridgeSpbmMacStatus'];
|
||||
$vlan = $entry['rcBridgeSpbmMacCVlanId'];
|
||||
|
||||
$fdbs[$vlan][$mac] = $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($entries);
|
||||
|
||||
// EOF
|
60
includes/polling/fdb/tplink-l2bridge-mib.inc.php
Normal file
60
includes/polling/fdb/tplink-l2bridge-mib.inc.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// Exit if already founded fdb entries
|
||||
if (safe_count($fdbs)) { return; }
|
||||
|
||||
// TPLINK-L2BRIDGE-MIB::tpl2BridgeManagePortIndex.49153 = STRING: 1/0/1
|
||||
// TPLINK-L2BRIDGE-MIB::tpl2BridgeManagePortIndex.49154 = STRING: 1/0/2
|
||||
$fdb_ports = [];
|
||||
foreach (snmpwalk_cache_oid($device, 'tpl2BridgeManagePortIndex', [], 'TPLINK-L2BRIDGE-MIB') as $ifIndex => $entry) {
|
||||
$fdb_ports[$entry['tpl2BridgeManagePortIndex']] = $ifIndex;
|
||||
}
|
||||
if (!snmp_status()) { return; }
|
||||
|
||||
// TPLINK-L2BRIDGE-MIB::tpl2BridgeManageDynMac.20.88.208.75.9.0.10 = STRING: "14-58-d0-4b-09-00"
|
||||
// TPLINK-L2BRIDGE-MIB::tpl2BridgeManageDynMac.20.88.208.75.9.0.744 = STRING: "14-58-d0-4b-09-00"
|
||||
// TPLINK-L2BRIDGE-MIB::tpl2BridgeManageDynVlanId.20.88.208.75.9.0.10 = INTEGER: 10
|
||||
// TPLINK-L2BRIDGE-MIB::tpl2BridgeManageDynVlanId.20.88.208.75.9.0.744 = INTEGER: 744
|
||||
// TPLINK-L2BRIDGE-MIB::tpl2BridgeManageDynPort.20.88.208.75.9.0.10 = STRING: "1/0/4"
|
||||
// TPLINK-L2BRIDGE-MIB::tpl2BridgeManageDynPort.20.88.208.75.9.0.744 = STRING: "1/0/28"
|
||||
// TPLINK-L2BRIDGE-MIB::tpl2BridgeManageDynAgeStatus.20.88.208.75.9.0.10 = INTEGER: aging(1)
|
||||
// TPLINK-L2BRIDGE-MIB::tpl2BridgeManageDynAgeStatus.20.88.208.75.9.0.744 = INTEGER: aging(1)
|
||||
// TPLINK-L2BRIDGE-MIB::tpl2BridgeManageDynStatus.20.88.208.75.9.0.10 = INTEGER: active(1)
|
||||
// TPLINK-L2BRIDGE-MIB::tpl2BridgeManageDynStatus.20.88.208.75.9.0.744 = INTEGER: active(1)
|
||||
foreach (snmpwalk_cache_oid($device, 'tpl2BridgeManageDynAddrCtrlTable', [], 'TPLINK-L2BRIDGE-MIB', NULL, OBS_SNMP_ALL_NUMERIC_INDEX) as $index => $entry) {
|
||||
if ($entry['tpl2BridgeManageDynAgeStatus'] !== 'aging') { continue; }
|
||||
if (!isset($fdb_ports[$entry['tpl2BridgeManageDynPort']])) {
|
||||
print_debug("Unknown port '".$entry['tpl2BridgeManageDynPort']."'.");
|
||||
print_debug_vars($entry);
|
||||
continue;
|
||||
}
|
||||
|
||||
$ifIndex = $fdb_ports[$entry['tpl2BridgeManageDynPort']];
|
||||
$vlan = $entry['tpl2BridgeManageDynVlanId'];
|
||||
|
||||
// Make sure the ifIndex is actually valid
|
||||
if ($ifIndex != 0 && is_array($port_ifIndex_table[$ifIndex])) {
|
||||
$port = $port_ifIndex_table[$ifIndex];
|
||||
$mac = mac_zeropad($entry['tpl2BridgeManageDynMac']);
|
||||
|
||||
$data = [];
|
||||
|
||||
$data['port_id'] = $port['port_id'];
|
||||
$data['port_index'] = $ifIndex;
|
||||
$data['fdb_status'] = 'learned'; // Hardcoded for this MIB
|
||||
|
||||
$fdbs[$vlan][$mac] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
// EOF
|
Reference in New Issue
Block a user