fix event logs for limit alerts

git-svn-id: http://www.observium.org/svn/observer/trunk@1136 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-06-10 19:51:49 +00:00
parent be43f2ef63
commit cdbf919799
4 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ while($voltage = mysql_fetch_array($volt_data)) {
$msg .= "V) at " . date($config['timestamp_format']);
mail($email, "Voltage Alarm: " . $device['hostname'] . " " . $voltage['volt_descr'], $msg, $config['email_headers']);
echo("Alerting for " . $device['hostname'] . " " . $voltage['volt_descr'] . "\n");
eventlog('Voltage ' . $voltage['volt_descr'] . " under threshold: " . $voltage['volt_current'] . " V (< " . $voltage['volt_limit_low'] . " V)", $device['device_id']);
eventlog('Voltage ' . $voltage['volt_descr'] . " under threshold: " . $volt . " V (< " . $voltage['volt_limit_low'] . " V)", $device['device_id']);
}
else if($voltage['volt_current'] < $voltage['volt_limit'] && $volt >= $voltage['volt_limit'])
{
@@ -46,7 +46,7 @@ while($voltage = mysql_fetch_array($volt_data)) {
$msg .= "V) at " . date($config['timestamp_format']);
mail($email, "Voltage Alarm: " . $device['hostname'] . " " . $voltage['volt_descr'], $msg, $config['email_headers']);
echo("Alerting for " . $device['hostname'] . " " . $voltage['volt_descr'] . "\n");
eventlog('Voltage ' . $voltage['volt_descr'] . " above threshold: " . $voltage['volt_current'] . " V (> " . $voltage['volt_limit'] . " V)", $device['device_id']);
eventlog('Voltage ' . $voltage['volt_descr'] . " above threshold: " . $volt . " V (> " . $voltage['volt_limit'] . " V)", $device['device_id']);
}
mysql_query("UPDATE voltage SET volt_current = '$volt' WHERE volt_id = '" . $voltage['volt_id'] . "'");