mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Fixes for SZ detection * Ruckuswireless devices * remove registered mibs * Code Climate Fixes * updated test data for zd1100 & zd1200 * Updated database test data * trying to fix smartzone test data * updating zd test data * more code climate fixes * Update ruckuswireless-unleashed.yaml * hide total clients if 1 ssid * fixing smartzone ap status * smartzone ap count fixes * fixes because of git * fix zd ap counts * Update ruckuswireless-sz.json * Update ZD1200 test Data * Update ruckuswireless-sz.snmprec * Update Database test data * Update zd1200 database data * Update ruckuswireless_zd1100.snmprec * Update ruckuswireless_zd1100.json * Update ruckuswireless_zd1100.json * Update ruckuswireless_zd1100.json * Code Climate Fixes * Code Climate Fixes * Update Ruckuswireless.php * Code Format Fixes
69 lines
2.3 KiB
PHP
69 lines
2.3 KiB
PHP
<?php
|
|
namespace LibreNMS\OS;
|
|
|
|
use LibreNMS\Device\WirelessSensor;
|
|
use LibreNMS\Interfaces\Discovery\Sensors\WirelessClientsDiscovery;
|
|
use LibreNMS\Interfaces\Discovery\Sensors\WirelessApCountDiscovery;
|
|
use LibreNMS\OS;
|
|
|
|
class Ruckuswireless extends OS implements
|
|
WirelessClientsDiscovery,
|
|
WirelessApCountDiscovery
|
|
{
|
|
public function discoverWirelessClients()
|
|
{
|
|
|
|
// Find Per SSID Client Count
|
|
$sensors = array();
|
|
$ssids = $this->getCacheByIndex('ruckusZDWLANSSID', 'RUCKUS-ZD-WLAN-MIB');
|
|
$counts = $this->getCacheByIndex('ruckusZDWLANNumSta', 'RUCKUS-ZD-WLAN-MIB');
|
|
|
|
$total_oids = array();
|
|
$total = 0;
|
|
foreach ($counts as $index => $count) {
|
|
$oid = '.1.3.6.1.4.1.25053.1.2.2.1.1.1.1.1.12.' . $index;
|
|
$total_oids[] = $oid;
|
|
$total += $count;
|
|
|
|
$sensors[] = new WirelessSensor(
|
|
'clients',
|
|
$this->getDeviceId(),
|
|
$oid,
|
|
'ruckuswireless',
|
|
$index,
|
|
'SSID: ' . $ssids[$index],
|
|
$count
|
|
);
|
|
}
|
|
|
|
// Do not get total client count if only 1 SSID
|
|
if (count($total_oids) > 1) {
|
|
// Find Total Client Count
|
|
$oid = '.1.3.6.1.4.1.25053.1.2.1.1.1.15.2.0'; //RUCKUS-ZD-SYSTEM-MIB::ruckusZDSystemStatsNumSta.0
|
|
array_push($sensors, new WirelessSensor('clients', $this->getDeviceId(), $oid, 'ruckuswireless', ($index + 1), 'System Total:'));
|
|
}
|
|
return $sensors;
|
|
}
|
|
|
|
// Find Total AP Count
|
|
|
|
public function discoverWirelessApCount()
|
|
{
|
|
$oidconnected = '.1.3.6.1.4.1.25053.1.2.1.1.1.15.1.0'; //RUCKUS-ZD-SYSTEM-MIB::ruckusZDSystemStatsNumAP.0
|
|
$oidtotal = '.1.3.6.1.4.1.25053.1.2.1.1.1.15.15.0'; //RUCKUS-ZD-SYSTEM-MIB::ruckusZDSystemStatsNumRegisteredAP.0
|
|
$sensorindex = 0;
|
|
$sensors[] = new WirelessSensor(
|
|
'ap-count',
|
|
$this->getDeviceId(),
|
|
$oidconnected,
|
|
'ruckuswireless',
|
|
++$sensorindex,
|
|
'Connected APs',
|
|
$count
|
|
);
|
|
|
|
array_push($sensors, new WirelessSensor('ap-count', $this->getDeviceId(), $oidtotal, 'ruckuswireless', ++$sensorindex, 'Total APs'));
|
|
return $sensors;
|
|
}
|
|
}
|