monit-general
[Top][All Lists]
Advanced

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

Re: Customer Alert


From: Eric Pailleau
Subject: Re: Customer Alert
Date: Mon, 11 Oct 2010 12:40:57 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100624 Mandriva/3.0.5-0.1mdv2009.1 (2009.1) Thunderbird/3.0.5

Hello,

Try by reverting quotes and brackets :

'/bin/bash -xvc "/usr/local/bin/alert $MONIT_SERVICE $MONIT_EVENT $MONIT_DESCRIPTION" 
>/tmp/exec.out 2>&1 /tmp/exec1.out'
instead of
"/bin/bash -xvc '/usr/local/bin/alert $MONIT_SERVICE $MONIT_EVENT $MONIT_DESCRIPTION' 
>/tmp/exec.out 2>&1 /tmp/exec1.out"

quotes avoid variable replacement.

Regards

Hi,

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 $MONIT_SERVICE $MONIT_EVENT $MONIT_DESCRIPTION
+ /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/test_processor.pid"
    start program = "/etc/init.d/web_start -p /var/run/test_processor.pid"
         as uid nobody and gid nobody
    stop program = "/bin/bash -c 'kill -TERM `cat
/var/run/test_processor.pid`'"
    if failed host 127.0.0.1 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

Regards
Mark



--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general


--
Salutations - Best regards - mit freundlichen Gr├╝ssen

----------------- address@hidden ------------------------------------
fr - Merci d'utiliser cette addresse pour le support ou question technique
en - Please use this address for any support or technical question
----------------- https://support.numlog.fr --------------------------------
fr - Privil├ęgier la gestion de ticket d'incident  (Clients NUMLOG)
en - Prefere our trouble ticket application   (NUMLOG's customers)




reply via email to

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