monit-general
[Top][All Lists]
Advanced

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

Re: restart counter not working with check host ?


From: Martin Pala
Subject: Re: restart counter not working with check host ?
Date: Thu, 17 Nov 2011 16:19:27 +0100

Hello Eric,

the configuration looks OK. The restart counter doesn't depend on the exit 
value - it simply counts the number of consecutive restart actions which were 
done for whatever reasons. The problem with the "sms_alert" script could be 
missing environment variable - the script can be executed, but it failes, 
because it depends on some variable which is not set by monit.

Please try to run monit with the -v option and send the logs (it will log each 
action and script execution). You can modify the exec action to log the script 
output like this:

   if 3 restarts within 3 cycles then exec "/bin/bash -c 
'/root/scripts/sms_alert >>/tmp/sms_alert.log 2>&1'"

Regards,
Martin
 

On Nov 14, 2011, at 9:14 AM, Eric Pailleau wrote:

> Hello,
> 
> I got a problem with Monit version 5.2.3 :
> 
> I have below monitoring set.
> In the log I can see more than 3 restarts but the sms alert is never launch...
> 
> Is there something wrong with the "check host syntax" ?
> 
> Note : I'm not sure of what exit code the myscript returns
>       (I can see some 'exit' without any code in the script).
>       What the behaviour of monit with simple 'exit' ?
>       Is the restart counter dependant of start command return code ?
> 
> -------8<------------------------------------------------------------------
> check host myscript with address 127.0.0.1
>    start program = "/bin/su - user -c '~/etc/init.d/myscript start'"
>    stop  program = "/bin/su - user -c '~/etc/init.d/myscript stop'"
>    if 3 restarts within 3 cycles then exec "/root/scripts/sms_alert"
>    if failed port 33300 with timeout 30 seconds then restart
>    if 10 restarts within 10 cycles then timeout
>    depends on proxy
> -------8<------------------------------------------------------------------
> 
> Thanks for your help.
> Regards.
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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