[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Alert Script doesnt work!!!
- To: hobbit (at) hswn.dk
- Subject: Alert Script doesnt work!!!
- From: "Rakesh Nair" <k.rakeshnair (at) gmail.com>
- Date: Tue, 25 Nov 2008 10:56:20 +0530
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=cu6G0fttytB0gI2aK95L5+SauRa3keFiDFGUmssBdgc=; b=HsS/8H7LIHyGKeLH89W2/nMiIS++Rnfm2x0T+EaZQ7LtLe9BpRvk7Jj+U+SEYIGJN+ jHRtGKijvXmYJWRJdXCskJWuORLQWI4Aje6uC+oe8N4DJNxhzrx0UqTc9Rew30Wk2W9I 5pFxz9eBOP4ciZvmJMJHq40TExjW7HsTIW3dE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=STQFiVbqySNwzW2eCTIDoz43alNrRSGZSWVteT6Kg8CPL5RG6GoOIdGhUv9JOqht0A q95hbfKogcETMXkwX3ZbOx9ijH2j2PigqHe4pJyaGjoWN2Gv8Y8l6U6jsJoPQ/TNTo86 xqmfvMfvC5s4wSNm/xC68QXEXkrpUkbt+Wq9Y=
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