Skip to content

Commit

Permalink
newdevice: Added hardware and version from AirOS 8.x (#6802)
Browse files Browse the repository at this point in the history
newdevice: Added hardware and version from AirOS 8.x (#6802)
  • Loading branch information
corny authored and laf committed Jun 13, 2017
1 parent 5c58cc0 commit ffb20d9
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions includes/polling/os/airos.inc.php
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ffb20d9

Please sign in to comment.