[mrtg] Re: increased granularity

Tim Kennedy sugarat at thunderhold.sugarat.net
Wed Nov 17 20:13:32 MET 1999


Truly, it's easiest done with a shell script.
I have one file that has a list of all my routers, so that makes it easy.
And this is a file that I wrote for rolling my syslogs.  I modified it a
little for here, but it should either work, or be very easy to make work.

-Tim

Something like this:
###############
#! /bin/sh
#
# This file assumes a list of routers in /usr/local/mrtg/etc
# called routerlist.
#
# It assumes that you use /usr/local/mrtg/www as the "home" dir
# for all your WorkDirs, and that the WorkDirs are named after 
# the routers.
# thus all files for rtr1.foo.com would be in
# /usr/local/mrtg/www/rtr1.foo.com/
# Just edit your paths, or whange what you need to to make it work
# for you.
# -Tim
#
CFGDIR="/usr/local/mrtg/www/"
ARCDIR="archive"
DATE=`/bin/date +%Y%m%d`

for i in `cat /usr/local/mrtg/etc/routerlist`; do
    for j in `ls -l $CFGDIR/$i/ | awk '{print $9}' | grep day` ;
        cp $CFGDIR/$i/$j $CFGDIR/$i/$ARCDIR/$j.$DATE
    done                                                 
done
#
#EOF
#############@

On Wed, 17 Nov 1999, Neil Calvert wrote:

> I checked out the contrib directory and it's almost usable.
> Unfortunately the way I have implemented MRTG means I can't use it. The
> contrib script backup.pl assumes all config files are in the same
> directory. In my site, I have a separate directory for each config file
> and a separate output file for each one. The reason for this is I have
> many sites to monitor and I find that a carefully laid out directory
> structure lends order to the procedure.
> 
> What I would have to do is modify backup.pl to accept a list of input
> config dirs and output dirs and run through its main body as a loop for
> each one. Not being a perl programmer, it's back to the drawing board.
> 
> Unless someone out there already did this...

--
* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg


More information about the mrtg mailing list