[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getting alert to call scripts
- To: hobbit (at) hswn.dk
- Subject: getting alert to call scripts
- From: "Robin Wood" <dninja (at) gmail.com>
- Date: Thu, 16 Aug 2007 20:18:30 +0100
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=hBahaAH0GC4z7LG/BAgdNz+jCnlrmOHnOC4tFfK8YgHjTUNDErg4Kz6yLAxOv6oDKPVrXAjM6NErLnd4gXecJwyWD7howqaIIUxvau05cIN1wmzyKb27yKUu4vW52y2RbSYeWEFJT722bUqrledTC5YX042qQ3PY+fJ49mfo3+I=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=NcqrQZkatASkzRbw8lnvkudV+DOJifthot7nCKyIeDLlx6MBOU5zskoqABWXWIS4xQyNMwi6bM0inhH7ebGdzDKK+kYUA/fZdCiLnw8idfYV5dsxcZaIgpvEGMq6m+VfxviCg/VDTiZvnFT3nPllS2UalaPr2YWcvjYoGUdHE0s=
Hi
I've setup an alert to call a script but I must have something wrong
as the scripts are never getting called.
The alert is:
HOST=devsite SERVICE=http
MAIL dninja (at) gmail.com DURATION>5
SCRIPT /usr/local/bin/sendsms 1234567890 FORMAT=SMS
SCRIPT /usr/local/bin/sendemail 1234567890 FORMAT=TEXT
SCRIPT /usr/local/bin/sendscript 1234567890 FORMAT=SCRIPT
And to test it:
/usr/lib/hobbit/server/bin/hobbitd_alert --test devsite http
00026523 2007-08-16 20:14:41 send_alert devsite:http state Paging
00026523 2007-08-16 20:14:41 Matching host:service:page
'devsite:http:' against rule line 29
00026523 2007-08-16 20:14:41 *** Match with 'HOST=devsite SERVICE=http' ***
00026523 2007-08-16 20:14:41 Matching host:service:page
'devsite:http:' against rule line 30
00026523 2007-08-16 20:14:41 Failed 'MAIL dninja (at) gmail.com DURATION>5'
(min. duration 0<300)
00026523 2007-08-16 20:14:41 Matching host:service:page
'devsite:http:' against rule line 29
00026523 2007-08-16 20:14:41 *** Match with 'HOST=devsite SERVICE=http' ***
00026523 2007-08-16 20:14:41 Script alert with command
'/usr/local/bin/sendsms' and recipient 1234567890
00026523 2007-08-16 20:14:41 Matching host:service:page
'devsite:http:' against rule line 29
00026523 2007-08-16 20:14:41 *** Match with 'HOST=devsite SERVICE=http' ***
00026523 2007-08-16 20:14:41 Script alert with command
'/usr/local/bin/sendemail' and recipient 1234567890
00026523 2007-08-16 20:14:41 Matching host:service:page
'devsite:http:' against rule line 29
00026523 2007-08-16 20:14:41 *** Match with 'HOST=devsite SERVICE=http' ***
00026523 2007-08-16 20:14:41 Script alert with command
'/usr/local/bin/sendscript' and recipient 1234567890
All the scripts are in place
ls -l /usr/local/bin/send*
-rwxr-xr-x 1 root root 101 2007-08-16 19:19 /usr/local/bin/sendemail
-rwxr-xr-x 1 root root 103 2007-08-16 19:18 /usr/local/bin/sendscript
-rwxr-xr-x 1 root root 100 2007-08-16 19:19 /usr/local/bin/sendsms
yet when I stop the webserver and cause the status to go red none of
the scripts get called.
The scripts currently just write to a file the fact they have been
called and their parameters so that I can see what I have to play
with:
cat /usr/local/bin/sendscript
#!/usr/bin/php
<?
$h = fopen ("/tmp/script", "a");
fwrite ($h, print_r ($argv, true));
fclose ($h);
?>
I've got something wrong, what is it?
Thanks
Robin