BB Unix Network Monitor - Message

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

RE: {bb} Avoid purple



The following scripts (and recommendations therein) are the best option available. I have used it for many daily/weekly cron tasks pr other one-off tests.

It really does work.

Best of Luck.

Robert Ruork

"the manual said "requires Windows 2000 or better"...so I installed Solaris"
==============================
#!/usr/local/bin/perl

# bbrefresh
# Written 6/2000 by Brion Moss <brion @ queeg.com>
#
# This script takes a hostname and a monitor name as argument and refresh
# the status.  This is so you have a BB monitor that only runs a couple
# of times a day and not have it go purple.
#
# For example. you can have BB monitor to make sure that your nightly
# backups worked, but why have that monitor run every 5 minutes when
# you're checking on a once a day thing?
#
# Add the following to bb-network.sh:
#
#                refresh* )
#                        SVCNAME=$1
#                        $BBHOME/bin/bbrefresh $FULLNAME $SVCNAME
#                        ;;
#  
# then add lines to bb-hosts that look like
#
#       10.1.2.3 backuphost # telnet refresh:backupmon
my ($host,$monitor) = (@ARGV);   # get arguments
$monitor =~ s/^refresh://;
$host =~ s/\./,/g;
my $BBHOME = $ENV{'BBHOME'}; $BBHOME ||= "/usr/local/bb";
my $BBDISP = $ENV{'BBDISP'}; $BBDISP ||= "localhost";
my $logdir = "$BBHOME/www/logs";
#print "Refreshing: $host $monitor\n";

# Scan the logs directory for the monitor to refresh
opendir(DIR,$logdir) || die "Can't read log directory $logdir: \n";
foreach $file (readdir(DIR)) {
  if ($file eq "$host\.$monitor") {
    my @log;
    open(LOG,"$logdir/$file") || die "Can't read $logdir/$file: $!\n";
    while (<LOG>) {
      last if (/^Status unchanged in/);
      push(@log,$_);
    }
    close LOG;
    $log[0] =~ s/purple/green/;
    $msg = "\"status $host.$monitor " . join('',@log);
    $msg =~ s/\n+$//g;
    $msg .= "\n\"\n";
    system("$BBHOME/bin/bb $BBDISP $msg") && 
      die "Can't run $BBHOME/bin/bb $BBDISP \"$msg\": $!\n";
    last;
  }
}
closedir DIR;

-----Original Message-----
From: owner-bb@bb4.com [mailto:owner-bb@bb4.com]On Behalf Of Kevin
Hanrahan
Sent: Tuesday, 1 February 2005 4:25 PM
To: 'bb@bb4.com'
Subject: {bb} Avoid purple


Hello all,
  I have an external test that I want to run every 4 hours. Since it will
not be updated every 30 minutes, it will go purple until the next test is
run. How can I avoid this?

Server = 1.9e on RH linux 7.2
Client = 1-8d on Win2000


Any input appreciated


Thanks, 

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

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