BB Unix Network Monitor - Message

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

Re: {bb} Re: Way to pick up failures on DTS jobs



In <82F7EDC10657264083BF52FBC64378CE255543@dohsmailhq07.doh.ad.state.fl.us> <Paula_Stankus@doh.state.fl.us> writes:

>Does anyone have a script that will allow failures in DTS jobs to be
>picked up by Big Brother?

Not sure what a "DTS job" is, but it it's something you run on a server
with the BB client installed, you might be able to just modify the 
script that runs the job so that it sends in a BB status when the
job completes - they you can make it green or red depending on whether
the job completed OK or not.


It basically goes like this:


#!/bin/sh

# Pick up the BB environment - adjust this to where your
# BB client is installed.
BBHOME=/usr/local/bb/bbc1.9h
export BBHOME
. $BBHOME/etc/bbdef.sh

# Define the columnname we will use in BB
COLUMNNAME=DTS

... run the commands needed to perform your task ...

# OK ? This assumes the exit code 0 means OK, but you could
# e.g. look for a file that is generated by the job, or 
# whatever other way of determining success is relevant for
# your task.
if test $? -eq 0; then
   COLOR=green
   MSG="Job completed OK"
else
   COLOR=red
   MSG="Job FAILED"
fi

# Send the status to BB
# The "+1500" makes the status valid for 1500 minutes (25 hours)
# which is good if your job only runs once a day.
# The default is only valid for 30 minutes, then it goes purple.
$BB $BBDISP "status+1500 $MACHINE.$COLUMNNAME $COLOR `date`

$MSG
"

exit 0



Regards,
Henrik

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
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