monit-general
[Top][All Lists]
Advanced

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

Re: [monit] how to stop a monitored group


From: Martin Pala
Subject: Re: [monit] how to stop a monitored group
Date: Fri, 11 Jan 2008 20:28:59 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071119 Iceape/1.1.7 (Debian-1.1.7-1)

The stop and start commands don't perform the service validation. If monit is running as daemon, then the script will just ask the daemon to start/stop the group.

You can try to run monit in verbose mode and also add the full path to monit binary, verbose flag and path to the configuration file in the script, for example:

--8<--
  check file last_good_ntp with path /opt/unb/run/last_good_ntp
     if timestamp > 360 minutes then
exec "/bin/bash -c '/usr/bin/monit -v -c /etc/monitrc -g ntpd_dependant stop all'"
     else if recovered then
exec "/bin/bash -c '/usr/bin/monit -v -c /etc/monitrc -g ntpd_dependant start all'"
--8<--


Martin



Nick Upson wrote:
I thought this would be simple, but it isn't. What I need is that
whenever the file is unchanged for 360 minutes stop several
monit-controlled processes but keep checking the file so that they can
be restarted when the file changes again. This is what I have:

    check file last_good_ntp with path /opt/unb/run/last_good_ntp
    if timestamp > 360 minutes then
       exec "/bin/bash -c 'monit -g ntpd_dependant stop all'"
    else if recovered then
       exec "/bin/bash -c 'monit -g ntpd_dependant start all'"

which goes into a loop as the call to monit causes it's tests to run,
which causes another call and round & round we go


--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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