$aps) { $index = format_mac(mac_zeropad($ap_index)); 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']; } } 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'], ]; } // Controller stats $wifi_controller['aps'] = safe_count($aps_poll); unset($apstatus, $index, $aps, $lwapps); //Thin AP Members //In creation process - Sergio print_cli_data("Collecting", "AIRESPACE-WIRELESS-MIB Access Points Interfaces", 3); // 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, '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 //print_vars($lwappsmemb); $wifi_controller['clients'] = 0; foreach ($lwappsmemb as $mac_index => $entry) { $index = format_mac(mac_zeropad($mac_index)); foreach ($entry as $slot_index => $member) { print_debug_vars($member); $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']; } $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); echo(PHP_EOL); // EOF