mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user