[op5-users] Delaying notifications to a specific time
Andreas Ericsson
ae at op5.se
Thu Jan 15 10:41:17 CET 2009
Mikael.Schmidt at ixx.se wrote:
> Hi,
>
> I have a situation where I need to delay notifications between 2300
> to 0500 to be sent after 0500. Have anyone come across this situation
> and perhaps already have a final solution?
>
> I'm thinking of making a new notification-script that checks the
> current time, if it's between 2300-0500, put the notification in a
> folder and then have a crontab'd job running at 0500 to check if
> there is any delayed messages and if there is, send them. This
> applies for both e-mail and sms notifications.
>
The wish to do this crops up from time to time, and it's almost always
unclear why the user wants it. Email notifications get sent to the
mailboxes and can safely be left there for the user to peruse when
they arrive at work. SMS notifications are not desirable during the
night-time, so they're often turned off. Most customers feels it's
enough that they see the notifications in the email when they come
to work, so please make it clear to the customer wanting this that
they already, in a way, have it.
One customer has implemented this themselves. One night, their backup
jobs failed, and started trying to rerun every five minutes, causing
immense loads both on network and servers. When the morning came, it
took a full 45 minutes for the staff's cellphones to stop beeping from
the plethora of text-messages they were receiving.
Something like this needs careful consideration. In my opinion, it
would be very much superior to simply track the issues that crop up
during the night and send a summary message when the morning comes.
Stashing notifications etc still needs to be done, ofcourse, but the
cron-job that runs should compile a list of issues that haven't
resolved themselves during the night (iow, a recovery notification
should cause the problem notification to disappear in the summary
rather than adding to the possibly already sizeable wall of text).
The simplest way of implementing this is probably to re-use the
current notification-script, but wrapping it in something that
checks the time. If it's not 23.00-05.00, pass all the arguments to
the normal notification script. If it is, stash it somewhere for the
cronjob to parse later.
I'd also suggest using the standard notification script to send out
the summary later, as it's really just a simple macro-expansion
script that knows about various transports.
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
More information about the op5-users
mailing list