BB Unix Network Monitor - Message

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

Re: {bb} thresholds



In <200410061304.i96D4nL06671@ns2.koolconnect.com> "David Maayani" <dmaayani@koolconnect.com> writes:

>I am monitoring hotel environments where every room has a set top box, via
>the fping scripts.

>On average, hotels have 300-500 rooms (lots of pings!).

>How can I set up BB to page me on certain thresholds only, for example:

>Green = 0% of the rooms down
>Yellow = 5% > number of rooms down > 0%
>Red = >5% of rooms down

I think the easiest way of doing this would be a small script that
goes through the fping status-logs on your BBDISPLAY server, and
generates a combined status message based on these criteria. Then run
this script as a BB extension script.

Something like this (untested, but you get the idea).

#!/bin/sh

# Pick up the BB environment
BBHOME=/usr/local/bb
export BBHOME
. $BBHOME/etc/bbdef.sh

cd $BBLOGS
PINGCOUNT=`ls *.conn | wc -l`
REDPINGS=`grep -c "^red" *.conn`

LIMIT=`expr $PINGCOUNT / 20`

if [ $REDPINGS -eq 0 ]
then
    $BB $BBDISP "status $MACHINE.settops green All settop boxes respond"
elif [ $REDPINGS -lt $LIMIT ]
    $BB $BBDISP "status $MACHINE.settops yellow $REDPINGS boxes down"
else
    $BB $BBDISP "status $MACHINE.settops red $REDPINGS boxes down"
fi

exit 0
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
To unsubscribe from this list, or to subscribe to the bb-digest list
send e-mail to mailto:majordomo@bb4.com with unsubscribe bb -and/or-
subscribe bb-digest in the BODY of the message.


Home | Main Index | Thread Index