Summary: Script to monitor log sizes

From: Ron Bramblett <bramblett_at_fullerbrush.com>
Date: Mon, 06 Mar 2000 20:14:48 +0000

Thanks for the quick responses I had 3 already.

from Michael Bucholtz
you could setup a simple shell script to run via cron to e-mail the size
of
each logfile to you every couple of days..

sample:

#! /bin/ksh
ls -l /var/adm/messages >/tmp/msg.tmp
ls -l /var/adm/sialog >>/tmp/msg.tmp
cat /tmp/msg.tmp | /usr/bin/mailx -s "Logfile sizes" email_at_address

Not the prettiest thing..but at least you'll know how big certain
logfiles
are

#2 from Jim Fitzmaurice
jpfitz_at_fnal.gov

Have you tried BigBrother http://bb4.com. It can monitor many things and

has extension scripts to monitor things like log files. With Kermit and
a
modem BigBrother can even send you pages, but it's default is to send
e-mail. It also has a html display you can set up to visually monitor
your
systems. It might be a little overkill in your case but it's OSS and
doesn't
cost anything to download and use. It's definitely worth looking into,
and
personally I don't know what I'd do without it.

#3 from Jeremy Mates

>From crontab, call a script similar to the following with agruments of
the full pathname of the file to check, and size limit (in bytes) every
so often:

#!/usr/bin/perl

# first argument is where to find file, second how large it can be
# before squaking
if (-s $ARGV[0] > $ARGV[1]) {
        system("mail cleanup_sap_at_internal.example.com");
}


I just wasn't sure what the correct way to call a mail system was.
Thanks


--
Ron Bramblett                   | Men never do evil so completely & cheerfully
Systems Administrator           | as when they do it with religious conviction.
The Fuller Brush Company        |                               - Blaise Pascal
Received on Mon Mar 06 2000 - 20:09:06 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:40 NZDT