monit-general
[Top][All Lists]
Advanced

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

Re: Notification script in check program


From: Lutz Mader
Subject: Re: Notification script in check program
Date: Sun, 01 Jul 2018 15:44:34 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

Hello Martin,
FYI, I fixed my "check program" notification problem by using multiple
status checks to do something and one check to notify the "status
failed" and "status succeeded" only.

check program script.sh with path
/Users/lutz/Aufheben/monit/scripts/script.sh
  if status = 1 then exec "/Users/lutz/Aufheben/monit/scripts/script1.sh"
  if status = 2 then exec "/Users/lutz/Aufheben/monit/scripts/script2.sh"
  if status != 0 then exec "/Users/lutz/Aufheben/monit/scripts/zexec.sh"
    else if succeeded then exec
"/Users/lutz/Aufheben/monit/scripts/zexec.sh"

> you can use multiple status tests within the 'check program' - if the status 
> differs on program success, the second status check should catch it, 
> something like this:
> 
>  check program myprogram with path "/usr/local/bin/helloworld"
>        if status = 0 then exec "/usr/local/bin/script_no_1"
>        if status > 0 then exec "/usr/local/bin/script_no_2"

This way seems to work.
I get notifications and the scripts are called also.

With regards,
Lutz




reply via email to

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