Skip to content

Commit efe064a

Browse files
committed
Fix silly walk of a scalar and wildly unnecessary snmptranslate call.
1 parent 72c2061 commit efe064a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

LibreNMS/OS/Arubaos.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,11 @@ public function discoverWirelessClients()
8585
*/
8686
public function discoverWirelessApCount()
8787
{
88-
$mib = 'WLSX-SWITCH-MIB';
89-
$data = SnmpQuery::hideMib()->walk("$mib::wlsxSwitchTotalNumAccessPoints")->table(1);
88+
$value = SnmpQuery::get('WLSX-SWITCH-MIB::wlsxSwitchTotalNumAccessPoints.0')->value();
9089
$sensors = [];
9190

92-
foreach ($data as $key => $value) {
93-
$oid = snmp_translate($mib . '::' . $key, 'ALL', 'arubaos', '-On');
91+
if (is_numeric($value)) {
92+
$oid = '.1.3.6.1.4.1.14823.2.2.1.1.3.1.0';
9493
$value = intval($value);
9594

9695
$low_warn_const = 1; // Default warning threshold = 1 down AP

0 commit comments

Comments
 (0)