[Top][All Lists]

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

Re: monit and xmpp notifications

From: Dirk-Jan C. Binnema
Subject: Re: monit and xmpp notifications
Date: Wed, 1 Dec 2004 16:40:04 +0100
User-agent: Mutt/1.5.6+20040907i

On Wed, Dec 01, 2004 at 15:57 (+0100), Jan-Henrik Haukeland wrote:
> On Dec 1, 2004, at 3:34 PM, Dirk-Jan C. Binnema wrote:

[combining monit and sendxmpp]
> This should be easy, simply add an exec statement in one of the 
> if-tests. Upon an error monit will call the program defined in the exec 
> statement *and* send an email. Such as in this example:
>  check file httpd.conf path /usr/local/apache/conf/httpd.conf
>      if changed sha1 checksum
>         then exec "/usr/local/sendxmpp"

Ah, stupid oversight by me. 

> This brings up another idea. Should we create a way to add alert 
> methods to monit based on the same delegation-pattern we use for 
> protocol-tests?  Okay, you _can_ do it by utilizing exec as shown 
> above, but a more embedded option could be nice to have.

Well, the 'exec' above is ok, but it seems you can have only one
statement after 'then' (is that true?). So, I would need to do the whole
thing again (not sure about the exact syntax)
      if c1 then exec "echo \"restarting bla\" | sendxmmp -s warning 
      if c1 then restart

This seems a bit funny, esp. as c1 may change between the two tests.
> I.e. a way to write a small C-stub to delegate the alert functionality. 
> Not sure how this interface will look in practice but I think the idea 
> is interesting since there are lots of other alert transport mechanisms 
> than SMTP today. I'm interested to know what others think about such an 
> idea. What should be the input and output parameters to such a stub 
> etc?

You mean loading external code into monit? That would certainly be
useful, but also a bit scary for the stability. Specialized blurbs of
C-code may not have enough users to iron out the bugs quickly.

Of course, the exec-thing can be dangerous to (I don't see a timeout
defined for the external program).

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


 * Dirk-Jan C. Binnema  [djcb]
 *   address@hidden
 *     address@hidden

reply via email to

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