[Top][All Lists]

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

Re: Customer Alert

From: Mark Olliver
Subject: Re: Customer Alert
Date: Mon, 11 Oct 2010 10:53:52 +0100


I am still having issues getting monit to run a script. If it the script via the same command on the command line then it works.

address@hidden monit.d]# /bin/bash -xvc '/usr/local/bin/alert $MONIT_SERVICE $MONIT_EVENT $MONIT_DESCRIPTION' >/tmp/exec.out 2>&1  
address@hidden monit.d]# more /tmp/exec.out 
+ /usr/local/bin/alert
OK 100093
address@hidden monit.d]# ls -l /usr/local/bin/alert
-rwxr-xr-x  1 root root 1783 Oct  7 23:26 /usr/local/bin/alert

If however, i try the same from monit it fails to run the alert script and no output is placed into /tmp/exec.out.

check process test_processor 
   with pidfile "/var/run/"
   start program = "/etc/init.d/web_start -p /var/run/"
        as uid nobody and gid nobody
   stop program = "/bin/bash -c 'kill -TERM `cat /var/run/`'"
   if failed host port 32698 then 
        exec "/bin/bash -xvc '/usr/local/bin/alert $MONIT_SERVICE $MONIT_EVENT $MONIT_DESCRIPTION' >/tmp/exec.out 2>&1 /tmp/exec1.out"
   if does not exist then
        exec "/bin/bash -xvc '/usr/local/bin/alert $MONIT_SERVICE $MONIT_EVENT $MONIT_DESCRIPTION' >/tmp/exec.out 2>&1 /tmp/exec1.out"
   if 5 restarts within 5 cycles then unmonitor
   mode active

Do you have any ideas where i am wrong on this command. I am using monit version 5.2.1


reply via email to

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