mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Added hardware and version from AirOS 8.x (#6802)
newdevice: Added hardware and version from AirOS 8.x (#6802)
This commit is contained in:
committed by
Neil Lathwood
co-authored by
Neil Lathwood
parent
5c58cc011a
commit
ffb20d9ee3
@@ -1,8 +1,18 @@
|
||||
<?php
|
||||
|
||||
$hardware = 'Ubiquiti '.trim(snmp_get($device, 'dot11manufacturerProductName.5', '-Ovq', 'IEEE802dot11-MIB'));
|
||||
foreach (array(10,5) as $i) {
|
||||
$result = snmp_get_multi_oid($device, "dot11manufacturerProductName.$i dot11manufacturerProductVersion.$i", '-OQUs', 'IEEE802dot11-MIB');
|
||||
|
||||
$version = trim(snmp_get($device, 'dot11manufacturerProductVersion.5', '-Ovq', 'IEEE802dot11-MIB'));
|
||||
list(, $version) = preg_split('/\.v/', $version);
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
unset($result);
|
||||
|
||||
// EOF
|
||||
|
||||
Reference in New Issue
Block a user