monit-general
[Top][All Lists]
Advanced

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

exec script


From: Mark Olliver
Subject: exec script
Date: Wed, 23 Nov 2011 13:10:14 -0000

 

Hi,

 

We have an alert script which sends messages about service states to pagerduty, for this to work I think I need to set use the exec function on the monit checks.

I have tried the command line below which works fine when running it in the CLI however is blank when running it from Monit. Can I please check is the variable DESCRIPTION and EVENT exported in monit or should I be using something else?

 

check host test with address 192.168.1.1

    if failed icmp type echo count 5 with timeout 15 seconds 2 cycles then exec "/bin/bash -c 'export PAGER_MSG=\"`echo $DESCRIPTION $EVENT\"`;/usr/local/bin/pagerduty_api.pl --service api_test --event trigger --msg'" else if succeeded then exec "/bin/bash -c 'export PAGER_MSG=\"`echo $DESCRIPTION $EVENT`\"; /usr/local/bin/pagerduty_api.pl --service api_test --event resolve --msg'"

 

Thanks

 

Mark

 


reply via email to

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