mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* fixing sentry3 temperature sensor issues: read all sensors not just first two, fix reading limit and current values, fixing snmp get options * fixing sentry4 temperature sensor issues: read all sensors not just first two, fix reading limit and current values, fixing snmp get options * fixing code style issues * addressing review items from murrant, removing individual snmp_gets, fixing fahrenheit to celcius code back * addressing review items, putting back the celcius fahrenheit conversion logic back * using snmpwalk_cache_oid instead of reinventing in sentry3 code * using pre-cache for sentry4 temp sensors, addressing review items * checking all sentry3 humidity sensors instead of first two, bulk reading instead of individual gets * addressing style issues * pre-caching sentry4 humidity warning table removing duplicate temp sensor event config table * adding two more sentry snmprec files after temperature and humidity sensor updates * making sensor index values for sentry3/4 unique * adding sentry3 and 4 test data files after temperature and humidity sensors update
28 lines
1.0 KiB
PHP
28 lines
1.0 KiB
PHP
<?php
|
|
|
|
$oids = snmpwalk_cache_oid($device, 'tempHumidSensorEntry', array(), 'Sentry3-MIB');
|
|
$divisor = '1';
|
|
$multiplier = '1';
|
|
d_echo($oids);
|
|
|
|
if ($oids) {
|
|
echo 'ServerTech Sentry3 Humidity ';
|
|
|
|
foreach ($oids as $sensor_index => $data) {
|
|
// tempHumidSensorHumidValue
|
|
$humidity_oid = '.1.3.6.1.4.1.1718.3.2.5.1.10.'.$sensor_index;
|
|
$descr = 'Removable Sensor '.$data['tempHumidSensorID'];
|
|
$low_warn_limit = null;
|
|
$low_limit = $data['tempHumidSensorHumidLowThresh'];
|
|
$high_warn_limit = null;
|
|
$high_limit = $data['tempHumidSensorHumidHighThresh'];
|
|
$current = $data['tempHumidSensorHumidValue'];
|
|
|
|
if (is_numeric($current) && $current >= 0) {
|
|
discover_sensor($valid['sensor'], 'humidity', $device, $humidity_oid, 'tempHumidSensorHumidValue'.$sensor_index, 'sentry3', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
|
}
|
|
}
|
|
}
|
|
|
|
unset($oids);
|