|
RRDTool - The Round Robin Database
MRTG - The Multi
Router Traffic Grapher
14ALL.CGI - Server side HTML
generation
and Windows NT/2000
Last updated on: 18Dec2000
What is RRDTool and why would I
want to use it?
What is 14ALL.CGI and how does it work?
Integrating RRDTool with MRTG
Configuring your Web Server
Modifying 14all.cgi
Why this Page?
Think of MRTG as both a "front-end" (collector) and "back-end" (database) process. A series of PERL scripts target the SNMP device, collect the pertinent data, write it to a log file, and then generate graphic files and HTML text from that log file.
If, like me, you have been using MRTG for awhile, and are collecting data from many devices, you have likely experienced slow-down (mainly dues to massive disk activity). This is likely to be more prevalent in Windows NT since it does not have the threading capabilities of Linux or Unix.
RRDTool (also written by Tobias Oetiker), on the otherhand is a database format that supports multiple front ends (i.e. PERL scripts (like MRTG) or other shells. There are many "front-ends" to RRDTool, but this document (currently) addresses making MRTG scripts and environments work with an RRDTool "back-end". Then, at a later date you can transition into a full-fledged RRDTool configuration, with one of those "front-ends" performing the data acquisition and presentation functions.
Here's your biggest reason for upgrading ...SPEED!! Using RRD as the back-end greatly increases your collection time. Why? Because it does not spend any time generating grpahs or creating web pages. In addition, you can FINALLY graph more than 2 targets using RRDTool. Also, you can do neat things like modify graphs to only display certain times. Cool huh? Look to this site for information on how to do these things as I move forward myself.
14all is a server side (CGI) script that takes the data collected my mrtg.pl (provided it is writing that data in RRDTool logfile format), and creates "on-demand" graphics and web pages. It does not replace the MRTG "wrapper" web pages (or indexmaker web pages) you may have created.
14ALL.CGI is a MRTG contribution script written by Rainer Bawidamann. You can get to his 14all/mrtg/rrdtool web site here, and he can be reached by email here.
First of all, you must have a working MRTG configuration.
If not, don't even attempt to make this work. Having said that, let's
continue...
MAKE SURE YOU ARE USING PERL 5.6! You can get it from the ActiveState Web Site (www.activestate.com). Install it, and proceed to the next step.
Download and install RRDTool. You can get it at the RRDTool Web Site (http://rrdtool.eu.org).
Once RRDTool has been installed, open an OS prompt and change directory to the X:\rrdtool\perl-shared directory. Then run "ppm install rrds.ppd" (omit the " "). A sucessfull install will generate several lines of informational messages.
Modify your MRTG config file(s) to include the
following text (substitute path with an appropriate path for your environment). I
put it just underneath the WorkDir and IconDir option settings.
# START RDTOOL Add-ons -------------------------------------
# Modify Logfiles (*.log) to RRD format (*.rrd)
LogFormat: rrdtool
# RRD Executable (rrdtool.exe) location
PathAdd: d:/rrdtool/perl-shared/t
# RRD Perl module (RRDs.pm) location
LibAdd: d:/rrdtool/perl-shared
# STOP RDTOOL Add-ons -------------------------------------
These instructions should get you through configuring IIS 4/5 or PWS to run 14all.cgi.
Stop the Web Service (Web Site (right-click)/Stop).
Map applications to file types.
- Web Site (right-click)/Properties/Home Directory (tab)/Application
Settings/Configuration (button) you must make changes to the application mappings like
so..
- assign drive:/path/perl.exe %s %s to .pl
- assign drive:/path/perl.exe %s %s to .cgi
- assign drive:/path/rrd_cgi.exe %s %s to .rrdcgi
Start the Web Service (Web Site
(right-click)/Start).
- This sets PERL to execute locally whenever an app with those extensions is selected by a
(web client).
Modify your web server so that the CGI-BIN directory (or wherever you put 14all.cgi) has EXECUTE permissions.
Select your CGI-BIN directory, then right click properties, and make sure Execute (including script) is selected.
Check user permissions for NT. Make sure your Anonymous Web User account has the appropriate permissions in the CGI-BIN directory to execute. This can be done in either Explorer or File Manager (if you still use it!)
Here's where you have several options. I will outline
what I have done.
I have a MRTG config (PC616083_SERVER.CFG) file for a device with several OIDs inside it.
So, I rename 14all.cgi to match the name of my mrtg config file (PC616083_SERVER.CGI).
Edit 14all.cgi (or whatever your file name) and
change the lines like so ...
- On line 13, make it say...
use lib qw(d:/mrtg/lib/mrtg2); (set paths
appropriately)
- One lines 44-54, change them like so ... (again, change the paths to your config)
### where the mrtg.cfg file is
# anywhere in the filespace
$cfgfile = 'd:/systap/cfg/servers/pc616083/pc616083_server.cfg';
# relative to the script
# $cfgfile = 'mrtg.cfg';
# use this so 14all.cgi gets the cfgfile name from the script name
# (14all.cgi -> 14all.cfg)
# $cfgfile = '';
# if you want to store your config files in a different place than your cgis:
# $cfgfiledir = 'd:/systap/cfg';
Save the file. If you want to test it, then open a CMD prompt in the CGI-BIN directory, and run "perl 14all.cgi" (our whatever you called it, omitting the " ") you should see a screen full of html text. That indicates that 14all.cgi is reading the Config file, finding the filename.rrd and generating HTML.
Check out your CGI with a browser (http://ipaddress/[dir]/filename.cgi)
I wrote this page for the same reason I have written everything else here. It allows me to gain a better understanding, and allows me to share my work with others. As always, please send me an email if you have comments or questions. Remember, I wrote this page and all the text on it, so if there are problems do not contact Rainer or Tobi!
Check out the RRDTool Front End Page here.
To return the the main page, click the
logo!