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

Re: [Bigsister-general] Pager script


The following example will trigger an action as soon as a node goes
down or up.
The trigger performs two actions:
1) it launches a shell script, and
2) it sends an email
The shell script simply print the parameters supplied by bigsister.
Costa
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
# *** bb_event_generator.cfg ***
#
# DEFAULTS
#
*.* prio=40 down=yellow up=green delay=2 \
check="$host.conn and ((not '$router') or $router.conn)" \
norepeat=5 keep=1 suppressed repeatprio=10
*.conn prio=80 check="1" delay=0
#
# There must be only one <mail> and one <upmail> lines
#
# The following line is triggered when the connection goes up.
# It launches the shell script <my_shell_script> + it sends an e-mail
*.conn upmail=/usr/share/bigsister/bin/my_shell_script:up,sendmail:suppressed
#
# The following line is triggered when the connection goes down.
# It launches the shell script <my_shell_script> + it sends an e-mail
*.conn mail=/usr/share/bigsister/bin/my_shell_script:down,sendmail:suppressed
*.cpu prio=20 check="1" delay=0
*.disk prio=60 check="1" delay=0
*.msgs check="1" delay=0
# warn every 120 minutes until cleared
#
#*.rpc repeat=120
# do not report 'bak' events at all
#*.bak down=never
---------------------------------------------------
#!/bin/sh
#set -vx
#
#***********************************************************************
#
# * my_shell_script * It prints the parameters set by bigsister
#
#***********************************************************************
echo -e "\n\
*** > ${0} receives the following parametres:\n\
1) ${1}\n\
2) ${2}\n\
3) ${3}\n\
4) ${4}\n\
5) ${5}\n\
"
# export -p > ~/export.log
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----Original Message-----
From: suppressed
[mailto:suppressed Behalf Of
Patrick Woo (CIDC)
Sent: 20 March 2007 22:34
To: suppressed
Subject: [Bigsister-general] Pager script
 
Just wondering if someone can post a sample pager script and the line in bb_event_generator.cfg that trigger the script.
It is just not working for me. I can see the script being call in the messages file, but it wouldn't do anything. The script work as expected if I invoke it from the command line.
# /var/log/messages
Mar 20 15:29:27 ihsbs01 bsmon: sending page for smtp01.msgs with severity 50 via /usr/local/sbin/page_bmc to alarm: mail loop
# adm/bb_event_generator.cfg
*.* pager=/usr/local/sbin/page_bmc delay=0 repeat=5
# cat /usr/local/sbin/page_bmc
#!/usr/bin/perl
open (LOG, ">>/tmp/bmc.log");
print LOG "Start here\n";
close (LOG);
Patrick Woo
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bigsister-general mailing list
suppressed
https://lists.sourceforge.net/lists/listinfo/bigsister-general


New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bigsister-general mailing list
suppressed
https://lists.sourceforge.net/lists/listinfo/bigsister-general

Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.