BB Unix Network Monitor - Message
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: {bb} Double mailings
On Fri, 28 May 1999, CORMIER, MICHAEL wrote:
> Is is possible to setup Bigbrother (1.2a) to send mail to two different
> administrators. I know it's possible for different services but is it
> possible for different processes in a same service.
>
> Here is an example:
>
> Admin1 is taking care of these processes: "inetd, syslog, sendmail,
> sshd" and admin2 these processes: "ciscosecure, trendadmin,
> sm_arnotify". All these processes are defined in the same service which
> is procs. How can I setup BB to have a mail send to admin1 the processes
> monitored and a mail to admin2 when one of his processes goes down.
Not out of the box, but adding an EXT scrips for the second set of procs
isn't difficult, in such a way that you split the two sets of procs into
two reports: procs and procs2.
First mark the first set of as normal with PROCS/PAGEPROCS in bbdef.sh,
and add the second set as well:
---- Cutting here will damage your monitor ----
PROCS="bbd" # (YELLOW) WARN IF ONE OF THESE NOT RUNNING
PAGEPROC="inetd syslog sendmail sshd" # (RED) PAGE IF ONE OF THESE NOT RUNNING
export PROCS PAGEPROC
PROCS2="" # (YELLOW) WARN IF ONE OF THESE NOT RUNNING
PAGEPROC2="ciscosecure trendadmin sm_arnotify" # (RED) PAGE IF ONE OF THESE NOT RUNNING
export PROCS2 PAGEPROC2
---- End ----
Then in the ext dir, make a bb-procs2.sh like this:
---- Cutting here will damage your monitor ----
#!/bin/sh
# bb-procs2.sh
#=====================================================================
# SECOND GROUP OF PROCESSES THAT MUST EXIST
#=====================================================================
if test ! "$BBTMP" # GET DEFINITIONS IF NEEDED
then
# echo "*** LOADING BBDEF ***"
. $BBHOME/etc/bbdef.sh # INCLUDE STANDARD DEFINITIONS
fi
LINE=""
STATLINE="No processes to check"
COLOR="green"
for proc in $PROCS2 $PAGEPROC2
do
$GREP "$proc" $BBTMP/bb.$$ > /dev/null 2>&1
if test "$?" != "0"
then
STATLINE="Some processes are DOWN"
echo "$PAGEPROC" | $GREP "$proc" > /dev/null 2>&1
if test "$?" = "0"
then
COLOR="red"
LINE="$LINE &red $proc DOWN"
else
if test "$COLOR" != "red" # WASN'T A PANIC
then
COLOR="yellow" # SO JUST WARN
fi
LINE="$LINE &yellow $proc DOWN"
fi
else
if [ "$COLOR" = "green" ]
then
STATLINE="All processes are UP"
fi
LINE="$LINE &green $proc UP"
fi
done
$BB $BBDISP "status $MACHINE.procs2 $COLOR `date` $STATLINE $LINE"
$RM -f $BBTMP/bb.$$
---- End ----
This will add a procs2 column for the server and make it easy to decide
which of the admins to page.
Setting up bbwarn is left as an excercise to the reader.
--
Henrik Olsen, Dawn Solutions I/S URL=http://www.iaeste.dk/~henrik/
`Can you count, Banjo?' He looked smug. `Yes, miss. On m'fingers, miss.'
`So you can count up to ...?' Susan prompted.
`Thirteen, miss,' said Banjo proudly. Terry Pratchett, Hogfather
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please send mail for the mailing list to: bb@taex001.tamu.edu
To [un]subscribe to this list, send e-mail to majordomo@taex001.tamu.edu
with [un]subscribe bb in the BODY of the message.
Please contact the mailing-list-owner as: bb-owner@taex001.tamu.edu
Home |
Main Index |
Thread Index