Files
librenms-librenms/includes/discovery/sensors/states/serveriron.inc.php
Neil Lathwood 6c324cd03e refactor: Improve sensors polling for performance increase (#4725)
refactor: Improve sensors polling for performance increase
2016-10-11 19:34:09 +03:00

26 lines
978 B
PHP

<?php
if ($device['os'] == 'serveriron') {
echo 'ServerIron States';
// All those states are : (Value: 1 Other, 2 Normal, 3 failure) (Power Supply and Fans)
// Power Supplies
for ($i=1; $i != 3; $i++) {
$power_oid = '.1.3.6.1.4.1.1991.1.1.1.2.1.1.3.'.$i;
$power_status = snmp_get($device, $power_oid, '-Oqv');
if (!empty($power_status)) {
discover_sensor($valid['sensor'], 'state', $device, $power_oid, 'powerstatus'.$i, 'snmp', 'Power Supply '.$i.' Status', '1', '1', '1', null, null, '3', $power_status);
}
}
// Fan status
for ($i=1; $i != 7; $i++) {
$fan_oid = '.1.3.6.1.4.1.1991.1.1.1.3.1.1.3.'.$i;
$fan_status = snmp_get($device, $fan_oid, '-Oqv');
if (!empty($fan_status)) {
discover_sensor($valid['sensor'], 'state', $device, $fan_oid, 'fanstatus'.$i, 'snmp', 'Fan '.$i.' Status', '1', '1', '1', null, null, '3', $fan_status);
}
}
}//end if