mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix for number in sensor string (#14185)
* Fix for extracting sensor value from string in poller * Remove duplicate code * Update microsemitime.json Co-authored-by: Maikel de Boer <mdb@tampnet.com> Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
committed by
GitHub
parent
c807e409d9
commit
ebe16a79d1
@@ -80,12 +80,14 @@ function poll_sensor($device, $class)
|
||||
require 'includes/polling/sensors/' . $class . '/' . $device['os_group'] . '.inc.php';
|
||||
}
|
||||
|
||||
if ($class == 'temperature') {
|
||||
preg_match('/[\d\.\-]+/', $sensor_value, $temp_response);
|
||||
if (! is_numeric($sensor_value)) {
|
||||
preg_match('/-?\d*\.?\d+/', $sensor_value, $temp_response);
|
||||
if (! empty($temp_response[0])) {
|
||||
$sensor_value = $temp_response[0];
|
||||
}
|
||||
} elseif ($class == 'state') {
|
||||
}
|
||||
|
||||
if ($class == 'state') {
|
||||
if (! is_numeric($sensor_value)) {
|
||||
$state_value = dbFetchCell(
|
||||
'SELECT `state_value`
|
||||
|
Reference in New Issue
Block a user