mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
apc discovery: Get a count of banks before pulling info
* On my device (AP7901 / AOS v3.9.0 / App v3.7.4) discovery would keep clobbering the bank and current sensor. Looking in to it the oid should be used for current and not bank. To fix this now it pulls a count of banks using the `rPDULoadDevNumBanks.0` oid. Per MIB that will return 0 if no banks are found. In which case skip the bank detection. * Also update PowerNet-MIB to v4.1.7 released 2015-08-05
This commit is contained in:
@@ -58,7 +58,10 @@ if ($device['os'] == 'apc') {
|
||||
unset($oids);
|
||||
|
||||
// v2 firmware- first bank is total, v3 firmware, 3rd bank is total
|
||||
$oids = snmp_walk($device, 'rPDULoadStatusIndex', '-OsqnU', 'PowerNet-MIB');
|
||||
$bank_count = snmp_get($device, 'rPDULoadDevNumBanks.0', '-Oqv', 'PowerNet-MIB');
|
||||
if ($bank_count > 0) {
|
||||
$oids = snmp_walk($device, 'rPDULoadStatusIndex', '-OsqnU', 'PowerNet-MIB');
|
||||
}
|
||||
// should work with firmware v2 and v3
|
||||
if ($oids) {
|
||||
echo 'APC PowerNet-MIB Banks ';
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user