monit-dev
[Top][All Lists]
Advanced

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

Re: How to monitor service start/restart/stop?


From: Martin Pala
Subject: Re: How to monitor service start/restart/stop?
Date: Thu, 27 May 2004 19:12:30 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5

Monit 4.3 will send NONEXIST event in the case that the process is not running - as soon as the process will start again, you will receive recovery notification. You can use exec to involve your logger as you noted. Monit always reports the triggered action (e.g. 'restart', 'alert', etc.) In the case that the service is under monit's control (i.e. monit is responsible for service starting/stopping), it will work well. If monit is not responsible for starting/stopping (i.e. external process/user is responsible for that), then you risk race conditions given by testing cycle length.

You can add also the call to your logger directly to start/stop program script related to monitored service. Monit provides another information in environment variables to to the executed program.

Martin

Stanley Lee wrote:
I need to log a message with my application logger
whenever a monitored service starts, stops, crahses or
restarts.
Is it possible to do so using the Monit's IF <TEST>
THEN EXEC option or any other way? So far I'm not successful since the TEST options doesn't include testing for a service start, stop,
crash or restart situation.

Thanks for your help in advance,

Regards,

Stan Lee





reply via email to

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