fix fans to notify *BELOW* speed not above! :D

git-svn-id: http://www.observium.org/svn/observer/trunk@1022 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-03-13 16:52:03 +00:00
parent 2744a255d0
commit 0625d880c6
2 changed files with 3 additions and 5 deletions

View File

@@ -138,9 +138,9 @@ function discover_mempool(&$valid_mempool, $device, $index, $type, $descr, $prec
function discover_temperature(&$valid_temp, $device, $oid, $index, $type, $descr, $precision = 1, $low_limit = NULL, $high_limit = NULL, $current)
{
global $config, $debug;
global $config, $debug;
if($debug) { echo("$oid, $index, $type, $descr, $precision\n"); }
if (mysql_result(mysql_query("SELECT COUNT(temp_id) FROM `temperature` WHERE temp_type = '$type' AND temp_index = '$index' AND device_id = '".$device['device_id']."'"),0) == '0')
{
$query = "INSERT INTO temperature (`device_id`, `temp_type`,`temp_index`,`temp_oid`, `temp_descr`, `temp_limit`, `temp_current`, `temp_precision`)";
@@ -162,8 +162,6 @@ function discover_temperature(&$valid_temp, $device, $oid, $index, $type, $descr
echo("U");
}
}
echo(mysql_error());
$valid_temp[$type][$index] = 1;
return $return;
}

View File

@@ -27,7 +27,7 @@ while($fanspeed = mysql_fetch_array($fan_data)) {
rrdtool_update($fanrrd,"N:$fan");
if($fanspeed['fan_current'] > $fanspeed['fan_limit'] && $fan <= $fanspeed['fan_limit']) {
if($fanspeed['fan_current'] < $fanspeed['fan_limit'] && $fan >= $fanspeed['fan_limit']) {
if($device['sysContact']) { $email = $device['sysContact']; } else { $email = $config['email_default']; }
$msg = "Fan Alarm: " . $device['hostname'] . " " . $fanspeed['fan_descr'] . " is " . $fan . "rpm (Limit " . $fanspeed['fan_limit'];
$msg .= "rpm) at " . date($config['timestamp_format']);