don't alert for NULL limits on current, but this will need to be fixed on all sensor pollers... preferrably unified stuff

git-svn-id: http://www.observium.org/svn/observer/trunk@2071 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-04-13 11:43:22 +00:00
parent a98d315700
commit a1ffa0b11a
+2 -2
View File
@@ -28,7 +28,7 @@ while ($dbcurrent = mysql_fetch_assoc($current_data))
rrdtool_update($currentrrd,"N:$current"); rrdtool_update($currentrrd,"N:$current");
# FIXME also warn when crossing WARN level!! # FIXME also warn when crossing WARN level!!
if ($dbcurrent['sensor_current'] > $dbcurrent['sensor_limit_low'] && $current <= $dbcurrent['sensor_limit_low']) if ($dbcurrent['sensor_limit_low'] != "" && $dbcurrent['sensor_current'] > $dbcurrent['sensor_limit_low'] && $current <= $dbcurrent['sensor_limit_low'])
{ {
$msg = "Current Alarm: " . $device['hostname'] . " " . $dbcurrent['sensor_descr'] . " is under threshold: " . $current . "A (< " . $dbcurrent['sensor_limit']; $msg = "Current Alarm: " . $device['hostname'] . " " . $dbcurrent['sensor_descr'] . " is under threshold: " . $current . "A (< " . $dbcurrent['sensor_limit'];
$msg .= "A) at " . date($config['timestamp_format']); $msg .= "A) at " . date($config['timestamp_format']);
@@ -36,7 +36,7 @@ while ($dbcurrent = mysql_fetch_assoc($current_data))
echo("Alerting for " . $device['hostname'] . " " . $dbcurrent['sensor_descr'] . "\n"); echo("Alerting for " . $device['hostname'] . " " . $dbcurrent['sensor_descr'] . "\n");
log_event('Current ' . $dbcurrent['sensor_descr'] . " under threshold: " . $current . " A (< " . $dbcurrent['sensor_limit_low'] . " A)", $device, 'current', $current['sensor_id']); log_event('Current ' . $dbcurrent['sensor_descr'] . " under threshold: " . $current . " A (< " . $dbcurrent['sensor_limit_low'] . " A)", $device, 'current', $current['sensor_id']);
} }
else if ($dbcurrent['sensor_current'] < $dbcurrent['sensor_limit'] && $current >= $dbcurrent['sensor_limit']) else if ($dbcurrent['sensor_limit_low'] != "" && $dbcurrent['sensor_current'] < $dbcurrent['sensor_limit'] && $current >= $dbcurrent['sensor_limit'])
{ {
$msg = "Current Alarm: " . $device['hostname'] . " " . $dbcurrent['sensor_descr'] . " is over threshold: " . $current . "A (> " . $dbcurrent['sensor_limit']; $msg = "Current Alarm: " . $device['hostname'] . " " . $dbcurrent['sensor_descr'] . " is over threshold: " . $current . "A (> " . $dbcurrent['sensor_limit'];
$msg .= "A) at " . date($config['timestamp_format']); $msg .= "A) at " . date($config['timestamp_format']);