The 1 Minute MRTG Patches

v1, 07/2001

SYNOPSIS


The 1 minute MRTG patches allow MRTG to work with 1 minute updates, instead of the hardcoded 5 minutes. Not only the updating system (cron in my case) has to run every minute, but a few things have to be modified here and there so; so that the generated graphs and webpage follow the 1 minute rythme.

It's allready heavy enough to generate images every 5 minutes. For 1 minute updates, RRDtool is a must. These patchs apply to MRTG using RRDtool to store values. It hasn't been tested, and will probabily not work with rateup. It's fairly easy to run MRTG with RRDtool, check out the: MRTG and RRD tool document for a quick how-to, it's located on the MRTG website.

WHY ?


While setting up MRTG to monitor the usage on a high bandwidth research network, it quickly came out that MRTG's default 5 minute update was just to low for us; for a few reasons:

HOW IT'S DONE


Mainly two files from the MRTG distribution have been modified to enable 5 minute updates: the mrtg Perl script itself and the MRTG Perl module (MRTG_lib.pm).

Modification summary: The 14all Perl CGI was also modified mainly for cosmetic reasons, to reflected the new retention values and also to show a one hour view (you can't see very well 1 minute stair cases on a daily view).

The following patches were made with the following versions of MRTG and 14all:

HOW TO APPLY THE PATCHES


These are just simple diffs. To patch the mrtg Perl script for example:
cd /opt/adm/mrtg/bin ; patch -p0 < patch-mrtg_2.9.17_1minute_interval.patch

Patch the 3 files: mrtg, MRTG_lib, 14all-1.1.cgi in the same maner on your local MRTG installation.
RRD databases MUST be re-created! If you used rateup, prior to patching, the text datafile will be nicelly injected in the new RRDs. If you were allready running the RRD tools prior to patching, delete your *.rrd files before re-running MRTG.

Finaly, set the interval to 1 in your mrtg.cfg file.

All is well and should run as before, in 1 minute intervals this time.

FOR Windows users:

Don't forget to adapt the patched 14all.cgi script with your parameters of your old script. (Like library location, configuration script location...).
[ tip from Mario, thanks Mario ;-) ]

TO DOWNLOAD

Get the file 1minMRTG-1.0.tar.gz, they contain all you need. I've also included the pre-patched files, for those great OS's lacking patch. A ZIP version is also available: 1minMRTG-1.0.zip

Seperately, you can directly get the files.
You need those three files too start playing. These are seperate diffs for each of the files: You can get the great MRTG from (the even greater) Tobi Oetiker's site:
 http://people.ee.ethz.ch/~oetiker/webtools/mrtg
You can get 14all from here: http://www.uni-ulm.de/~rbawidam/mrtg-rrd


SUPPORT


I will try to offer as much support as I can on these patches. I am aware that their implemetation is not much documented and fast. I can at least do my best to help by e-mail. Please let me know if this document lacks tips or todo's. As of today, consider those patches supported.

You should note that I've dropped MRTG on some of my production environment very recently (1/2002) to switch to Cricket ( http://cricket.sourceforge.net), who is easier to switch to 1 minute updates and configuration for weird setups like mine. I'm still using the patched MRTG in my backoffice, MRTG rules !


CREDITS


July 2001 Nicolas Sayer <Nick@loplop.net >, under contract with INRIA / DirDRI / VTHD
Thanks again, Tobi, for this great one. I have to admit that I'm more of an RRD fan than an MRTG one...