[isf-wifidog] gotta change cron/page.php

Rob Janes janes.rob at gmail.com
Dim 30 Avr 13:33:17 EDT 2006


the problem is that we're getting of emails from this cron monitor that 
throws messages every five minutes it seems until the downage is fixed.

i'd like to use cron/page.php, but i need to make some changes.

* to send emails to a list
* not to rely on the node tech officer (since we don't seem to be using 
that field)
* not to send repititious email
* send an email once when a threshold is crossed and then a reminder 
once a day.
* send an email when the node comes back up.

The thresholds I'd define would be
- down for 5 minutes
- down for 20 minutes
- down for 1 hour
- down for 2 hours
- down for 12 hours
then a message after midnight if the node has been down for more than 24 
hours.  I'd put the thresholds in config.php.

To support this i would need to add some fields to the nodes table, and 
some functions to nodes.php to support these fields.

last_paging_event: the threshold that was crossed when the last 
page/email was sent.  (this field is necessary)
downtime_start: start of current downtime - copy of last_heartbeat at 
that time.  (this field is necessary)
downtime_counter: count of downtimes since downtime_counter_start was 
set.  (this field is not necessary)
downtime_counter_start: timestamp of start of downtime_counter.  (this 
field is not necessary)

Looks like Max wrote cron/page.php.  Am I missing something, or does

>         } else if ($lastPaged - $last_heartbeat < 60*$minutes) {

not send an email practically everytime the cron runs, up to 120 minutes?

what do you guys think?  is this a friendly change, or not?  As usual, 
silence is golden.

fyi, i did try getting on the irc channel but nobody was listening.  
lights on, nobody home.

-rob


More information about the WiFiDog mailing list