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
*
*/
@ -19,13 +19,15 @@
*
* Thin AP Table 1.3.6.1.4.1.14179.2.2.1.1 enterprises.airespace.bsnWireless.bsnAP.bsnAPTable.bsnAPEntry
* ##poll## RadioMacAddress 1.3.6.1.4.1.14179.2.2.1.1.1 bsnAPDot3MacAddress
* ##poll## NumRadioSlots 1.3.6.1.4.1.14179.2.2.1.1.2 bsnAPNumOfSlots INTEGER ( 0 .. 24) Number of Radio Interfaces on the Airespace AP.
* ##poll## NumRadioSlots 1.3.6.1.4.1.14179.2.2.1.1.2 bsnAPNumOfSlots INTEGER ( 0 .. 24) Number of Radio Interfaces on
* the Airespace AP.
* ##poll## IPAddress 1.3.6.1.4.1.14179.2.2.1.1.19 bsnApIpAddress
* ##poll## Name 1.3.6.1.4.1.14179.2.2.1.1.3 bsnAPName OCTET STRING ( SIZE ( 0 .. 32))
* ##poll## Location 1.3.6.1.4.1.14179.2.2.1.1.4 bsnAPLocation OCTET STRING ( SIZE ( 0 .. 80))
* ##poll## Model 1.3.6.1.4.1.14179.2.2.1.1.16 bsnAPModel
* ##poll## Serial 1.3.6.1.4.1.14179.2.2.1.1.17 bsnAPSerialNumber
* ##poll## OperStatus 1.3.6.1.4.1.14179.2.2.1.1.6 bsnAPOperationStatus INTEGER { associated ( 1), disassociating ( 2), downloading ( 3) }
* ##poll## OperStatus 1.3.6.1.4.1.14179.2.2.1.1.6 bsnAPOperationStatus INTEGER { associated ( 1), disassociating ( 2),
* downloading ( 3) }
* ##poll## AdminStatus 1.3.6.1.4.1.14179.2.2.1.1.37 bsnAPAdminStatus INTEGER { enable ( 1), disable ( 2) }
*
* Thin AP Members Table 1.3.6.1.4.1.14179.2.2.2 enterprises.airespace.bsnWireless.bsnAP.bsnAPIfTable.bsnAPIfEntry
@ -33,49 +35,54 @@
* ##poll## OperStatus 1.3.6.1.4.1.14179.2.2.2.1.12 bsnAPIfOperStatus INTEGER { down ( 1), up ( 2) }
* ##poll## AdminStatus 1.3.6.1.4.1.14179.2.2.2.1.34 bsnAPIfAdminStatus INTEGER { disable ( 2), enable ( 1) }
* TxPowerControl 1.3.6.1.4.1.14179.2.2.2.1.5 bsnAPIfPhyTxPowerControl INTEGER { automatic ( 1), customized ( 2) }
* TxPowerLevel 1.3.6.1.4.1.14179.2.2.2.1.6 bsnAPIfPhyTxPowerLevel INTEGER ( 1 .. 8) Valid values are between 1 to 8,depnding on what radio, and this attribute can be set only if bsnAPIfPhyTxPowerControl is set to customized.
* TxPowerLevel 1.3.6.1.4.1.14179.2.2.2.1.6 bsnAPIfPhyTxPowerLevel INTEGER ( 1 .. 8) Valid values are between 1 to
* 8,depnding on what radio, and this attribute can be set only if bsnAPIfPhyTxPowerControl is set to customized.
* ##poll## CurrentChannel 1.3.6.1.4.1.14179.2.2.2.1.4 bsnAPIfPhyChannelNumber
* ##poll## RadioType 1.3.6.1.4.1.14179.2.2.2.1.2 bsnAPIfType INTEGER { dot11b ( 1), dot11a ( 2), uwb ( 4) }
* ##poll## ConnUsers 1.3.6.1.4.1.14179.2.2.2.1.15 bsnApIfNoOfUsers Counter32
*
* Controller WLANs Table 1.3.6.1.4.1.14179.2.1.1 enterprises.airespace.bsnWireless.bsnEss.bsnDot11EssTable.bsnDot11EssEntry
* SSID Index 1.3.6.1.4.1.14179.2.1.1.1.1 bsnDot11EssIndex **** also on CISCO-LWAPP-AP-MIB 1.3.6.1.4.1.9.9.512.1.1.1.1.1 cLWlanIndex ****
* SSID Name 1.3.6.1.4.1.14179.2.1.1.1.2 bsnDot11EssSsid **** also on CISCO-LWAPP-AP-MIB 1.3.6.1.4.1.9.9.512.1.1.1.1.4 cLWlanSsid ****
* CISCO-LWAPP-AP-MIB WLAN profile 1.3.6.1.4.1.9.9.512.1.1.1.1.3 cLWlanProfileName Must correlate bsnDot11EssIndex to cLWlanIndex from both MIB files
* AdminStatus 1.3.6.1.4.1.14179.2.1.1.1.6 bsnDot11EssAdminStatus INTEGER { disable ( 0), enable ( 1) }
* SSID QoS 1.3.6.1.4.1.14179.2.1.1.1.31 bsnDot11EssQualityOfService INTEGER { bronze ( 0), silver ( 1), gold ( 2), platinum ( 3) } Quality of Service for a WLAN.
* Connected clients 1.3.6.1.4.1.14179.2.1.1.1.38 bsnDot11EssNumberOfMobileStations Counter32 No of Mobile Stations currently associated with the WLAN.
* SSID interfname 1.3.6.1.4.1.14179.2.1.1.1.42 bsnDot11EssInterfaceName DisplayString ( SIZE ( 1 .. 32)) Name of the interface used by this WLAN.
* RowStatus 1.3.6.1.4.1.14179.2.1.1.1.60 bsnDot11EssRowStatus **** also on CISCO-LWAPP-AP-MIB 1.3.6.1.4.1.9.9.512.1.1.1.1.2 cLWlanRowStatus ****
* SSID Index 1.3.6.1.4.1.14179.2.1.1.1.1 bsnDot11EssIndex **** also on CISCO-LWAPP-AP-MIB
* 1.3.6.1.4.1.9.9.512.1.1.1.1.1 cLWlanIndex **** SSID Name 1.3.6.1.4.1.14179.2.1.1.1.2 bsnDot11EssSsid **** also
* on CISCO-LWAPP-AP-MIB 1.3.6.1.4.1.9.9.512.1.1.1.1.4 cLWlanSsid **** CISCO-LWAPP-AP-MIB WLAN profile 1.3.6.1.4.1.9.9.512.1.1.1.1.3
* cLWlanProfileName Must correlate bsnDot11EssIndex to cLWlanIndex from both MIB files AdminStatus
* 1.3.6.1.4.1.14179.2.1.1.1.6 bsnDot11EssAdminStatus INTEGER { disable ( 0), enable ( 1) } SSID QoS
* 1.3.6.1.4.1.14179.2.1.1.1.31 bsnDot11EssQualityOfService INTEGER { bronze ( 0), silver ( 1), gold ( 2), platinum ( 3) } Quality of
* Service for a WLAN. Connected clients 1.3.6.1.4.1.14179.2.1.1.1.38 bsnDot11EssNumberOfMobileStations Counter32 No of Mobile Stations
* currently associated with the WLAN. SSID interfname 1.3.6.1.4.1.14179.2.1.1.1.42 bsnDot11EssInterfaceName DisplayString (
* SIZE ( 1 .. 32)) Name of the interface used by this WLAN. RowStatus 1.3.6.1.4.1.14179.2.1.1.1.60 bsnDot11EssRowStatus
* **** also on CISCO-LWAPP-AP-MIB 1.3.6.1.4.1.9.9.512.1.1.1.1.2 cLWlanRowStatus ****
*
* Controller WLANs Security
*
* on CISCO-LWAPP-WLAN-SECURITY-MIB
*
* Table 1.3.6.1.4.1.9.9.521.1.1.1 enterprises.cisco.ciscoMgmt.ciscoLwappWlanSecurityMIB.ciscoLwappWlanSecurityMIBObjects.clwsCckmConfig.cLWSecDot11EssCckmTable.cLWSecDot11EssCckmEntry
* Table 1.3.6.1.4.1.9.9.521.1.1.1
* enterprises.cisco.ciscoMgmt.ciscoLwappWlanSecurityMIB.ciscoLwappWlanSecurityMIBObjects.clwsCckmConfig.cLWSecDot11EssCckmTable.cLWSecDot11EssCckmEntry
* SSID Index 1.3.6.1.4.1.9.9.512.1.1.1.1.1 cLWlanIndex
*
* Client Table 1.3.6.1.4.1.14179.2.1.4 enterprises.airespace.bsnWireless.bsnEss.bsnMobileStationTable.bsnMobileStationEntry
* IPAddress 1.3.6.1.4.1.14179.2.1.4.1.2 bsnMobileStationIpAddress
* Name 1.3.6.1.4.1.14179.2.1.4.1.3 bsnMobileStationUserName
* SSID 1.3.6.1.4.1.14179.2.1.4.1.7 bsnMobileStationSsid
* Status 1.3.6.1.4.1.14179.2.1.4.1.9 bsnMobileStationStatus INTEGER { idle ( 0), aaaPending ( 1), authenticated ( 2), associated ( 3), powersave ( 4), disassociated ( 5), tobedeleted ( 6), probing ( 7), blacklisted ( 8) }
* APMAC 1.3.6.1.4.1.14179.2.1.4.1.4 bsnMobileStationAPMacAddr
* InterfaceID 1.3.6.1.4.1.14179.2.1.4.1.5 bsnMobileStationAPIfSlotId INTEGER ( 0 .. 15)
* Status 1.3.6.1.4.1.14179.2.1.4.1.9 bsnMobileStationStatus INTEGER { idle ( 0), aaaPending ( 1), authenticated ( 2),
* associated ( 3), powersave ( 4), disassociated ( 5), tobedeleted ( 6), probing ( 7), blacklisted ( 8) } APMAC
* 1.3.6.1.4.1.14179.2.1.4.1.4 bsnMobileStationAPMacAddr InterfaceID 1.3.6.1.4.1.14179.2.1.4.1.5 bsnMobileStationAPIfSlotId
* INTEGER ( 0 .. 15)
*
* Table 1.3.6.1.4.1.14179.2.1.6 enterprises.airespace.bsnWireless.bsnEss.bsnMobileStationStatsTable.bsnMobileStationStatsEntry
* SignalStrength 1.3.6.1.4.1.14179.2.1.6.1.1 bsnMobileStationRSSI Integer32
* InTotalBytes 1.3.6.1.4.1.14179.2.1.6.1.2 bsnMobileStationBytesReceived Counter64
* OutTotalBytes 1.3.6.1.4.1.14179.2.1.6.1.3 bsnMobileStationBytesSent Counter64
* InTotalPackets 1.3.6.1.4.1.14179.2.1.6.1.5 bsnMobileStationPacketsReceived Counter64
* OutTotalPackets 1.3.6.1.4.1.14179.2.1.6.1.6 bsnMobileStationPacketsSent Counter64
* MobileStationSnr 1.3.6.1.4.1.14179.2.1.6.1.26 bsnMobileStationSnr Integer32
* Table 1.3.6.1.4.1.14179.2.1.6
* enterprises.airespace.bsnWireless.bsnEss.bsnMobileStationStatsTable.bsnMobileStationStatsEntry SignalStrength
* 1.3.6.1.4.1.14179.2.1.6.1.1 bsnMobileStationRSSI Integer32 InTotalBytes 1.3.6.1.4.1.14179.2.1.6.1.2
* bsnMobileStationBytesReceived Counter64 OutTotalBytes 1.3.6.1.4.1.14179.2.1.6.1.3 bsnMobileStationBytesSent Counter64
* InTotalPackets 1.3.6.1.4.1.14179.2.1.6.1.5 bsnMobileStationPacketsReceived Counter64 OutTotalPackets
* 1.3.6.1.4.1.14179.2.1.6.1.6 bsnMobileStationPacketsSent Counter64 MobileStationSnr 1.3.6.1.4.1.14179.2.1.6.1.26
* bsnMobileStationSnr Integer32
*
*/
if (safe_empty($aps_db)) {
// APs not discovered
return;
// APs not discovered
return;
}
//echo('AIRESPACE-WIRELESS-MIB' . PHP_EOL);
@ -85,56 +92,56 @@ print_cli_data("Collecting", "AIRESPACE-WIRELESS-MIB Access Points ", 3);
// AccessPoints Attributes
//$lwapps = snmpwalk_cache_oid($device, 'bsnAPDot3MacAddress', [], 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_index
$lwapps = snmpwalk_cache_oid($device, 'bsnAPName', [], 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_name
$lwapps = snmpwalk_cache_oid($device, 'bsnAPName', [], 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_name
if (safe_count($lwapps)) {
$lwapps = snmpwalk_cache_oid($device, 'bsnAPNumOfSlots', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_number
$lwapps = snmpwalk_cache_oid($device, 'bsnApIpAddress', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_address
$lwapps = snmpwalk_cache_oid($device, 'bsnAPSerialNumber', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_serial
$lwapps = snmpwalk_cache_oid($device, 'bsnAPModel', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_model
$lwapps = snmpwalk_cache_oid($device, 'bsnAPLocation', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_location
$lwapps = snmpwalk_cache_oid($device, 'bsnAPAdminStatus', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_admin_status
$lwapps = snmpwalk_cache_oid($device, 'bsnAPOperationStatus', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_status
$lwapps = snmpwalk_cache_oid($device, 'bsnAPNumOfSlots', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_number
$lwapps = snmpwalk_cache_oid($device, 'bsnApIpAddress', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_address
$lwapps = snmpwalk_cache_oid($device, 'bsnAPSerialNumber', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_serial
$lwapps = snmpwalk_cache_oid($device, 'bsnAPModel', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_model
$lwapps = snmpwalk_cache_oid($device, 'bsnAPLocation', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_location
$lwapps = snmpwalk_cache_oid($device, 'bsnAPAdminStatus', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_admin_status
$lwapps = snmpwalk_cache_oid($device, 'bsnAPOperationStatus', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_status
}
$table_rows = [];
//print_vars($lwapps);
foreach ($lwapps as $ap_index => $aps) {
$index = format_mac(mac_zeropad($ap_index));
foreach ($lwapps as $ap_index => $aps) {
$index = format_mac(mac_zeropad($ap_index));
print_debug_vars($aps);
print_debug_vars($aps);
if ($aps['bsnAPAdminStatus'] === 'enable') {
switch($aps['bsnAPOperationStatus']) {
case 'associated': // AP is Up and running on the WLC.
$apstatus = "up";
break;
case 'disassociating': //AP is Unreachable and will be removed from WLC.
$apstatus = "down";
break;
case 'downloading': //AP is now being Added to WLC.
$apstatus = "init";
break;
default: // Fallback
$apstatus = $aps['bsnAPOperationStatus'];
if ($aps['bsnAPAdminStatus'] === 'enable') {
switch ($aps['bsnAPOperationStatus']) {
case 'associated': // AP is Up and running on the WLC.
$apstatus = "up";
break;
case 'disassociating': //AP is Unreachable and will be removed from WLC.
$apstatus = "down";
break;
case 'downloading': //AP is now being Added to WLC.
$apstatus = "init";
break;
default: // Fallback
$apstatus = $aps['bsnAPOperationStatus'];
}
} else {
$apstatus = "shutdown";
}
} else {
$apstatus = "shutdown";
}
$aps_poll[$index] = [
'device_id' => $device['device_id'],
'ap_mib' => $mib,
'ap_index' => $index,
'ap_number' => $aps['bsnAPNumOfSlots'],
'ap_name' => $aps['bsnAPName'],
'ap_address' => $aps['bsnApIpAddress'],
'ap_serial' => $aps['bsnAPSerialNumber'],
'ap_model' => $aps['bsnAPModel'],
'ap_location' => $aps['bsnAPLocation'],
'ap_status' => $apstatus,
'ap_admin_status' => $aps['bsnAPAdminStatus'],
];
$aps_poll[$index] = [
'device_id' => $device['device_id'],
'ap_mib' => $mib,
'ap_index' => $index,
'ap_number' => $aps['bsnAPNumOfSlots'],
'ap_name' => $aps['bsnAPName'],
'ap_address' => $aps['bsnApIpAddress'],
'ap_serial' => $aps['bsnAPSerialNumber'],
'ap_model' => $aps['bsnAPModel'],
'ap_location' => $aps['bsnAPLocation'],
'ap_status' => $apstatus,
'ap_admin_status' => $aps['bsnAPAdminStatus'],
];
}
// Controller stats
@ -148,58 +155,58 @@ print_cli_data("Collecting", "AIRESPACE-WIRELESS-MIB Access Points Interfaces",
// AccessPoints Member Attributes
// NOTE, ap_member_index: bsnAPDot3MacAddress.bsnAPIfSlotId
$lwappsmemb = snmpwalk_cache_twopart_oid($device, 'bsnAPIfOperStatus', [], 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_member_state
$lwappsmemb = snmpwalk_cache_twopart_oid($device, 'bsnAPIfAdminStatus', $lwappsmemb, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_member_admin_state
$lwappsmemb = snmpwalk_cache_twopart_oid($device, 'bsnApIfNoOfUsers', $lwappsmemb, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_member_conns
$lwappsmemb = snmpwalk_cache_twopart_oid($device, 'bsnAPIfOperStatus', [], 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_member_state
$lwappsmemb = snmpwalk_cache_twopart_oid($device, 'bsnAPIfAdminStatus', $lwappsmemb, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_member_admin_state
$lwappsmemb = snmpwalk_cache_twopart_oid($device, 'bsnApIfNoOfUsers', $lwappsmemb, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_member_conns
$lwappsmemb = snmpwalk_cache_twopart_oid($device, 'bsnAPIfPhyChannelNumber', $lwappsmemb, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_member_channel
$lwappsmemb = snmpwalk_cache_twopart_oid($device, 'bsnAPIfType', $lwappsmemb, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_member_radiotype
$lwappsmemb = snmpwalk_cache_twopart_oid($device, 'bsnAPIfType', $lwappsmemb, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_member_radiotype
//print_vars($lwappsmemb);
$wifi_controller['clients'] = 0;
foreach ($lwappsmemb as $mac_index => $entry) {
$index = format_mac(mac_zeropad($mac_index));
foreach ($lwappsmemb as $mac_index => $entry) {
$index = format_mac(mac_zeropad($mac_index));
foreach ($entry as $slot_index => $member) {
print_debug_vars($member);
foreach ($entry as $slot_index => $member) {
print_debug_vars($member);
$member_index = $index.'.'.$slot_index;
$member_index = $index . '.' . $slot_index;
switch($member['bsnAPIfType']) {
case 'dot11b':
$interfaceType = "802.11b/g/n";
break;
case 'dot11a':
$interfaceType = "802.11a/n/ac";
break;
case 'dot11abgn':
$interfaceType = "802.11a/b/g/n";
break;
case 'uwb':
$interfaceType = "Dual-Band Radios";
break;
default: // Fallback
$interfaceType = $member['bsnAPIfType'];
switch ($member['bsnAPIfType']) {
case 'dot11b':
$interfaceType = "802.11b/g/n";
break;
case 'dot11a':
$interfaceType = "802.11a/n/ac";
break;
case 'dot11abgn':
$interfaceType = "802.11a/b/g/n";
break;
case 'uwb':
$interfaceType = "Dual-Band Radios";
break;
default: // Fallback
$interfaceType = $member['bsnAPIfType'];
}
$channel_number = substr($member['bsnAPIfPhyChannelNumber'], 2); // ch149 -> 149
$aps_member_poll[$member_index] = [
'device_id' => $device['device_id'],
//'wifi_ap_id' => $wifi_ap_id,
'ap_index' => $index,
'ap_index_member' => $member_index,
//'ap_name' => $ap_name,
'ap_member_state' => $member['bsnAPIfOperStatus'],
'ap_member_admin_state' => $member['bsnAPIfAdminStatus'],
'ap_member_conns' => $member['bsnApIfNoOfUsers'],
'ap_member_channel' => (int)$channel_number,
'ap_member_radiotype' => $interfaceType,
];
// Total clients count
$wifi_controller['clients'] += (int)$member['bsnApIfNoOfUsers'];
}
$channel_number = substr($member['bsnAPIfPhyChannelNumber'], 2); // ch149 -> 149
$aps_member_poll[$member_index] = [
'device_id' => $device['device_id'],
//'wifi_ap_id' => $wifi_ap_id,
'ap_index' => $index,
'ap_index_member' => $member_index,
//'ap_name' => $ap_name,
'ap_member_state' => $member['bsnAPIfOperStatus'],
'ap_member_admin_state' => $member['bsnAPIfAdminStatus'],
'ap_member_conns' => $member['bsnApIfNoOfUsers'],
'ap_member_channel' => (int)$channel_number,
'ap_member_radiotype' => $interfaceType,
];
// Total clients count
$wifi_controller['clients'] += (int) $member['bsnApIfNoOfUsers'];
}
}
unset($member_index, $member, $entry, $mac_index, $slot_index, $lwappsmemb, $interfaceType, $channel_number, $index);

View File

@ -4,34 +4,44 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage poller
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage poller
* @copyright (C) Adam Armstrong
*
*
* CISCO-LWAPP-AP-MIB
*
* Discovery SysObjectID has to start either with 1.3.6.1.4.1.14179. or 1.3.6.1.4.1.9. and SysDescription contains the string "Cisco Controller".
* This module is meant to work together with AIRESPACE-WIRELESS-MIB; part of the below OIDs are already polled from AIRESPACE-WIRELESS-MIB, therefore, duplicated from this MIB.
* This module is meant to work together with AIRESPACE-WIRELESS-MIB; part of the below OIDs are already polled from AIRESPACE-WIRELESS-MIB, therefore,
* duplicated from this MIB.
*
* Controller ciscoLwappAp 1.3.6.1.4.1.9.9.513
* Controller Dot11gSupport 1.3.6.1.4.1.9.9.513.1.1.1.1.1
*
* Thin AP Table 1.3.6.1.4.1.9.9.513.1.1.1 enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable
* ##poll## cLApSysMacAddress 1.3.6.1.4.1.9.9.513.1.1.1.1.1 enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLApSysMacAddress [ap_index]
* AIRESPACE-WIRELESS-MIB cLApIfMacAddress 1.3.6.1.4.1.9.9.513.1.1.1.1.2 enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLApIfMacAddress
* AIRESPACE-WIRELESS-MIB cLApMaxNumberOfDot11Slots 1.3.6.1.4.1.9.9.513.1.1.1.1.3 enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLApMaxNumberOfDot11Slots
* AIRESPACE-WIRELESS-MIB cLApName 1.3.6.1.4.1.9.9.513.1.1.1.1.5 enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLApName
* ##poll## cLApUpTime 1.3.6.1.4.1.9.9.513.1.1.1.1.6 enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLApUpTime
* ##poll## cLLwappUpTime 1.3.6.1.4.1.9.9.513.1.1.1.1.7 enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLLwappUpTime
* ##poll## cLLwappJoinTakenTime 1.3.6.1.4.1.9.9.513.1.1.1.1.8 enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLLwappJoinTakenTime
* AIRESPACE-WIRELESS-MIB cLApAdminStatus 1.3.6.1.4.1.9.9.513.1.1.1.1.38 enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLApAdminStatus
* Thin AP Table 1.3.6.1.4.1.9.9.513.1.1.1
* enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable
* ##poll## cLApSysMacAddress 1.3.6.1.4.1.9.9.513.1.1.1.1.1
* enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLApSysMacAddress [ap_index]
* AIRESPACE-WIRELESS-MIB cLApIfMacAddress 1.3.6.1.4.1.9.9.513.1.1.1.1.2
* enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLApIfMacAddress AIRESPACE-WIRELESS-MIB
* cLApMaxNumberOfDot11Slots 1.3.6.1.4.1.9.9.513.1.1.1.1.3
* enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLApMaxNumberOfDot11Slots
* AIRESPACE-WIRELESS-MIB cLApName 1.3.6.1.4.1.9.9.513.1.1.1.1.5
* enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLApName
* ##poll## cLApUpTime 1.3.6.1.4.1.9.9.513.1.1.1.1.6
* enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLApUpTime
* ##poll## cLLwappUpTime 1.3.6.1.4.1.9.9.513.1.1.1.1.7
* enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLLwappUpTime
* ##poll## cLLwappJoinTakenTime 1.3.6.1.4.1.9.9.513.1.1.1.1.8
* enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLLwappJoinTakenTime
* AIRESPACE-WIRELESS-MIB cLApAdminStatus 1.3.6.1.4.1.9.9.513.1.1.1.1.38
* enterprises.cisco.ciscoMgmt.ciscoLwappApMIB.ciscoLwappApMIBObjects.ciscoLwappAp.cLApTable.cLApEntry.cLApAdminStatus
*
*/
if (safe_empty($aps_db)) {
// APs not discovered
return;
// APs not discovered
return;
}
//echo('CISCO-LWAPP-AP-MIB' . PHP_EOL);
@ -40,29 +50,29 @@ if (safe_empty($aps_db)) {
print_cli_data("Collecting", "CISCO-LWAPP-AP-MIB Access Points Uptimes", 3);
// AccessPoints Attributes
$lwapps = snmpwalk_cache_oid($device, 'cLApUpTime', [], 'CISCO-LWAPP-AP-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_uptime
$lwapps = snmpwalk_cache_oid($device, 'cLLwappUpTime', $lwapps, 'CISCO-LWAPP-AP-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_control_uptime
$lwapps = snmpwalk_cache_oid($device, 'cLApUpTime', [], 'CISCO-LWAPP-AP-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_uptime
$lwapps = snmpwalk_cache_oid($device, 'cLLwappUpTime', $lwapps, 'CISCO-LWAPP-AP-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_control_uptime
$lwapps = snmpwalk_cache_oid($device, 'cLLwappJoinTakenTime', $lwapps, 'CISCO-LWAPP-AP-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_control_latency
//print_vars($lwapps);
foreach ($lwapps as $ap_index => $aps) {
$index = format_mac(mac_zeropad($ap_index));
$index = format_mac(mac_zeropad($ap_index));
print_debug_vars($aps);
print_debug_vars($aps);
if (is_array($aps_poll[$index])) {
//echo("AP Index exists: $index\n");
$uptime = uptime_to_seconds($aps['cLApUpTime']);
$control_uptime = uptime_to_seconds($aps['cLLwappUpTime']);
$control_latency = uptime_to_seconds($aps['cLLwappJoinTakenTime']);
if (is_array($aps_poll[$index])) {
//echo("AP Index exists: $index\n");
$uptime = uptime_to_seconds($aps['cLApUpTime']);
$control_uptime = uptime_to_seconds($aps['cLLwappUpTime']);
$control_latency = uptime_to_seconds($aps['cLLwappJoinTakenTime']);
$aps_poll[$index]['ap_uptime'] = $uptime;
$aps_poll[$index]['ap_control_uptime'] = $control_uptime;
$aps_poll[$index]['ap_control_latency'] = $control_latency;
} else {
print_warning("New AP Index: $index - Need to wait for AIRESPACE-WIRELESS-MIB to add it in the DB");
}
$aps_poll[$index]['ap_uptime'] = $uptime;
$aps_poll[$index]['ap_control_uptime'] = $control_uptime;
$aps_poll[$index]['ap_control_latency'] = $control_latency;
} else {
print_warning("New AP Index: $index - Need to wait for AIRESPACE-WIRELESS-MIB to add it in the DB");
}
}
unset($lwapps, $ap_index, $index, $aps);

View File

@ -5,9 +5,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage poller
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage poller
* @copyright (C) Adam Armstrong
*
*
* CISCO-LWAPP-WLAN-MIB
@ -18,38 +18,37 @@
* Controller ciscoLwappWlanMIB 1.3.6.1.4.1.9.9.512
* Controller ciscoLwappWlanConfig 1.3.6.1.4.1.9.9.512.1.1
*
* Controller Radio WLANs Table 1.3.6.1.4.1.9.9.512.1.1.1.1 enterprises.cisco.ciscoMgmt.ciscoLwappWlanMIB.ciscoLwappWlanMIBObjects.ciscoLwappWlanConfig.cLWlanConfigTable
* wlan_index cLWlanIndex
* Controller Radio WLANs Table 1.3.6.1.4.1.9.9.512.1.1.1.1
* enterprises.cisco.ciscoMgmt.ciscoLwappWlanMIB.ciscoLwappWlanMIBObjects.ciscoLwappWlanConfig.cLWlanConfigTable wlan_index
* cLWlanIndex
*/
echo('CISCO-LWAPP-WLAN-MIB' . PHP_EOL);
echo('CISCO-LWAPP-WLAN-MIB' . PHP_EOL);
//Thin AP Get Uptimes
print_cli_data("Collecting", "CISCO-LWAPP-WLAN-MIB WLANs", 3);
//Thin AP Get Uptimes
print_cli_data("Collecting", "CISCO-LWAPP-WLAN-MIB WLANs", 3);
$table_rows = array();
$table_headers = array('%WWLAN Index%n', '%WWLAN Profile Name%n', '%WWLAN SSID%n', '%WWLAN Status%n');
$table_rows = [];
$table_headers = ['%WWLAN Index%n', '%WWLAN Profile Name%n', '%WWLAN SSID%n', '%WWLAN Status%n'];
$WLAN_db = dbFetchRows('SELECT * FROM `wifi_radios` WHERE `device_id` = ?', array($device['device_id']));
foreach ($WLAN_db as $wlans)
{
$WLANs_db[$wlans['radio_number']] = $wlans;
$WLANs_exist[$wlans['radio_number']] = $wlans['wifi_radio_id'];
}
$WLAN_db = dbFetchRows('SELECT * FROM `wifi_radios` WHERE `device_id` = ?', [$device['device_id']]);
foreach ($WLAN_db as $wlans) {
$WLANs_db[$wlans['radio_number']] = $wlans;
$WLANs_exist[$wlans['radio_number']] = $wlans['wifi_radio_id'];
}
// Radio WLAN Attributes
$radwlans = snmpwalk_cache_oid($device, 'cLWlanIndex', array(), 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //radio_number, wlan_index
$radwlans = snmpwalk_cache_oid($device, 'cLWlanRowStatus', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //radio_status, wlan_admin_status
$radwlans = snmpwalk_cache_oid($device, 'cLWlanProfileName', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //wlan_name
$radwlans = snmpwalk_cache_oid($device, 'cLWlanSsid', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //wlan_ssid
$radwlans = snmpwalk_cache_oid($device, 'cLWlanChdEnable', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //wlan_ssid_bcast
$radwlans = snmpwalk_cache_oid($device, 'cLWlan802dot11anDTIM', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //wlan_dtim_period
$radwlans = snmpwalk_cache_oid($device, 'cLWlan802dot11bgnDTIM', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //wlan_dtim_period
$radwlans = snmpwalk_cache_oid($device, 'cLWlanLanSubType', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //radio_type
// Radio WLAN Attributes
$radwlans = snmpwalk_cache_oid($device, 'cLWlanIndex', [], 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //radio_number, wlan_index
$radwlans = snmpwalk_cache_oid($device, 'cLWlanRowStatus', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //radio_status, wlan_admin_status
$radwlans = snmpwalk_cache_oid($device, 'cLWlanProfileName', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //wlan_name
$radwlans = snmpwalk_cache_oid($device, 'cLWlanSsid', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //wlan_ssid
$radwlans = snmpwalk_cache_oid($device, 'cLWlanChdEnable', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //wlan_ssid_bcast
$radwlans = snmpwalk_cache_oid($device, 'cLWlan802dot11anDTIM', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //wlan_dtim_period
$radwlans = snmpwalk_cache_oid($device, 'cLWlan802dot11bgnDTIM', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //wlan_dtim_period
$radwlans = snmpwalk_cache_oid($device, 'cLWlanLanSubType', $radwlans, 'CISCO-LWAPP-WLAN-MIB', NULL, OBS_SNMP_ALL_TABLE); //radio_type
//print_vars($radwlans);
//print_vars($radwlans);
// EOF

View File

@ -5,17 +5,16 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage poller
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage poller
* @copyright (C) Adam Armstrong
*
*/
# Check inventory for wireless card in device. Valid types be here:
//if (dbFetchCell('SELECT COUNT(*) FROM `entPhysical` WHERE `device_id` = ? AND `entPhysicalDescr` LIKE ?', array($device['device_id'], '%'.$wirelesscheck.'%')) >= 1)
if (dbExist('entPhysical', '`device_id` = ? AND (`entPhysicalDescr` LIKE ? OR `entPhysicalDescr` LIKE ?)', array($device['device_id'], '%Wireless%', '%Atheros%')))
{
$wificlients1 = snmp_get_oid($device, 'mtxrWlApClientCount', 'MIKROTIK-MIB');
if (dbExist('entPhysical', '`device_id` = ? AND (`entPhysicalDescr` LIKE ? OR `entPhysicalDescr` LIKE ?)', [$device['device_id'], '%Wireless%', '%Atheros%'])) {
$wificlients1 = snmp_get_oid($device, 'mtxrWlApClientCount', 'MIKROTIK-MIB');
}
// EOF

View File

@ -5,9 +5,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage discovery
* @copyright (C) Adam Armstrong
*
*/
@ -15,113 +15,105 @@
// Getting Radios
$radios_snmp = snmpwalk_cache_oid($device, 'RuckusRadioNumber', array(), 'RUCKUS-RADIO-MIB');
if ($GLOBALS['snmp_status'])
{
$radios_snmp = snmpwalk_cache_oid($device, 'ruckusRadioStatsTable', array(), 'RUCKUS-RADIO-MIB');
if (OBS_DEBUG > 1) { print_vars($radios_snmp); }
$radios_snmp = snmpwalk_cache_oid($device, 'RuckusRadioNumber', [], 'RUCKUS-RADIO-MIB');
if ($GLOBALS['snmp_status']) {
$radios_snmp = snmpwalk_cache_oid($device, 'ruckusRadioStatsTable', [], 'RUCKUS-RADIO-MIB');
if (OBS_DEBUG > 1) {
print_vars($radios_snmp);
}
}
$polled = time();
// Goes through the SNMP radio data
foreach ($radios_snmp as $radio_number => $radio)
{
foreach ($radios_snmp as $radio_number => $radio) {
$radio['polled'] = $polled;
$radio['radio_number'] = $radio_number;
$radio['radio_ap'] = 0; // Hardcoded since the AP is self.
$radio['radio_clients'] = $radio['ruckusRadioStatsNumSta'];
$radio['polled'] = $polled;
$radio['radio_number'] = $radio_number;
$radio['radio_ap'] = 0; // Hardcoded since the AP is self.
$radio['radio_clients'] = $radio['ruckusRadioStatsNumSta'];
if (OBS_DEBUG && count($radio))
{
print_vars($radio);
}
// FIXME -- This is Ruckus only and subject to change. RRD files may be wiped as we modify this format to fit everything.
$dses = array('assoc_fail_rate' => array('oid' => 'ruckusRadioStatsAssocFailRate', 'type' => 'gauge'),
'auth_success_rate' => array('oid' => 'ruckusRadioStatsAssocSuccessRate', 'type' => 'gauge'),
'auth_fail_rate' => array('oid' => 'ruckusRadioStatsAuthFailRate', 'type' => 'gauge'),
'max_stations' => array('oid' => 'ruckusRadioStatsMaxSta', 'type' => 'gauge'),
'assoc_fail' => array('oid' => 'ruckusRadioStatsNumAssocFail'),
'assoc_req' => array('oid' => 'ruckusRadioStatsNumAssocReq'),
'assoc_resp' => array('oid' => 'ruckusRadioStatsNumAssocResp'),
'assoc_success' => array('oid' => 'ruckusRadioStatsNumAssocSuccess'),
'auth_fail' => array('oid' => 'ruckusRadioStatsNumAuthFail'),
'auth_req' => array('oid' => 'ruckusRadioStatsNumAuthReq'),
'auth_resp' => array('oid' => 'ruckusRadioStatsNumAuthResp'),
'auth_stations' => array('oid' => 'ruckusRadioStatsNumAuthSta', 'type' => 'gauge'),
'auth_success' => array('oid' => 'ruckusRadioStatsNumAuthSuccess'),
'num_stations' => array('oid' => 'ruckusRadioStatsNumSta', 'type' => 'gauge'),
'resource_util' => array('oid' => 'ruckusRadioStatsResourceUtil', 'type' => 'gauge'),
'rx_bytes' => array('oid' => 'ruckusRadioStatsRxBytes'),
'rx_decrypt_crcerr' => array('oid' => 'ruckusRadioStatsRxDecryptCRCError'),
'rx_errors' => array('oid' => 'ruckusRadioStatsRxErrors'),
'rx_frames' => array('oid' => 'ruckusRadioStatsRxFrames'),
'rx_mic_error' => array('oid' => 'ruckusRadioStatsRxMICError'),
'rx_wep_fail' => array('oid' => 'ruckusRadioStatsRxWEPFail'),
'tx_bytes' => array('oid' => 'ruckusRadioStatsTxBytes'),
'tx_frames' => array('oid' => 'ruckusRadioStatsTxFrames'),
'total_airtime' => array('oid' => 'ruckusRadioStatsTotalAirtime'),
'total_assoc_time' => array('oid' => 'ruckusRadioStatsTotalAssocTime'),
'busy_airtime' => array('oid' => 'ruckusRadioStatsBusyAirtime')
);
$rrd_file = 'wifi-radio-' . $radio['radio_ap'] . '-' . $radio['radio_number'] . '.rrd';
$rrd_update = 'N';
$rrd_create = '';
foreach ($dses as $ds => $ds_data)
{
$oid = $ds_data['oid'];
$radio[$ds] = $radio[$oid];
if ($ds_data['type'] == 'gauge')
{
$rrd_create .= ' DS:' . $ds . ':GAUGE:600:U:100000000000';
}
else
{
$rrd_create .= ' DS:' . $ds . ':COUNTER:600:U:100000000000';
if (OBS_DEBUG && count($radio)) {
print_vars($radio);
}
if (is_numeric($radio[$oid]))
{
$rrd_update .= ':' . $radio[$oid];
// FIXME -- This is Ruckus only and subject to change. RRD files may be wiped as we modify this format to fit everything.
$dses = ['assoc_fail_rate' => ['oid' => 'ruckusRadioStatsAssocFailRate', 'type' => 'gauge'],
'auth_success_rate' => ['oid' => 'ruckusRadioStatsAssocSuccessRate', 'type' => 'gauge'],
'auth_fail_rate' => ['oid' => 'ruckusRadioStatsAuthFailRate', 'type' => 'gauge'],
'max_stations' => ['oid' => 'ruckusRadioStatsMaxSta', 'type' => 'gauge'],
'assoc_fail' => ['oid' => 'ruckusRadioStatsNumAssocFail'],
'assoc_req' => ['oid' => 'ruckusRadioStatsNumAssocReq'],
'assoc_resp' => ['oid' => 'ruckusRadioStatsNumAssocResp'],
'assoc_success' => ['oid' => 'ruckusRadioStatsNumAssocSuccess'],
'auth_fail' => ['oid' => 'ruckusRadioStatsNumAuthFail'],
'auth_req' => ['oid' => 'ruckusRadioStatsNumAuthReq'],
'auth_resp' => ['oid' => 'ruckusRadioStatsNumAuthResp'],
'auth_stations' => ['oid' => 'ruckusRadioStatsNumAuthSta', 'type' => 'gauge'],
'auth_success' => ['oid' => 'ruckusRadioStatsNumAuthSuccess'],
'num_stations' => ['oid' => 'ruckusRadioStatsNumSta', 'type' => 'gauge'],
'resource_util' => ['oid' => 'ruckusRadioStatsResourceUtil', 'type' => 'gauge'],
'rx_bytes' => ['oid' => 'ruckusRadioStatsRxBytes'],
'rx_decrypt_crcerr' => ['oid' => 'ruckusRadioStatsRxDecryptCRCError'],
'rx_errors' => ['oid' => 'ruckusRadioStatsRxErrors'],
'rx_frames' => ['oid' => 'ruckusRadioStatsRxFrames'],
'rx_mic_error' => ['oid' => 'ruckusRadioStatsRxMICError'],
'rx_wep_fail' => ['oid' => 'ruckusRadioStatsRxWEPFail'],
'tx_bytes' => ['oid' => 'ruckusRadioStatsTxBytes'],
'tx_frames' => ['oid' => 'ruckusRadioStatsTxFrames'],
'total_airtime' => ['oid' => 'ruckusRadioStatsTotalAirtime'],
'total_assoc_time' => ['oid' => 'ruckusRadioStatsTotalAssocTime'],
'busy_airtime' => ['oid' => 'ruckusRadioStatsBusyAirtime']
];
$rrd_file = 'wifi-radio-' . $radio['radio_ap'] . '-' . $radio['radio_number'] . '.rrd';
$rrd_update = 'N';
$rrd_create = '';
foreach ($dses as $ds => $ds_data) {
$oid = $ds_data['oid'];
$radio[$ds] = $radio[$oid];
if ($ds_data['type'] == 'gauge') {
$rrd_create .= ' DS:' . $ds . ':GAUGE:600:U:100000000000';
} else {
$rrd_create .= ' DS:' . $ds . ':COUNTER:600:U:100000000000';
}
if (is_numeric($radio[$oid])) {
$rrd_update .= ':' . $radio[$oid];
} else {
$rrd_update .= ':U';
}
}
else
{
$rrd_update .= ':U';
rrdtool_create($device, $rrd_file, $rrd_create);
rrdtool_update($device, $rrd_file, $rrd_update);
$radio_db = $GLOBALS['cache']['wifi_radios'][$radio['radio_ap']][$radio['radio_number']];
if ($radio_db['polled'] > 1) {
$radio['poll_period'] = $radio['polled'] - $radio_db['polled'];
$radio['rx_bits_diff'] = $radio['rx_bits'] - $radio_db['rx_bits'];
$radio['tx_bits_diff'] = $radio['tx_bits'] - $radio_db['tx_bits'];
$radio['rx_bits_rate'] = $radio['rx_bits_diff'] / $radio['poll_period'];
$radio['tx_bits_rate'] = $radio['tx_bits_diff'] / $radio['poll_period'];
}
}
rrdtool_create($device, $rrd_file, $rrd_create);
rrdtool_update($device, $rrd_file, $rrd_update);
$fields = ['num_clients', 'tx_bytes', 'rx_bytes', 'tx_bytes_rate', 'rx_bytes_rate', 'polled'];
$radio_db = $GLOBALS['cache']['wifi_radios'][$radio['radio_ap']][$radio['radio_number']];
foreach ($fields as $field) {
// FIXME. I not found where this array used for wifi
// var $update_array used to track devices fields changes
if ($radio_db[$field] != $radio[$field]) {
$update_radio[$field] = $radio[$field];
}
}
if ($radio_db['polled'] > 1)
{
$radio['poll_period'] = $radio['polled'] - $radio_db['polled'];
$radio['rx_bits_diff'] = $radio['rx_bits'] - $radio_db['rx_bits'];
$radio['tx_bits_diff'] = $radio['tx_bits'] - $radio_db['tx_bits'];
$radio['rx_bits_rate'] = $radio['rx_bits_diff'] / $radio['poll_period'];
$radio['tx_bits_rate'] = $radio['tx_bits_diff'] / $radio['poll_period'];
}
$fields = array('num_clients', 'tx_bytes', 'rx_bytes', 'tx_bytes_rate', 'rx_bytes_rate', 'polled');
foreach ($fields as $field)
{
// FIXME. I not found where this array used for wifi
// var $update_array used to track devices fields changes
if ($radio_db[$field] != $radio[$field]) { $update_radio[$field] = $radio[$field]; }
}
print_r($radio);
print_r($radio);
}
unset($radios_snmp);

View File

@ -5,9 +5,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage poller
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage poller
* @copyright (C) Adam Armstrong
*
*/
@ -16,10 +16,12 @@
// getting APs and radios
$radios_snmp = snmpwalk_cache_twopart_oid($device, 'trpzApStatRadioOpStatisticsTable', $radios_snmp, 'TRAPEZE-NETWORKS-AP-STATUS-MIB');
if (OBS_DEBUG > 1 && count($radios_snmp)) { print_vars($radios_snmp); }
if (OBS_DEBUG > 1 && count($radios_snmp)) {
print_vars($radios_snmp);
}
// OIDs to graph
$oids_counter = array(
$oids_counter = [
'TxUniPkt',
'TxUniOctet',
'TxMultiPkt',
@ -43,52 +45,50 @@ $oids_counter = array(
'RxAssocPkt',
'TxDataPkt',
'TxAuthRespPkt',
'TxAssocRespPkt');
'TxAssocRespPkt'];
$oids_gauge = array(
$oids_gauge = [
'UserSessions',
'NoiseFloor');
'NoiseFloor'];
// Goes through the SNMP radio data
foreach ($radios_snmp as $ap_serial => $ap_radios)
{
foreach ($ap_radios as $radio_number => $radio)
{
$rrdupdate = 'N';
$rrd_create = '';
if ($radio_number == 'radio-1') { $radio_number = 1; } // FIXME just get number from radio-X ?
else if ($radio_number == 'radio-2') { $radio_number = 2; }
$rrd_file = 'wifi-radio-'. $ap_serial . '-' . $radio_number.'.rrd';
foreach ($radios_snmp as $ap_serial => $ap_radios) {
foreach ($ap_radios as $radio_number => $radio) {
$rrdupdate = 'N';
$rrd_create = '';
if ($radio_number == 'radio-1') {
$radio_number = 1;
} // FIXME just get number from radio-X ?
elseif ($radio_number == 'radio-2') {
$radio_number = 2;
}
$rrd_file = 'wifi-radio-' . $ap_serial . '-' . $radio_number . '.rrd';
foreach ($oids_gauge as $oid)
{
$oid_ds = truncate($oid, 19, '');
$rrd_create .= " DS:$oid_ds:GAUGE:600:U:125000000000";
foreach ($oids_gauge as $oid) {
$oid_ds = truncate($oid, 19, '');
$rrd_create .= " DS:$oid_ds:GAUGE:600:U:125000000000";
if (is_numeric($radio['trpzApStatRadioOpStats'.$oid]))
{
$value = $radio['trpzApStatRadioOpStats'.$oid];
} else {
$value = '0';
}
$rrdupdate .= ":$value";
if (is_numeric($radio['trpzApStatRadioOpStats' . $oid])) {
$value = $radio['trpzApStatRadioOpStats' . $oid];
} else {
$value = '0';
}
$rrdupdate .= ":$value";
}
foreach ($oids_counter as $oid) {
$oid_ds = truncate($oid, 19, '');
$rrd_create .= " DS:$oid_ds:COUNTER:600:0:125000000000";
if (is_numeric($radio['trpzApStatRadioOpStats' . $oid])) {
$value = $radio['trpzApStatRadioOpStats' . $oid];
} else {
$value = '0';
}
$rrdupdate .= ":$value";
}
rrdtool_create($device, $rrd_file, $rrd_create);
rrdtool_update($device, $rrd_file, $rrdupdate);
}
foreach ($oids_counter as $oid)
{
$oid_ds = truncate($oid, 19, '');
$rrd_create .= " DS:$oid_ds:COUNTER:600:0:125000000000";
if (is_numeric($radio['trpzApStatRadioOpStats'.$oid]))
{
$value = $radio['trpzApStatRadioOpStats'.$oid];
} else {
$value = '0';
}
$rrdupdate .= ":$value";
}
rrdtool_create($device, $rrd_file, $rrd_create);
rrdtool_update($device, $rrd_file, $rrdupdate);
}
}
unset($oids, $oid, $radio);

View File

@ -5,73 +5,76 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage poller
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @package observium
* @subpackage poller
* @copyright (C) Adam Armstrong
*
*/
// Polling of wireless sessions data for Juniper Wireless (ex Trapeze)
// Cache DB entries
$sessions_db = dbFetchRows("SELECT `mac_addr` FROM `wifi_sessions` WHERE `device_id` = ?", array($device['device_id']));
foreach ($sessions_db as $session_db)
{
$clean_mac = str_replace(array(':', '-'), '', $session_db['mac_addr']);
$sessions_db[$clean_mac] = $session_db;
$sessions_db = dbFetchRows("SELECT `mac_addr` FROM `wifi_sessions` WHERE `device_id` = ?", [$device['device_id']]);
foreach ($sessions_db as $session_db) {
$clean_mac = str_replace([':', '-'], '', $session_db['mac_addr']);
$sessions_db[$clean_mac] = $session_db;
}
if (OBS_DEBUG && count($sessions_db)) {
print_vars($sessions_db);
}
if (OBS_DEBUG && count($sessions_db)) { print_vars($sessions_db); }
$radios_db = dbFetchRows("SELECT `wifi_radio_id`, `radio_number`,`ap_number`, `wifi_accesspoints`.`device_id` FROM `wifi_accesspoints`, `wifi_radios` WHERE `wifi_radios`.`radio_ap` = wifi_accesspoints.`wifi_accesspoint_id` AND wifi_accesspoints.`device_id` = ?", array($device['device_id']));
foreach ($radios_db as $radio_db)
{
$radios_sorted_db[$radio_db['ap_number']][$radio_db['radio_number']] = $radio_db;
$radios_db = dbFetchRows("SELECT `wifi_radio_id`, `radio_number`,`ap_number`, `wifi_accesspoints`.`device_id` FROM `wifi_accesspoints`, `wifi_radios` WHERE `wifi_radios`.`radio_ap` = wifi_accesspoints.`wifi_accesspoint_id` AND wifi_accesspoints.`device_id` = ?", [$device['device_id']]);
foreach ($radios_db as $radio_db) {
$radios_sorted_db[$radio_db['ap_number']][$radio_db['radio_number']] = $radio_db;
}
$sessions_array = snmpwalk_cache_oid($device, "trpzClSessClientSessionTable", $sessions_array, "TRAPEZE-NETWORKS-CLIENT-SESSION-MIB", NULL, OBS_SNMP_ALL_NUMERIC_INDEX);
if (OBS_DEBUG > 1 && count($sessions_array)) { print_vars($sessions_array); }
if (OBS_DEBUG > 1 && count($sessions_array)) {
print_vars($sessions_array);
}
$timestamp = date('Y-m-d H:i:s', strtotime("now"));
// Goes through the SNMP sessions data
foreach ($sessions_array as $index => $session)
{
list($a_a, $a_b, $a_c, $a_d, $a_e, $a_f) = explode(".", $index);
$clean_mac = zeropad(dechex($a_a)).zeropad(dechex($a_b)).zeropad(dechex($a_c)).zeropad(dechex($a_d)).zeropad(dechex($a_e)).zeropad(dechex($a_f));
foreach ($sessions_array as $index => $session) {
[$a_a, $a_b, $a_c, $a_d, $a_e, $a_f] = explode(".", $index);
$clean_mac = zeropad(dechex($a_a)) . zeropad(dechex($a_b)) . zeropad(dechex($a_c)) . zeropad(dechex($a_d)) . zeropad(dechex($a_e)) . zeropad(dechex($a_f));
// Mapping OIDs<>DB
$db_oids = array('trpzClSessClientSessSessionId' => 'session_id',
'trpzClSessClientSessUsername' => 'username',
'trpzClSessClientSessIpAddress' => 'ipv4_addr',
'trpzClSessClientSessSsid' => 'ssid',
'trpzClSessClientSessSessionState' => 'state');
// Mapping OIDs<>DB
$db_oids = ['trpzClSessClientSessSessionId' => 'session_id',
'trpzClSessClientSessUsername' => 'username',
'trpzClSessClientSessIpAddress' => 'ipv4_addr',
'trpzClSessClientSessSsid' => 'ssid',
'trpzClSessClientSessSessionState' => 'state'];
$new_index = $clean_mac;
$new_index = $clean_mac;
foreach ($db_oids as $db_oid => $db_value)
{
$db_insert[$db_value] = $session[$db_oid];
}
$db_insert['device_id'] = $device['device_id'];
$db_insert['mac_addr'] = $clean_mac;
$db_insert['uptime'] = timeticks_to_sec($session['trpzClSessClientSessTimeStamp']); // FIXME. There timestamp, not timetick!
$db_insert['timestamp'] = $timestamp;
if ($session['trpzClSessClientSessRadioNum'] == "radio-1") { $radio_number = '1'; }
else if ($session['trpzClSessClientSessradioNum'] == "radio-2") { $radio_number = '2'; }
foreach ($db_oids as $db_oid => $db_value) {
$db_insert[$db_value] = $session[$db_oid];
}
$db_insert['device_id'] = $device['device_id'];
$db_insert['mac_addr'] = $clean_mac;
$db_insert['uptime'] = timeticks_to_sec($session['trpzClSessClientSessTimeStamp']); // FIXME. There timestamp, not timetick!
$db_insert['timestamp'] = $timestamp;
if ($session['trpzClSessClientSessRadioNum'] == "radio-1") {
$radio_number = '1';
} elseif ($session['trpzClSessClientSessradioNum'] == "radio-2") {
$radio_number = '2';
}
$db_insert['radio_id'] = $radios_sorted_db[$session['trpzClSessClientSessApNum']][$radio_number]['wifi_radio_id'];
if (OBS_DEBUG > 1) { print_vars($db_insert); }
if (!is_array($sessions_db[$new_index])) //If new session
{
$session_id = dbInsert($db_insert, 'wifi_sessions');
echo('+');
}
else if (array_diff($db_insert, $sessions_db[$new_index]))
{
$updated = dbUpdate($db_insert, 'wifi_sessions', '`mac_addr` = ? AND `device_id` = ?', array($new_index, $device['device_id']));
echo("U");
} else {
echo(".");
}
$db_insert['radio_id'] = $radios_sorted_db[$session['trpzClSessClientSessApNum']][$radio_number]['wifi_radio_id'];
if (OBS_DEBUG > 1) {
print_vars($db_insert);
}
if (!is_array($sessions_db[$new_index])) //If new session
{
$session_id = dbInsert($db_insert, 'wifi_sessions');
echo('+');
} elseif (array_diff($db_insert, $sessions_db[$new_index])) {
$updated = dbUpdate($db_insert, 'wifi_sessions', '`mac_addr` = ? AND `device_id` = ?', [$new_index, $device['device_id']]);
echo("U");
} else {
echo(".");
}
// XXX can add trending of link quality and bandwidth per MAC addr with trpzClSessClientSessionStatisticsTable
// XXX No delete so we can see when a user was connected the last time, might be interesting to have a "deleted" boolean to know if he is still online
@ -79,6 +82,6 @@ foreach ($sessions_array as $index => $session)
///FIXME. Clean/delete old sessions from DB
unset($oids, $oid, $sessions_array, $sessions_db,$db_insert);
unset($oids, $oid, $sessions_array, $sessions_db, $db_insert);
// EOF