mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
@@ -22,7 +22,10 @@
|
||||
* @copyright 2017 Neil Lathwood
|
||||
* @author Neil Lathwood <[email protected]>
|
||||
*/
|
||||
$value = return_number(snmp_get($device, 'climateHumidity', '-Oqv', 'GEIST-MIB-V3'));
|
||||
|
||||
use LibreNMS\Util\Number;
|
||||
|
||||
$value = Number::cast(SnmpQuery::get('GEIST-MIB-V3::climateHumidity')->value());
|
||||
if ($value) {
|
||||
$current_oid = '.1.3.6.1.4.1.21239.2.2.1.7.1';
|
||||
$descr = 'Humidity';
|
||||
|
||||
@@ -264,20 +264,6 @@ function apc_relay_state($state)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
function return_number($value)
|
||||
{
|
||||
preg_match('/[\d\.\-]+/', $value, $temp_response);
|
||||
if (! empty($temp_response[0])) {
|
||||
$value = $temp_response[0];
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
function parse_entity_state($state, $value)
|
||||
{
|
||||
$data = [
|
||||
|
||||
Reference in New Issue
Block a user