APC UPS UIO sensor discovery bug (#14942)

* only proceed if there are entries in the uio table

* only proceed if there are entries in the uio table
This commit is contained in:
d-k-7
2023-04-05 16:48:23 -04:00
committed by GitHub
parent 75033daaa8
commit 14f19eb6cf

View File

@@ -159,7 +159,7 @@ foreach ($pre_cache['mem_sensors_status'] as $index => $data) {
// Monitor contact switches via the UIO ports.
$apcContactData = snmpwalk_cache_oid($device, 'uioInputContact', $apcContactData, 'PowerNet-MIB', null, '-OQUse');
if ($apcContactData) {
if ($apcContactData['uioInputContactStatusTableSize'] > 0) {
// NMC2/NMC3/etc Universal Input Output
foreach (array_keys($apcContactData) as $index) {
// APC disabled (1), enabled (2)