BB Unix Network Monitor - Message
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: {bb} Limiting the duration of a 'red' msgs alert
I had a desire to see my bb page green so every hour I rename my errors.
They are still there, just truncated.
I add the following to my crontab:
10 * * * * /opt/local/scripts/cron/ackbb.pl
Here is the /opt/local/scripts/ackbb.pl script I use:
#!/usr/local/bin/perl
#
#===========================================================================
==============
#
# Name: ackbb.pl
#
# Purpose: To reduce the number of repeat pages that Big
Brother sends.
#
# Usage: perl ackbb.pl
#
# Input Data Files: /var/log/syslogd/ALL.logs
#
# Output Data File: none
#
# Author: Mike Cormier
#
# Date: 1999/10/29
#
# Language: Perl
#
# Version: 1.0 (please update version control at end of
script)
#
#===========================================================================
==============
#
# The file that BB uses to search for error messsages.
$MessageFile = "/var/log/syslogd/ALL.logs";
$TempFile = "/tmp/TempLog";
# The strings that BB uses, separate each string by a colon. This would be
the unique entries
# from $BBHOME/etc/bbdef.sh following MSGS and PAGEMSG. Maybe in the future
this can be
# read in from the file.
$SearchString = "NOTICE:WARNING:REFUSED:REFUSE:refuse:fatal";
@tmpSearch = split(/:/,$SearchString);
# Get the number of different search strings
$length = @tmpSearch;
# Replace the messages
$count = 1;
while ($count <= $length) {
$tmpReplace = substr($tmpSearch[$count - 1],0,3);
$command = "sed 's/$tmpSearch[$count - 1]/$tmpReplace/g' $MessageFile >
$TempFile";
system($command);
# print "$count -- s\/$tmpSearch[$count - 1]\/$tmpReplace\/g $MessageFile
$TempFile\n";
$command = "mv $TempFile $MessageFile";
system($command);
$count++;
}
Any comments or statements made within this document are strictly those of
the author and not of Bell Nexxia.
----- Original Message -----
From: Steve Hillman <hillman@sfu.ca>
To: <bb@bb4.com>
Sent: Thursday, February 03, 2000 1:21 PM
Subject: {bb} Limiting the duration of a 'red' msgs alert
> Hi folks,
> Has anyone written a patch to limit how long a 'bad message' in
> /var/adm/messages causes a red alert for? On some of our less verbose
> machines, we only rotate the logs once a week, which means the msgs column
> stays red long after the problem has been handled or acknowledged. Since I
> don't want to zero out my log file whenever I solve a problem it reported,
> it would be nice to tell big brother to stop reporting it after some
amount
> of time (for example, red for one hour (with an accompanying page), then
> yellow for 4 hours, then green again).
>
> If no one has done it, I'll get to work on it myself. I expect it'll
> require an add-on program that decodes the time stamp of each log entry to
> determine whether that log entry is recent enough to alert about.
>
> Thanks,
>
> Steve Hillman hillman@sfu.ca
> Senior Systems Administrator (604) 291-3960
> Simon Fraser University
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=
> 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