mrtg-rrd - How to use RRDtool with MRTG
SYNOPSIS
After using MRTG for some time you may find some limita
tions. Mostly in the areas of performance and graphing
flexibility. These are exactly the areas addressed by rrd
tool. To learn more about RRDtool check out its website on
http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool
RRDTOOL INTEGRATION
When using mrtg with RRDtool you are replacing rateup with
the RRDtool perl modlue RRDs.pm. To enable RRDtool support
in mrtg you have to add the line
LogFormat: rrdtool
MRTG needs access to both the RRDtool perl module RRDs.pm
and to the rrdtool executable.
If these two items are not installed in locations where
perl can find them on its own, then you can use the fol
lowing two parameters to supply the appropriate directo
ries.
For the location of the rrdtool executable you put
PathAdd: /usr/local/rrdtool/bin/
or
PathAdd: c:\rrdtool\bin
For the location of the perl module it would be:
LibAdd: /usr/local/rrdtool/lib/perl/
or
LibAdd: c:\rrdtool\bin\lib\perl
When you have made this modification to the configuration
file, several things will happen when you run mrtg again
with the new config file:
1. mrtg will take all your old `.log' files and convert
them to `.rrd' format. (The `.log' files don't get
touched in the process, so if things don't work out
they are still there.)
2. mrtg will use rrdtool to update its databases. These
will have a new format called rrd which is totally
mrtg.
3. mrtg will not create any webpages of graphs anymore.
It will only query the routers for traffic information
and update its rrd databases.
The advantage of whole thing is that the mrtg will become
much faster. Expect the runtime to drop to 20% of the pre
vious value. (I would like to get some feedback on this
from folks with large installations)
Mind you though, while the logging process of RRDtool is
very fast, you are also gaining some time by neither cre
ating graphs nor updating webpages. The idea behind this
is that it is more efficient to create graphs and webpages
on demmand. Using a cgi script.
At the moment there is no official script to do this, but
two contributers have created such scripts:
14all.cgi
Was the first program to take over the webpage cre
ation and graphing task. It has been developed by
Rainer Bawidamann <Rainer.Bawidamann@informatik.uni-
ulm.de>. You can find a copy on Rainers website:
http://www.uni-ulm.de/~rbawidam/mrtg-rrd/
The program comes with its own documentation
routers.cgi
Is another cgi frontend to mrtg running with rrdtool.
Its main difference to 14all is that the web pages it
creates are much more stylish than the ones from mrtg.
routers.cgi has been written by
Steve Shipway <steve.shipway@adsweu.com>. You can find
a copy in
mrtg-2.9.6/contrib/routers
The script comes with its own installation instruc
tions.
A sample website showing off routers.cgi can be found
on
http://ukpavu99.adsweu.com/cgi-bin/routers.cgi
FUTURE
Just as a side note: MRTG-3 will be based entirely on rrd
tool technology. But don't wait for it ... get going now!
Tobias Oetiker <oetiker@ee.ethz.ch>
Man(1) output converted with
man2html