MRTG-RRD(1)

πŸ“¦
version 2.17.10 Β· 2 versions
  • 2.17.10 Β· alpine 3.22, alpine 3.23, alpine 3.24, centos-stream 10, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 2.17.7 Β· centos-stream 9
, in alpine 3.22, alpine 3.23, alpine 3.24, centos-stream 10, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– MRTG-RRD πŸ’–

okay bestie, gather round, because this is the glow-up era of your monitoring setup ✨

🌸 NAME 🌸

mrtg-rrd β€” literally just: how to use RRDtool with MRTG. that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

so you've been running MRTG for a minute, and ngl, you've probably started bumping into some limitations β€” mostly in the performance department and in how flexible your graphing can be. and it's giving… restrictive. 😭

and guess what? those are exactly the two areas RRDtool was built to fix. πŸ’…

wanna learn more about RRDtool? go touch grass on its website:

http://oss.oetiker.ch/rrdtool

πŸ‘‘ RRDTOOL INTEGRATION πŸ‘‘

okay so here's the tea: when you run mrtg with RRDtool, what you're actually doing is replacing rateup with the RRDtool perl module, RRDs.pm. iconic swap, no cap.

to turn on RRDtool support in mrtg, you gotta add this line:

LogFormat: rrdtool

…to your mrtg config file. that's it. that's the whole gate key. πŸ”‘

now, MRTG needs access to both the RRDtool perl module RRDs.pm and the rrdtool executable. both of them. like a duo. 🫢

if those two little guys aren't installed somewhere perl can find them on its own, no worries β€” you've got two parameters to point at the right directories:

for the location of the rrdtool executable you put:

PathAdd: /usr/local/rrdtool/bin/

or:

PathAdd: c:\rrdtool\bin

and for the location of the perl module it would be:

LibAdd: /usr/local/rrdtool/lib/perl/

or:

LibAdd: c:\rrdtool\bin\lib\perl

✨ the moment you run mrtg again with the new config ✨

once you've made that modification to the config file, several things will happen when you run mrtg again. buckle up:

  1. mrtg will take all your old ".log" files and convert them to ".rrd" format. and bestie, breathe β€” the ".log" files don't get touched in the process, so if things don't work out they are still there. safety net secured. πŸ™ˆ
  2. mrtg will use rrdtool to update its databases. these get a whole new format called rrd which is totally different than the native log format of the classic mrtg. it's giving rebrand.
  3. mrtg will not create any webpages of graphs anymore. it will only query the routers for traffic information and update its rrd databases. no graph duty, just data duty. πŸ’…

🌈 the payoff 🌈

the advantage of the whole thing is that mrtg becomes much faster. expect the runtime to drop to 20% of the previous value. (and the author literally says: "I would like to get some feedback on this from folks with large installations." β€” so if that's you, speak up! πŸ“£)

mind you, though β€” while the logging process of RRDtool is very fast, you're also gaining some time by neither creating graphs nor updating webpages. so it's a two-for-one slay. πŸ‘‘

the idea behind all this is that it's more efficient to create graphs and webpages on demand by using a cgi script. on demand. when you want it. main character energy. ⭐


πŸŽ€ the cgi scripts (no official one yet, but…) πŸŽ€

at the moment there is no official script to do this β€” BUT, two contributors have created such scripts. and here they are, in all their glory:

  • One4All aka 14all.cgi β€” this was the first program to take over the webpage creation and graphing task. it has been developed by Rainer Bawidamann rainer.bawidamann@web.de. you can find a copy on Rainers website: http://my14all.sourceforge.net/ β€” the program comes with its own documentation. πŸ“š
  • routers2.cgi β€” this is another CGI frontend for mrtg running with rrdtool. the main difference between this and 14all is that the web pages it creates are much more stylish than the ones from mrtg, plus they support User Defined summary graphs and different levels of Authentication and Authorisation. this has been written by Steve Shipway (steve@steveshipway.org). you obtain a copy, and find a forum and demonstration system at http://www.steveshipway.org/software/ β€” the program comes with its own installation instructions and install script. πŸ”₯
  • mrtg-rrd β€” the mrtg-rrd script is a CGI/FastCGI application by Jan "Yenya" Kasprzak for displaying MRTG graphs from data in the RRDtool format. it is an intended replacement for the 14all.cgi script. it can make your monitoring system faster because MRTG does not have to generate all the PNG files with graphs every 5 minutes or so. instead of this, the graphs are generated on-demand when the user wants to see them. http://www.fi.muni.cz/~kas/mrtg-rrd/ β€” obsessed. πŸ¦‹

⭐ FUTURE ⭐

just as a side note, bestie: MRTG-3 will be based entirely on rrdtool technology. πŸ‘‘

but don't wait for it… get going now! πŸƒβ™€οΈπŸ’¨


πŸ’œ AUTHOR πŸ’œ

Tobias Oetiker <tobi@oetiker.ch>


and that's the whole page, babe. this gem is version 2.17.10, dated 2022-01-19, and it lives in the MRTG-RRD(1) manual. mwah. πŸ’–βœ¨πŸŽ€