$Id: INSTALL,v 1.2 2004/10/06 22:32:08 ben Exp $

INSTALLATION (UN*X):

1. Make sure you have RRDtool installed.  Get it at
http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/ or from an APT
repository or from *BSD ports.

2. Create an RRD file to store your router's throughput statistics.  For
   example, go like this (read the rrdtool(1) man page if this is
   confusing):

     % rrdtool create di624.rrd \
         --step=300 \
         DS:in:COUNTER:600:0:12500000 \
         DS:out:COUNTER:600:0:12500000 \
         RRA:AVERAGE:0.5:1:288 \
         RRA:AVERAGE:0.5:4:504 \
         RRA:AVERAGE:0.5:144:730 \
         RRA:MIN:0.5:1:288 \
         RRA:MIN:0.5:4:504 \
         RRA:MIN:0.5:144:730 \
         RRA:MAX:0.5:1:288 \
         RRA:MAX:0.5:4:504 \
         RRA:MAX:0.5:144:730

3. Copy di624.cgi to your cgi-bin directory; we'll call this directory
   /path/to/cgi-bin/.  di624.cgi uses RRDtool's "rrdcgi" program for
   template parsing.

     % cp di624.cgi /path/to/cgi-bin/
     % chmod +x /path/to/cgi-bin/di624.cgi

4. Create a directory for image storage.  di624.cgi needs to write to
   this directory, so you will probably need to chgrp this directory to
   your web server's gid.  The lines below assume that your web server
   is running as user 'www':

     % mkdir /path/to/rrdcgi-images/
     % su root
     # chgrp `id -g www` /path/to/rrdcgi-images/
     # chmod g+w /path/to/rrdcgi-images/

   Hint: you may want to put your rrdcgi-images/ directory somewhere
   inside your web site's htdocs directory; otherwise you'll have to
   create an 

5. Add an entry for di624stats.pl in your crontab.  For example:

   */5 * * * *     /usr/bin/perl /path/to/di624stats.pl -h 172.17.28.1 -P 8080 -p mypassword -f /path/to/di624.rrd

   This will gather your router's statistics every 5 minutes.

6. Wait a few minutes (11 or so) for di624stats.pl (via crontab) to run
   a few times and gather some initial data.

7. Edit di624.cgi and change "/path/to/rrdcgi-images" to the full
   (local) path of your image directory; change "/rrdcgi-images/%s" to
   the relative URI of this directory as your web server sees it.
   Change "/path/to/rrdstats" to the full path of the directory
   containing your .rrd file.

8. Visit http://your.site/cgi-bin/di624.cgi and look at your statistics.

-Ben Ransford
 http://ben.ransford.org/
