[Top][All Lists]

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

Re: Question about monitrc file.

From: Martin Pala
Subject: Re: Question about monitrc file.
Date: Mon, 27 Aug 2007 21:06:00 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20070802 Iceape/1.1.4 (Debian-1.1.4-1)

You can prepare wrapper for init script which will decide what to do in the case that it is called by monit - either call init script or do different thing (e.g. stop heartbeat). You can use monit environment variables to support the decision. This modification should be easy scripting.

There is also very general hint which allows to do many things with monit - see question no. 13 in FAQ (

There are most probably another ways how to do the same thing.

Btw. some monit events (such as timeout) have implicit actions currently, we plan to allow to override these actions:


address@hidden wrote:
So i have to embed the heartbeat command in each init.d scripts ? That's not 
really what i want, i have to embedded it in monit manager in order to do what 
i want.

Le Mon, 27 Aug 2007 20:30:47 +0200, Martin Pala <address@hidden> a écrit:

When the process is not running, the start and stop programs for the
given service are run. You can thus embed the logic to the startup scripts.


address@hidden wrote:
I would like to do these step:

As soon as the process is declared as not running (misconfiguration etc...), launch the 
"monit heartbeat stop" command is order to change the active node.

Any idea ?


Le Mon, 27 Aug 2007 15:35:32 +0200, Jovan Kostovski <address@hidden> a écrit:

On 8/27/07, address@hidden <address@hidden> wrote:
I had an error with that command line:

if 2 restarts within 2 cycles then exec "/usr/sbin/monit heartbeat stop"

i get:

/etc/monit/monitrc:212: Error: syntax error 'exec "'

what is the problem ?
The syntax for this check is :

So the only action you can take after that check is timeout, which
actually calls the UNMONITOR action which will stop monitoring
the service. This means if you execute this check you'll have to
add another check that will test if the service is not running
and to issue the MONITOR action (run a script monit monitor service_name)

At the moment I can't figure out how to check if process is running (the only
think I can think of is to check if pid changed, but that will notify
you that the
process has been restarted)
Martin? Jan-Henrik? Any Ideas?

Vianney what exactly do you want to achieve? Maybe it can be
done some other way, some other checks.

BR, Jovan

To unsubscribe:

To unsubscribe:

To unsubscribe:

To unsubscribe:

reply via email to

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