mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Basic detection of unifi kit
This commit is contained in:
@@ -20,6 +20,9 @@ if (!$os)
|
||||
$os = "airos";
|
||||
if (strpos(trim(snmp_get($device, "dot11manufacturerProductName.5", "-Osqnv", "IEEE802dot11-MIB")), "UAP") !== FALSE) { $os = "unifi"; }
|
||||
elseif (strpos(trim(snmp_get($device, "dot11manufacturerProductName.2", "-Osqnv", "IEEE802dot11-MIB")), "UAP") !== FALSE) { $os = "unifi"; }
|
||||
elseif (strpos(trim(snmp_get($device, "dot11manufacturerProductName.3", "-Osqnv", "IEEE802dot11-MIB")), "UAP") !== FALSE) { $os = "unifi"; }
|
||||
elseif (strpos(trim(snmp_get($device, "dot11manufacturerProductName.4", "-Osqnv", "IEEE802dot11-MIB")), "UAP") !== FALSE) { $os = "unifi"; }
|
||||
elseif (strpos(trim(snmp_get($device, "dot11manufacturerProductName.6", "-Osqnv", "IEEE802dot11-MIB")), "UAP") !== FALSE) { $os = "unifi"; }
|
||||
elseif (trim(snmp_get($device, "fwVersion.1", "-Osqnv", "UBNT-AirFIBER-MIB")) != '') { $os = "airos-af"; }
|
||||
}
|
||||
else
|
||||
|
||||
24
includes/polling/os/unifi.inc.php
Normal file
24
includes/polling/os/unifi.inc.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
$data = snmp_get_multi($device, "dot11manufacturerProductName.2 dot11manufacturerProductVersion.2", "-OQUs", "IEEE802dot11-MIB");
|
||||
if (empty($data)) {
|
||||
$data = snmp_get_multi($device, "dot11manufacturerProductName.3 dot11manufacturerProductVersion.3", "-OQUs", "IEEE802dot11-MIB");
|
||||
}
|
||||
if (empty($data)) {
|
||||
$data = snmp_get_multi($device, "dot11manufacturerProductName.4 dot11manufacturerProductVersion.4", "-OQUs", "IEEE802dot11-MIB");
|
||||
}
|
||||
if (empty($data)) {
|
||||
$data = snmp_get_multi($device, "dot11manufacturerProductName.5 dot11manufacturerProductVersion.5", "-OQUs", "IEEE802dot11-MIB");
|
||||
}
|
||||
if (empty($data)) {
|
||||
$data = snmp_get_multi($device, "dot11manufacturerProductName.6 dot11manufacturerProductVersion.6", "-OQUs", "IEEE802dot11-MIB");
|
||||
}
|
||||
|
||||
foreach ($data as $line) {
|
||||
if (!empty($line['dot11manufacturerProductName'])) {
|
||||
$hardware = $line['dot11manufacturerProductName'];
|
||||
}
|
||||
if (preg_match("/(v[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", $line['dot11manufacturerProductVersion'],$matches)) {
|
||||
$version = $matches[0];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user