monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

monit alert definition / action support [was: monit and xmpp notificatio


From: Martin Pala
Subject: monit alert definition / action support [was: monit and xmpp notifications]
Date: Wed, 01 Dec 2004 21:08:21 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5

Jan-Henrik Haukeland wrote:
Nevertheless, maybe globally alerter1="", alerter2="", etc. could be defined (similar
to exec), which will all be run whenever monit wants to sends an alert,
and some interesting arguments in env vars.


Right! Lets see what the others think about it first. Feedback anyone?

I though about something similar, but maybe more general.

The idea is based on methods definition. Monit can have some "well-known" methods, such as start, stop, restart, alert, etc. It could be possible to add another methods or redefine the default behavior. More then one action could be supported by comma separating their names/tokens.

Example:

--8<--
1  set method alert-xmpp "/usr/bin/sendxmpp -s $MONIT_EVENT address@hidden"
2
3  check process myproc with pidfile /var/run/myproc.pid
4    if <condition1> then alert, alert-xmpp, restart
5    if <condition2> then stop, alert
--8<--

where lines:

1 defines global method, its name (alert-xmpp is possible to use as monit action
4 defines stack of actions - i.e. "alert" && "alert-xmpp" && "restart"
5 defines diferrent actions for diferrent condition


The method could be set globaly (token accessible in all check statements), or localy (accessible only in the check statement where the method was defined).

It could be possible to override default behavior, of well-known method by local or global explicit definition (using the same name - for example 'restart').


Just my 0.02$ :)

Martin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]