Xymon Mailing List Archive search

Alert Script doesnt work!!!

1 message in this thread

list Rakesh Nair · Tue, 25 Nov 2008 10:56:20 +0530 ·
hi all

I ammonitoring a jboss server and have to generate an alert. I have written
a sample script as follows into a file named "alertscript.sh", which I have
placed in ~server/ext/ directory.
####################alertscript.sh##################
#!/bin/sh
#DESTINATION_FILE="/home/hobbit/server/ext/alerts.log"
DATE="`date | cut -f 2-3 -d ' '|replace ' ' '-'`"
TIME="`date | cut -f 4 -d ' '`"
DATA="An alert was raised on $DATE at $TIME"
echo $DATA >> alert.log
exit 0
####

I have added the following code into hobbit-alerts.cfg:
################################################
HOST=abc.xyz.com COLOR=yellow REPEAT=2m
        SCRIPT /home/hobbit/server/ext/alertscript.sh 0 DURATION>1 REPEAT=1
################################################

I think these are the only two things I have to do to make the alert work.
If there are any more steps, or any modifications to be made in the above
mensioned code, please tell me.
If you think this is the only thing I have to do, kindly deploy this code at
your end and let me know if the code works fine.
Please reply ASAP.

Thanks in advance.
Regards
Rakz