Modified to pull from appropriate OID depending on sysObjectID

This commit is contained in:
neg2led
2018-01-04 12:45:53 +11:00
parent a8d380f95f
commit 5c2b6039f4
+12 -6
View File
@@ -1,9 +1,15 @@
<?php
if ($sysmodel = snmp_get($device, 'unifiApSystemModel.0', '-Osqnv', 'UBNT-UniFi-MIB')) {
$hardware = $sysmodel;
}
if ($sysver = snmp_get($device, 'unifiApSystemVersion.0', '-Osqnv', 'UBNT-UniFi-MIB')) {
$version = $sysver;
if ($poll_device['sysObjectID'] == 'enterprises.10002.1') {
if ($data = snmp_get_multi($device, 'dot11manufacturerProductName.0 dot11manufacturerProductVersion.0', '-OQUs', 'IEEE802dot11-MIB')) {
$hardware = $data[0]['dot11manufacturerProductName'];
if (preg_match('/(v[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/', $data[0]['dot11manufacturerProductVersion'], $matches)) {
$version = $matches[0];
}
}
} elseif ($poll_device['sysObjectID'] == 'enterprises.8072.3.2.10') {
if ($data = snmp_get_multi($device, 'unifiApSystemModel.0 unifiApSystemVersion.0', '-OUQs', 'UBNT-UniFi-MIB')) {
$hardware = $data[0]['unifiApSystemModel'];
$version = $data[0]['unifiApSystemVersion'];
}
}