MRTG(1)
๐ MRTG โ what even IS it?? ๐
okay bestie, sit down, hydrate, because i'm about to tell you about mrtg, aka the manual page mrtg from section 1 of your man pages. yes, the traffic grapher. no, it's not boring, it's iconic. ๐ฆ
โจ NAME โจ
mrtg โ What is MRTG ? ๐
๐ธ DESCRIPTION ๐ธ
The Multi Router Traffic Grapher (aka MRTG, aka the moment) is a tool that monitors the traffic load on network links. MRTG generates HTML pages stuffed with PNG images that give you a LIVE visual representation of that traffic. not a screenshot, not a vibe, a LIVE one. ๐
Go to http://oss.oetiker.ch/mrtg for all the details about mrtg, fr fr.
๐ฅ HIGHLIGHTS ๐ฅ
๐ Portable
MRTG works on most UNIX platforms and Windows NT. it's giving adaptable.
๐ Perl
MRTG is written in Perl and comes with full source. the source is right there. ๐ซถ
๐ง Portable SNMP
MRTG uses a highly portable SNMP implementation written entirely in Perl (thanks to Simon Leinen). There is no need to install any external SNMP package. none. zero. you're welcome.
โญ SNMPv2c support
MRTG can read the new SNMPv2c 64bit counters. No more counter wrapping. we love to see it.
๐ Reliable Interface Identification
Router interfaces can be identified by IP address, description and ethernet address in addition to the normal interface number. so many ways to say "that one". ๐
๐ฆ Constant size Logfiles
MRTG's logfiles do NOT grow thanks to the use of a unique data consolidation algorithm. it stays small, it stays cute.
โจ Automatic Configuration
MRTG comes with a set of configuration tools which make configuration and setup very simple. lowkey effortless.
๐ฅ Performance
Time critical routines are written in C (thanks to the initiative of Dave Rand my Co-Author). speed. ๐จ
๐ GIF free Graphics
Graphics are generated directly in PNG format using the GD library by Thomas Boutell. no GIFs were harmed.
๐ธ Customizability
The look of the webpages produced by MRTG is highly configurable. make it yours.
๐ RRDtool
MRTG has built-in hooks for using RRDtool. If you are strapped for performance this may help.
๐ DETAILS ๐
MRTG consists of a Perl script which uses SNMP to read the traffic counters of your routers and a fast C program which logs the traffic data and creates beautiful graphs representing the traffic on the monitored network connection. These graphs are embedded into webpages which can be viewed from any modern Web-browser. so, like, any browser. ๐
In addition to a detailed daily view, MRTG also creates visual representations of the traffic seen during the last seven days, the last five weeks and the last twelve months. This is possible because MRTG keeps a log of all the data it has pulled from the router. This log is automatically consolidated so that it does not grow over time, but still contains all the relevant data for all the traffic seen over the last two years. This is all performed in an efficient manner. Therefore you can monitor 200 or more network links from any halfway decent UNIX box. two hundred. two hundred. ๐คฏ
MRTG is not limited to monitoring traffic, though. It is possible to monitor any SNMP variable you choose. You can even use an external program to gather the data which should be monitored via MRTG. People are using MRTG, to monitor things such as System Load, Login Sessions, Modem availability and more. MRTG even allows you to accumulate two or more data sources into a single graph. the range?? unmatched. ๐
๐ HISTORY ๐
In 1994 I was working at a site where we had one 64kbit line to the outside world. Obviously, everybody was interested in knowing how the link was performing. So I wrote a quick hack which created a constantly updated graph on the web that showed the traffic load on our Internet link. This eventually evolved into a rather configurable Perl script called MRTG-1.0 which I released in spring 1995. After a few updates, I left my job at DMU to start work at the Swiss Federal Institute of Technology. Due to lack of time I had to put MRTG aside. One day in January of 1996, I received email from Dave Rand asking if I had any ideas why MRTG was so slow. Actually, I did. MRTG's programming was not very efficient and it was written entirely in Perl. After a week or so, Dave wrote back to me and said he had tried what I had suggested for improving MRTG's speed. Since the changes did not help much, he had decided to rewrite the time-critical sections of MRTG in C. The code was attached to his email. His tool increased the speed of MRTG by a factor of 40! This got me out of my 'MRTG ignorance' and I started to spend my spare time developing of MRTG-2. forty times faster. forty. ๐ญ๐ฅ
Soon after MRTG-2 development had begun I started to give beta copies to interested parties. In return I got many feature patches, a lot of user feedback and bug fixes. The product you are getting now wouldn't be in this state if it hadn't been for the great contributions and support I received from of many people. I would like to take this opportunity to thank them all. (See the files CHANGES for a long list of folk people who helped to make MRTG what it is today.) ๐ซถ
๐ Command-line ๐
Mrtg is also the name of the script you have to run to poll data and generate the graphs. Most configuration is set through the configuration file; some command-line options exist all the same. iykyk. โจ
--user usernameand--group groupnameโ Run as the given user and/or group. (Unix Only)--lock-file filenameโ Use an alternate lock-file (the default is to use the configuration-file appended with"_l").--confcache-file filenameโ Use an alternate confcache-file (the default is to use the configuration-file appended with".ok")--logging filename|eventlogโ If this is set to writable filename, all output from mrtg (warnings, debug messages, errors) will go to filename. If you are running on Win32 you can specifyeventloginstead of a filename which will send all error to the windows event log.
NOTE: Note, there is no Message DLL for mrtg. This has the side effect that the windows event logger will display a nice message with every entry in the event log, complaining about the fact that mrtg has no message dll. If any of the Windows folks want to contribute one, they are welcome. ๐ (pls help them out if you're a Windows person, they're asking nicely)
--daemonโ Put MRTG into the background, running as a daemon. This works the same way as the config file option, but the switch is required for proper FHS operation (because/var/runis writable only by root)--fhsโ Configure all mrtg paths to conform to the FHS specification <http://www.pathname.com/fhs/>. The following default values are assumed:
confcachefile - /var/lib/mrtg/mrtg.ok
pid-file - /run/mrtg/mrtg.pid
lock-file - /var/lock/mrtg/mrtg.lck
log-file - /var/log/mrtg/mrtg.log
--checkโ Only check the cfg file for errors. Do not do anything.--pid-file=sโ Define the name and path of the pid file for mrtg running as a daemon--log-onlyโ Only update the logfile, do not produce graphics or html pages--debug=sโ Enable debug options. The argument of the debug option is a comma separated list of debug values:
cfg - watch the config file reading
dir - directory mangeling
base - basic program flow
tarp - target parser
snpo - snmp polling
fork - forking view
time - some timing info
log - logging of data via rateup or rrdtool
Example:
--debug="cfg,snpo"
๐ READ ON ๐
Learn more about MRTG by going to the mrtg home page on: http://oss.oetiker.ch/mrtg
๐ AUTHOR ๐
Tobias Oetiker <tobi@oetiker.ch> and many contributors
and that's the whole page bestie, you ate it all up. this was MRTG(1), version 2.17.10, dated 2022-01-19, from the mrtg manual. go monitor something pretty. periodt. ๐
โจ๐
๐ฆ where this page comes from
- alpine 3.22: mrtg-doc 2.17.10-r1 ยท GPL-2.0-or-later
- alpine 3.23: mrtg-doc 2.17.10-r1 ยท GPL-2.0-or-later
- alpine 3.24: mrtg-doc 2.17.10-r2 ยท GPL-2.0-or-later
- centos-stream 10: mrtg 2.17.10-13.el10 ยท GPL-2.0-or-later
- debian bookworm: mrtg 2.17.10-5+deb12u2 ยท GPL-2.0-or-later
- debian trixie: mrtg 2.17.10-13+deb13u2 ยท GPL-2.0-or-later
- fedora 43: mrtg 2.17.10-12.fc43 ยท GPL-2.0-or-later
- fedora 43: mrtg 2.17.10-13.fc43 ยท GPL-2.0-or-later
- fedora 44: mrtg 2.17.10-13.fc44 ยท GPL-2.0-or-later
- fedora 44: mrtg 2.17.10-14.fc44 ยท GPL-2.0-or-later
- nixos 26.05: mrtg 2.17.10
- nixpkgs unstable: mrtg 2.17.10
- ubuntu jammy: mrtg 2.17.10-3 ยท GPL-2.0-or-later
- ubuntu noble: mrtg 2.17.10-12 ยท GPL-2.0-or-later
- ubuntu questing: mrtg 2.17.10-13
- ubuntu resolute: mrtg 2.17.10-14 ยท GPL-2.0-or-later
- ubuntu stonking: mrtg 2.17.10-16 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms