From cbc9d0393a634c9a8ec99376e71f5c8a3b40ed62 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Mon, 7 Mar 2011 11:11:06 +0000 Subject: [PATCH] polling/temperatures: switch to snmp_get(), patch by Corentin Chary git-svn-id: http://www.observium.org/svn/observer/trunk@1796 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/polling/temperatures.inc.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/polling/temperatures.inc.php b/includes/polling/temperatures.inc.php index b33fee651..7fe1fc4b4 100755 --- a/includes/polling/temperatures.inc.php +++ b/includes/polling/temperatures.inc.php @@ -9,9 +9,8 @@ while($temperature = mysql_fetch_array($temp_data)) { for ($i = 0;$i < 5;$i++) # Try 5 times to get a valid temp reading { if ($debug) echo("Attempt $i "); - #FIXME snmp_get - $temp_cmd = $config['snmpget'] . " -M ".$config['mibdir'] . " -m SNMPv2-MIB -O Uqnv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " " . $temperature['sensor_oid'] . "|grep -v \"No Such Instance\""; - $temp = trim(str_replace("\"", "", shell_exec($temp_cmd))); + $temp = snmp_get($device, $temperature['sensor_oid'], "-OUqnv", "SNMPv2-MIB"); + $temp = trim(str_replace("\"", "", $temp)); if ($temp != 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