Fix: AirOS version and hardware. (#8034)

* Added more sub-oids for airos version and hardware.

* Rewrote hardware and software detection for airos to getnext.
This commit is contained in:
Zmegolaz
2018-01-07 06:20:31 +01:00
committed by Tony Murray
parent 42e5819130
commit 4be175578b

View File

@@ -1,17 +1,11 @@
<?php
foreach (array(10,5) as $i) {
$result = snmp_get_multi_oid($device, "dot11manufacturerProductName.$i dot11manufacturerProductVersion.$i", '-OQUs', 'IEEE802dot11-MIB');
$result = snmp_getnext($device, "dot11manufacturerProductName", '-OQv', 'IEEE802dot11-MIB');
$hardware = 'Ubiquiti ' . $result;
// If invalid, $result contains one empty element.
// So we have to verify it contains exactly two elements.
if (count($result) == 2) {
$hardware = 'Ubiquiti ' . $result["dot11manufacturerProductName.$i"];
$version = $result["dot11manufacturerProductVersion.$i"];
list(, $version) = preg_split('/\.v/', $version);
break;
}
}
$result = snmp_getnext($device, "dot11manufacturerProductVersion", '-OQv', 'IEEE802dot11-MIB');
$version = $result;
list(, $version) = preg_split('/\.v/', $version);
unset($result);