mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user