
Apologies if the answer to this is obvious... but is there any way to specify a time range for alert checkers?
-Colin

Nope.
Sent with AquaMail for Android http://www.aqua-mail.com
On 10 March 2015 18:29:11 Colin Stubbs colin.stubbs@equatetechnologies.com.au wrote:
Apologies if the answer to this is obvious... but is there any way to specify a time range for alert checkers?
-Colin
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium

Thoughts on the below?
Goal: ability to specify a time window based condition for checkers, e.g. don't raise alarms between 9 AM and 5 PM,
Diff of code below, which is simplistic I admit, but it also works well for such a small change.
The only problem with this is that the alert will trigger on if the current time is within the window, then recover at the end of the window, and trigger on again if the other conditions are true at the start of the next time window. Also only after the specified delay.
But it works OK as a interim measure.
$ diff -u ../observium-trunk/includes/alerts.inc.php includes/alerts.inc.php --- ../observium-trunk/includes/alerts.inc.php 2015-02-25 16:40:54.000000000 +1000 +++ includes/alerts.inc.php 2015-03-11 12:09:07.000000000 +1000 @@ -56,6 +56,10 @@
echo("Testing: " . $test['metric']. " ". $test['condition'] . " " .$test['value']); $update_array['state']['metrics'][$test['metric']] = $data[$test['metric']]; + + if ($test['metric'] == "time") { + $data[$test['metric']] = date('Hi'); + }
if (isset($data[$test['metric']])) { $ JIRA 1246
-Colin
On 11 March 2015 at 10:31, Adam Armstrong adama@memetic.org wrote:
Nope.
Sent with AquaMail for Android http://www.aqua-mail.com
On 10 March 2015 18:29:11 Colin Stubbs < colin.stubbs@equatetechnologies.com.au> wrote:
Apologies if the answer to this is obvious... but is there any way to specify a time range for alert checkers?
-Colin _______________________________________________ observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
participants (2)
-
Adam Armstrong
-
Colin Stubbs