monit-general
[Top][All Lists]
Advanced

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

Re: Problem on using "check process"


From: Martin Pala
Subject: Re: Problem on using "check process"
Date: Fri, 10 Jun 2016 08:19:17 +0200

Hi Paul,

the original behaviour was to execute the action every cycle where failure was 
detected. This was tricky for lots of users who use the exec action with custom 
notification script (for example to send alert via SMS) - the alert was sent 
every cycle the error persisted.

We have changed the exec action in Monit 5.16, so it works similarly to the 
alert action - executes the script only once on every state change (i.e. on 
transition from "success" -> "failure").

If you want to exec every cycle, you can set the new "repeat" option.

Changelog excerpt:

--8<--
New: The exec action is now executed only once, on state change, same way as 
the alert action. The new "repeat" option allows to repeat the exec action 
after given number of cycles if the error persists.  Syntax:

        if <test> then exec <script> repeat every <x> cycles

Example:

        if failed port 1234 then exec "/usr/bin/myscript.sh" repeat every 5 
cycles

If you want to get the old behaviour, use "repeat every 1 cycle". 
--8<--

Best regards,
Martin


> On 10 Jun 2016, at 03:58, Paul Sun <address@hidden> wrote:
> 
> Hi
>  
> We have been using MONIT for a long time, and we are running “check process” 
> in order to determine and execute external scripting. However, we noticed 
> that the “exec” action is no longer execute after running awhile, MONIT did 
> not execute the action script. 
>  
> The same MONIT configuration is used for MONIT 5.14 without any problem, and 
> the problem is presented in MONIT 5.17.1 and 5.18. any idea?
>  
> -          RBK
>  
> MONIT CONFIG
> ============
> # Path Ownership - PKT
> #
> check program pathowner_pkt with path 
> "/home/testadm/script/check_owner_dir.sh testadm testadm /data2/PKT TESTP*"
>    if status != 0 then exec "/home/testadm/script/change_owner_dir.sh testadm 
> testadm /data2/PKT TESTP"
>    group test
> #
>  
> MONIT LOG
> =========
>  
> 2016-06-08T04:32:51.301760+00:00 app-trc001 monit[29249]: 'pathowner_pkt' 
> '/home/testadm/script/check_owner_dir.sh testadm testadm /data2/PKT TESTP*' 
> failed with exit status (99) -- File (TESTP*) in /data2/PKT is required to 
> change ownership.
> 2016-06-08T04:32:51.301767+00:00 app-trc001 monit[29249]: 'pathowner_pkt' 
> exec: /home/testadm/script/change_owner_dir.sh
>  
> 2016-06-08T04:33:51.514799+00:00 app-trc001 monit[29249]: 'pathowner_pkt' 
> '/home/testadm/script/check_owner_dir.sh testadm testadm /data2/PKT TESTP*' 
> failed with exit status (99) -- File (TESTP*) in /data2/PKT is required to 
> change ownership.
> <<< MONIT didn’t call “exec: /home/testadm/script/change_owner_dir.sh” >>>
>  
> 2016-06-08T04:34:51.730525+00:00 app-trc001 monit[29249]: 'pathowner_pkt' 
> '/home/testadm/script/check_owner_dir.sh testadm testadm /data2/PKT TESTP*' 
> failed with exit status (99) -- File (TESTP*) in /data2/PKT is required to 
> change ownership.
> <<< MONIT didn’t call “exec: /home/testadm/script/change_owner_dir.sh” >>>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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