Cisco WLC: fetch LWAPP SSIDs for client counts (#15531)

* Cisco WLC: fetch LWAPP SSIDs

* Apply fixes from StyleCI

* no need to check twice

---------

Co-authored-by: StyleCI Bot <[email protected]>
This commit is contained in:
Tony Murray
2023-11-01 11:21:11 -05:00
committed by GitHub
co-authored by StyleCI Bot
parent dde970ddcf
commit b9881bbf36
+18 -12
View File
@@ -143,8 +143,16 @@ class Ciscowlc extends Cisco implements
*/
public function discoverWirelessClients()
{
$ssids = $this->getCacheByIndex('bsnDot11EssSsid', 'AIRESPACE-WIRELESS-MIB');
$counts = $this->getCacheByIndex('bsnDot11EssNumberOfMobileStations', 'AIRESPACE-WIRELESS-MIB');
if (empty($counts)) {
return []; // no counts to be had
}
$ssids = $this->getCacheByIndex('bsnDot11EssSsid', 'AIRESPACE-WIRELESS-MIB');
if (empty($ssids)) {
// Try to check the LWAPP mib
$ssids = $this->getCacheByIndex('cLWlanSsid', 'CISCO-LWAPP-WLAN-MIB');
}
$sensors = [];
$total_oids = [];
@@ -165,17 +173,15 @@ class Ciscowlc extends Cisco implements
);
}
if (! empty($counts)) {
$sensors[] = new WirelessSensor(
'clients',
$this->getDeviceId(),
$total_oids,
'ciscowlc',
0,
'Clients: Total',
$total
);
}
$sensors[] = new WirelessSensor(
'clients',
$this->getDeviceId(),
$total_oids,
'ciscowlc',
0,
'Clients: Total',
$total
);
return $sensors;
}