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
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general