[TriLUG] log monitoring

Jon Carnes jonc at nc.rr.com
Wed Feb 20 10:14:46 EST 2002


Have you thought of using Quota's?  You can set the level's very high and
then simply use the Quota reporting tools to tell you about the users and
how many files they have.  Setting up quota's requires a reboot of your
server (yes it's true!), and quota's don't work across volumes, but
otherwise their are very handy to have working.  You can stop users from
doing insane things like copy their entire HD up to one of your servers...

Here is a pair of scripts that I run nightly on my main file server.  The
first dumps out a the size of each users home directory and emails me the
top ten.  The second dumps out the size of each departmental volume and
emails that to me.

=== home_du ===
#!/bin/bash
# List the size of individual users directories on Plasma
cd /home/users; du >/tmp/du_users
echo Top 10 Users of space on Plasma:
echo " "
tac /tmp/du_users |cut -f1,2 '-d/' |uniq -f1 |sort -n |tail -11
echo " "
# rm /tmp/du_users

=== vol_du ===
#!/bin/bash
# List the size of individual volumes on Plasma
cd /vol; du -h >/tmp/du_vol
echo Departmental Volume sizes on Plasma:
echo " "
tac /tmp/du_vol |cut -f1,2 '-d/' |uniq -f1 |sort -k2
#rm /tmp/du_vol

=== cron entries in root's cron ===
# Output the Dept. volume sizes
15 3 * * *      /usr/local/sbin/vol_du
#
# List the volume sizes of the users Home directories
30 3 * * *      /usr/local/sbin/home_du
#
======

Are you using Samba for disk access.  If so, you might be interested in
using some of the Samba tools for monitoring disk usage and open files.

Jon Carnes
----- Original Message -----
From: "Joselito Almario" <jalmario at intrah.org>
To: <trilug at trilug.org>
Sent: Wednesday, February 20, 2002 9:14 AM
Subject: [TriLUG] log monitoring


>
>
> I am trying to find a good way to monitor disk usage on my  file server.
I
> would like to monitor those files and folders that are getting to big and
> see which files are frequnetly accessed.  I am still new to writing bash
> scripts, and I am still learning my way through the crontab and doing
> cronjobs.  I tried smaller jobs on the crontab but I am not interperting
the
> time schedule right.  I believe I can get this down in the near future,
but
> I need a simple interim solution that can give me good comprehensive
> monitoring, logs and statistics on the folders (do what du or df do) and
> will notify me when things reach X capacity.
>
> Are there any good monitoring tools available that are relatively
> maintenance free and don't rely on you knowing how to write shell scripts?
>
> Thanks in advance
> JOJO
>
> _______________________________________________
> TriLUG mailing list
> http://www.trilug.org/mailman/listinfo/trilug




More information about the TriLUG mailing list