mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Cisco C9800 Wireless Controller AP Count Support (#16342)
* Update CISCO-LWAPP-TC-MIB Uploaded latest version from Cisco Feature Navigator From the original Cisco MIB: Deleted duplicate END in line 868 Change the names “dot11_6ghz” and “dot11_xor_5_6ghz” by removing the underscore (example: “dot11-6ghz” “dot11-xor-5-6ghz”) * Update Iosxe.php Added Wireless Controller module * Update iosxe.yaml Added AP count and Wireless Client Credit to @AllanHahn * Create iosxewlc.yaml Added IOS-XE WLC. Need to add sysObjectID for the future devices beyond WLC9800. System description has IOS-XE in it * Update iosxe.yaml * Update iosxe.yaml WLC 9800 not included, have own YAML file * Create iosxewlc.php * Update Iosxe.php Remove WLC Module * Rename iosxewlc.php to Iosxewlc.php * C9800 WLC detection * Update iosxewlc.yaml * Remove CiscoWLC notes * Remove ISIS * Update Iosxewlc.php * Fix syntax * Remove Cisco WLC notes Need some cleanup since already created new PHP file for Cisco IOS-XE WLC * Update Iosxewlc.php * Update CISCO-LWAPP-AP-MIB Downloaded the latest from Cisco MIBS to support AP count for Cisco WLC C9800 models. * Update Copyright * Change type from network to wireless * Patterned with AirOS Cisco WLC * Create iosxewlc_c9800.snmprec Added test file * styleci compliance * styleci compliance * styleci compliance * Uploaded data from actual device * styleci compliance * styleci compliance - remove space * Merge iosxe and iosxewlc As discussed * Merhe iosxewlc.yaml to iosxe.yaml No over graphs for Number of Clients and AP Count or IOSXE WLCs but still can view via Tabs * remove iosxewlc.yaml Covered by iosxe.yaml * Delete iosxewlc.php Covered by iosxe.php * Rename iosxewlc_c9800.snmprec to iosxe_c9800.snmprec due to removal of iosxewlc template which was merged. * styleci compliance * styleci compliance * Update iosxe_c9800.snmprec * Update iosxe_c9800.snmprec * rerun-tests * Remove pollOS block from Iosxe * Check before polling and add additional IP discovery * lint fix * Added raw data from actual device Convert sensitive data to <private> * Create iosxe_c9800.json --------- Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com> Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -33,6 +33,7 @@ use LibreNMS\Interfaces\Discovery\Sensors\WirelessClientsDiscovery;
|
||||
use LibreNMS\Interfaces\Polling\OSPolling;
|
||||
use LibreNMS\OS\Shared\Cisco;
|
||||
use LibreNMS\RRD\RrdDefinition;
|
||||
use SnmpQuery;
|
||||
|
||||
class Ciscowlc extends Cisco implements
|
||||
OSPolling,
|
||||
@@ -41,6 +42,10 @@ class Ciscowlc extends Cisco implements
|
||||
{
|
||||
public function pollOS(DataStorageInterface $datastore): void
|
||||
{
|
||||
if (! $this->getDevice()->wirelessSensors()->where('sensor_class', 'ap-count')->exists()) {
|
||||
return; // if ap count doesn't exist, skip this polling TODO replace with wireless controller module
|
||||
}
|
||||
|
||||
$device = $this->getDeviceArray();
|
||||
$apNames = \SnmpQuery::enumStrings()->walk('AIRESPACE-WIRELESS-MIB::bsnAPName')->table(1);
|
||||
$radios = \SnmpQuery::enumStrings()->walk('AIRESPACE-WIRELESS-MIB::bsnAPIfTable')->table(2);
|
||||
@@ -192,15 +197,36 @@ class Ciscowlc extends Cisco implements
|
||||
*
|
||||
* @return array Sensors
|
||||
*/
|
||||
public function discoverWirelessApCount()
|
||||
public function discoverWirelessApCount(): array
|
||||
{
|
||||
$oids = [
|
||||
$data = SnmpQuery::get([
|
||||
'CISCO-LWAPP-SYS-MIB::clsSysApConnectCount.0',
|
||||
'AIRESPACE-SWITCHING-MIB::agentInventoryMaxNumberOfAPsSupported.0',
|
||||
];
|
||||
$data = snmp_get_multi($this->getDeviceArray(), $oids);
|
||||
'CISCO-LWAPP-AP-MIB::cLApGlobalAPConnectCount.0',
|
||||
'CISCO-LWAPP-AP-MIB::cLApGlobalMaxApsSupported.0',
|
||||
])->values();
|
||||
|
||||
if (isset($data[0]['clsSysApConnectCount'])) {
|
||||
if (isset($data['CISCO-LWAPP-AP-MIB::cLApGlobalAPConnectCount.0'])) {
|
||||
return [
|
||||
new WirelessSensor(
|
||||
'ap-count',
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.9.9.513.1.3.35.0',
|
||||
'ciscowlc',
|
||||
0,
|
||||
'Connected APs',
|
||||
$data['CISCO-LWAPP-AP-MIB::cLApGlobalAPConnectCount.0'],
|
||||
1,
|
||||
1,
|
||||
'sum',
|
||||
null,
|
||||
$data['CISCO-LWAPP-AP-MIB::cLApGlobalMaxApsSupported.0'],
|
||||
0
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
if (isset($data['CISCO-LWAPP-SYS-MIB::clsSysApConnectCount.0'])) {
|
||||
return [
|
||||
new WirelessSensor(
|
||||
'ap-count',
|
||||
@@ -209,12 +235,12 @@ class Ciscowlc extends Cisco implements
|
||||
'ciscowlc',
|
||||
0,
|
||||
'Connected APs',
|
||||
$data[0]['clsSysApConnectCount'],
|
||||
$data['CISCO-LWAPP-SYS-MIB::clsSysApConnectCount.0'],
|
||||
1,
|
||||
1,
|
||||
'sum',
|
||||
null,
|
||||
$data[0]['agentInventoryMaxNumberOfAPsSupported'],
|
||||
$data['AIRESPACE-SWITCHING-MIB::agentInventoryMaxNumberOfAPsSupported.0'],
|
||||
0
|
||||
),
|
||||
];
|
||||
|
@@ -31,7 +31,6 @@ use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use LibreNMS\DB\SyncsModels;
|
||||
use LibreNMS\Interfaces\Data\DataStorageInterface;
|
||||
use LibreNMS\Interfaces\Discovery\IsIsDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessCellDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessChannelDiscovery;
|
||||
@@ -59,11 +58,6 @@ class Iosxe extends Ciscowlc implements
|
||||
use SyncsModels;
|
||||
use CiscoCellular;
|
||||
|
||||
public function pollOS(DataStorageInterface $datastore): void
|
||||
{
|
||||
// Don't poll Ciscowlc FIXME remove when wireless-controller module exists
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of shortened ISIS codes
|
||||
*
|
||||
|
Reference in New Issue
Block a user