mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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']);
|
||||
|
||||
Reference in New Issue
Block a user