From b124c280aae9f107b91b24a8c0a57932c31a4aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Rosiak?= Date: Sun, 3 May 2015 14:33:33 +0200 Subject: [PATCH] Update functions.inc.php - Add extra safety check --- includes/polling/functions.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/polling/functions.inc.php b/includes/polling/functions.inc.php index d2cc57161..ca9b767a1 100644 --- a/includes/polling/functions.inc.php +++ b/includes/polling/functions.inc.php @@ -18,7 +18,9 @@ function poll_sensor($device, $class, $unit) if ($debug) echo("Attempt $i "); $sensor_value = trim(str_replace("\"", "", snmp_get($device, $sensor['sensor_oid'], "-OUqnv", "SNMPv2-MIB"))); preg_match("/[\d\.]+/",$sensor_value,$temp_response); - $sensor_value = $temp_response[0]; + if (!empty($temp_response[0])) { + $sensor_value = $temp_response[0]; + } if (is_numeric($sensor_value) && $sensor_value != 9999) break; # TME sometimes sends 999.9 when it is right in the middle of an update; sleep(1); # Give the TME some time to reset