Apply fixes from StyleCI (#12117)

* Apply fixes from StyleCI

* Disable style check
This commit is contained in:
Jellyfrog
2020-09-21 14:54:51 +02:00
committed by GitHub
parent 8ec9183df5
commit 77c531527c
752 changed files with 6238 additions and 5833 deletions

View File

@@ -1,4 +1,5 @@
<?php
namespace LibreNMS\OS;
use App\Models\Device;
@@ -13,13 +14,13 @@ class RuckuswirelessSz extends OS implements
{
public function discoverOS(Device $device): void
{
$device->hardware = snmp_getnext($this->getDeviceArray(), '.1.3.6.1.4.1.25053.1.8.1.1.1.1.1.1.3', "-OQv");
$device->version = snmp_getnext($this->getDeviceArray(), '.1.3.6.1.4.1.25053.1.8.1.1.1.1.1.1.9', "-OQv");
$device->serial = snmp_get($this->getDeviceArray(), '.1.3.6.1.4.1.25053.1.4.1.1.1.15.13.0', "-OQv");
$device->features = "Licenses: " . snmp_get($this->getDeviceArray(), '.1.3.6.1.4.1.25053.1.4.1.1.1.15.1.0', "-OQv") . "/" . snmp_getnext($this->getDeviceArray(), '.1.3.6.1.4.1.25053.1.8.1.1.1.1.1.1.10', "-OQv");
$device->hardware = snmp_getnext($this->getDeviceArray(), '.1.3.6.1.4.1.25053.1.8.1.1.1.1.1.1.3', "-OQv");
$device->version = snmp_getnext($this->getDeviceArray(), '.1.3.6.1.4.1.25053.1.8.1.1.1.1.1.1.9', "-OQv");
$device->serial = snmp_get($this->getDeviceArray(), '.1.3.6.1.4.1.25053.1.4.1.1.1.15.13.0', "-OQv");
$device->features = "Licenses: " . snmp_get($this->getDeviceArray(), '.1.3.6.1.4.1.25053.1.4.1.1.1.15.1.0', "-OQv") . "/" . snmp_getnext($this->getDeviceArray(), '.1.3.6.1.4.1.25053.1.8.1.1.1.1.1.1.10', "-OQv");
$ruckuscountry = snmp_getnext($this->getDeviceArray(), '.1.3.6.1.4.1.25053.1.8.1.1.1.1.3.1.4', "-OQv");
if (!empty($ruckuscountry)) {
if (! empty($ruckuscountry)) {
$device->version .= " ($ruckuscountry)";
}
}
@@ -27,11 +28,11 @@ class RuckuswirelessSz extends OS implements
public function discoverWirelessClients()
{
// clients - Discover Per SSID Client Count
$sensors = array();
$sensors = [];
$ssids = $this->getCacheByIndex('ruckusSZWLANSSID', 'RUCKUS-SZ-WLAN-MIB');
$counts = $this->getCacheByIndex('ruckusSZWLANNumSta', 'RUCKUS-SZ-WLAN-MIB');
$total_oids = array();
$total_oids = [];
$total = 0;
foreach ($counts as $index => $count) {
$oid = '.1.3.6.1.4.1.25053.1.4.2.1.1.1.2.1.12.' . $index;
@@ -51,10 +52,11 @@ class RuckuswirelessSz extends OS implements
// Do not get total client count if only 1 SSID
if (count($total_oids) > 1) {
// clients - Discover System Total Client Count
// clients - Discover System Total Client Count
$oid = '.1.3.6.1.4.1.25053.1.4.1.1.1.15.2.0'; //RUCKUS-SZ-SYSTEM-MIB::ruckusSZSystemStatsNumSta.0
array_push($sensors, new WirelessSensor('clients', $this->getDeviceId(), $oid, 'ruckuswireless-sz', ($index + 1), 'System Total:'));
}
return $sensors;
}
@@ -79,6 +81,7 @@ class RuckuswirelessSz extends OS implements
// ap-count - Discover System Total APs
$oid = '.1.3.6.1.4.1.25053.1.4.1.1.1.15.1.0'; //RUCKUS-SZ-SYSTEM-MIB::ruckusSZSystemStatsNumAP.0
array_push($apstatus, new WirelessSensor('ap-count', $this->getDeviceId(), $oid, 'ruckuswireless-sz', ++$dbindex, 'Total APs'));
return $apstatus;
}
}