BB Unix Network Monitor - Message

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

Re: {bb} Custom SMTP script



On Fri, 2006-06-23 at 17:23, MT wrote:
Brothers,

I've been messing around with a custom SMTP script.  The reason is
that I would like to set alert levels based on the time it takes for
the SMTP server to answer.  The meat of the script is such:

OUTPUT=`command time -o /tmp/time.temp $BBHOME/bin/bbnet
"10.5.101.7:25"`

TIME_RESULTS=`cat /tmp/time.temp | grep "elapsed" | awk '{print $3}'
| cut -d: -f2 | sed 's/elapsed//' | cut -d. -f1`

if [ "${TIME_RESULTS}" -ge "30" ];
then
         COLOR="red"
         MESSAGE="
Telnet timeout exceeded 30 seconds!
Actual Completion Time: ${TIME_RESULTS}"

elif [ "${TIME_RESULTS}" -gt "15" -a ${TIME_RESULTS} -lt "30" ];
then
         COLOR="yellow"
         MESSAGE="
Telnet timeout warning!
Actual Completion Time: ${TIME_RESULTS}"
else
         COLOR="green"
         MESSAGE="
Telnet normal.
Actual Completion Time: ${TIME_RESULTS}"
fi

I blocked SMTP traffic from BBNET so I could test this out. What's
happening is after 20 seconds bbnet returns and the script (because
it took 20 seconds) marks status as yellow.  Since I blocked smtp
traffic I would want that status to be red (should take longer than
20 seconds).  Is this possible?  Any ideas out there how I can
improve this script?

Here, bbnet actually makes three attempts waiting first 3, then 5 and
then 12 seconds (i.e. 20 seconds overall). If you re-set the values
of the environment variables (BBNETTIMER1, BBNETTIMER2 and BBNETTIMER3)
before running bbnet, you can make it wait longer. For example:


    BBNETTIMER1=6
    BBNETTIMER2=9
    BBNETTIMER3=16

would last 31 seconds before timing-out.

Cheers, Phil.

Great, thanks Phil. I was messing with the bbnet.c source and couldn't get it to work right (compiling errors, etc). This is much easier.

Thanks again,
Matt
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
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