remove DEVELOPING file, moved to wiki now (see Developing); minor layout fixes; remove some sql queries upon eventlog, as log_event actually prefers to receive a device array in the first place

git-svn-id: http://www.observium.org/svn/observer/trunk@2011 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-04-03 19:36:32 +00:00
parent 036a1ce913
commit a914dfd482
13 changed files with 47 additions and 82 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ while ($sensor = mysql_fetch_array($volt_data))
$msg .= "V) at " . date($config['timestamp_format']);
notify($device, "Voltage Alarm: " . $device['hostname'] . " " . $sensor['sensor_descr'], $msg);
echo("Alerting for " . $device['hostname'] . " " . $sensor['sensor_descr'] . "\n");
log_event('Voltage ' . $sensor['sensor_descr'] . " under threshold: " . $volt . " V (< " . $sensor['sensor_limit_low'] . " V)", $device['device_id'], 'voltage', $sensor['sensor_id']);
log_event('Voltage ' . $sensor['sensor_descr'] . " under threshold: " . $volt . " V (< " . $sensor['sensor_limit_low'] . " V)", $device, 'voltage', $sensor['sensor_id']);
}
else if ($sensor['sensor_current'] < $sensor['sensor_limit'] && $volt >= $sensor['sensor_limit'])
{
@@ -45,7 +45,7 @@ while ($sensor = mysql_fetch_array($volt_data))
$msg .= "V) at " . date($config['timestamp_format']);
notify($device, "Voltage Alarm: " . $device['hostname'] . " " . $sensor['sensor_descr'], $msg);
echo("Alerting for " . $device['hostname'] . " " . $sensor['sensor_descr'] . "\n");
log_event('Voltage ' . $sensor['sensor_descr'] . " above threshold: " . $volt . " V (> " . $sensor['sensor_limit'] . " V)", $device['device_id'], 'voltage', $sensor['sensor_id']);
log_event('Voltage ' . $sensor['sensor_descr'] . " above threshold: " . $volt . " V (> " . $sensor['sensor_limit'] . " V)", $device, 'voltage', $sensor['sensor_id']);
}
mysql_query("UPDATE sensors SET sensor_current = '$volt' WHERE sensor_class='voltage' AND sensor_id = '" . $sensor['sensor_id'] . "'");
}