Merge pull request #3051 from vrillusions/apc-bank-count

apc discovery: Get a count of banks before pulling info
This commit is contained in:
Neil Lathwood
2016-04-11 16:18:46 +01:00
2 changed files with 785 additions and 195 deletions

View File

@@ -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 ';