1MRTG(1) mrtg MRTG(1)
2
3
4
6 mrtg - What is MRTG ?
7
9 The Multi Router Traffic Grapher (MRTG) is a tool to monitor the
10 traffic load on network links. MRTG generates HTML pages containing
11 PNG images which provide a LIVE visual representation of this traffic.
12
13 Go to http://oss.oetiker.ch/mrtg for all the details about mrtg.
14
16 Portable
17 MRTG works on most UNIX platforms and Windows NT.
18
19 Perl
20 MRTG is written in Perl and comes with full source.
21
22 Portable SNMP
23 MRTG Uses a highly portable SNMP implementation written entirely in
24 Perl (thanks to Simon Leinen). There is no need to install any
25 external SNMP package.
26
27 SNMPv2c support
28 MRTG can read the new SNMPv2c 64bit counters. No more counter
29 wrapping.
30
31 Reliable Interface Identification
32 Router interfaces can be identified by IP address, description and
33 ethernet address in addition to the normal interface number.
34
35 Constant size Logfiles
36 MRTG's logfiles do NOT grow thanks to the use of a unique data
37 consolidation algorithm.
38
39 Automatic Configuration
40 MRTG comes with a set of configuration tools which make
41 configuration and setup very simple.
42
43 Performance
44 Time critical routines are written in C (thanks to the initiative
45 of Dave Rand my Co-Author).
46
47 GIF free Graphics
48 Graphics are generated directly in PNG format using the GD library
49 by Thomas Boutell.
50
51 Customizability
52 The look of the webpages produced by MRTG is highly configurable.
53
54 RRDtool
55 MRTG has built-in hooks for using RRDtool. If you are strapped for
56 performance this may help.
57
59 MRTG consists of a Perl script which uses SNMP to read the traffic
60 counters of your routers and a fast C program which logs the traffic
61 data and creates beautiful graphs representing the traffic on the
62 monitored network connection. These graphs are embedded into webpages
63 which can be viewed from any modern Web-browser.
64
65 In addition to a detailed daily view, MRTG also creates visual
66 representations of the traffic seen during the last seven days, the
67 last five weeks and the last twelve months. This is possible because
68 MRTG keeps a log of all the data it has pulled from the router. This
69 log is automatically consolidated so that it does not grow over time,
70 but still contains all the relevant data for all the traffic seen over
71 the last two years. This is all performed in an efficient manner.
72 Therefore you can monitor 200 or more network links from any halfway
73 decent UNIX box.
74
75 MRTG is not limited to monitoring traffic, though. It is possible to
76 monitor any SNMP variable you choose. You can even use an external
77 program to gather the data which should be monitored via MRTG. People
78 are using MRTG, to monitor things such as System Load, Login Sessions,
79 Modem availability and more. MRTG even allows you to accumulate two or
80 more data sources into a single graph.
81
83 In 1994 I was working at a site where we had one 64kbit line to the
84 outside world. Obviously, everybody was interested in knowing how the
85 link was performing. So I wrote a quick hack which created a constantly
86 updated graph on the web that showed the traffic load on our Internet
87 link. This eventually evolved into a rather configurable Perl script
88 called MRTG-1.0 which I released in spring 1995. After a few updates, I
89 left my job at DMU to start work at the Swiss Federal Institute of
90 Technology. Due to lack of time I had to put MRTG aside. One day in
91 January of 1996, I received email from Dave Rand asking if I had any
92 ideas why MRTG was so slow. Actually, I did. MRTG's programming was not
93 very efficient and it was written entirely in Perl. After a week or so,
94 Dave wrote back to me and said he had tried what I had suggested for
95 improving MRTG's speed. Since the changes did not help much, he had
96 decided to rewrite the time-critical sections of MRTG in C. The code
97 was attached to his email. His tool increased the speed of MRTG by a
98 factor of 40! This got me out of my 'MRTG ignorance' and I started to
99 spend my spare time developing of MRTG-2.
100
101 Soon after MRTG-2 development had begun I started to give beta copies
102 to interested parties. In return I got many feature patches, a lot of
103 user feedback and bug fixes. The product you are getting now wouldn't
104 be in this state if it hadn't been for the great contributions and
105 support I received from of many people. I would like to take this
106 opportunity to thank them all. (See the files CHANGES for a long list
107 of folk people who helped to make MRTG what it is today.)
108
110 Mrtg is also the name of the script you have to run to poll data and
111 generate the graphs. Most configuration is set through the
112 configuration file; some command-line options exist all the same.
113
114 --user username and --group groupname
115 Run as the given user and/or group. (Unix Only)
116
117 --lock-file filename
118 Use an alternate lock-file (the default is to use the
119 configuration-file appended with "_l").
120
121 --confcache-file filename
122 Use an alternate confcache-file (the default is to use the
123 configuration-file appended with ".ok")
124
125 --logging filename|eventlog
126 If this is set to writable filename, all output from mrtg
127 (warnings, debug messages, errors) will go to filename. If you are
128 running on Win32 you can specify eventlog instead of a filename
129 which will send all error to the windows event log.
130
131 NOTE:Note, there is no Message DLL for mrtg. This has the side
132 effect that the windows event logger will display a nice message
133 with every entry in the event log, complaing about the fact that
134 mrtg has no message dll. If any of the Windows folks want to
135 contribute one, they are welcome.
136
137 --daemon
138 Put MRTG into the background, running as a daemon. This works the
139 same way as the config file option, but the switch is required for
140 proper FHS operation (because /var/run is writable only by root)
141
142 --fhs
143 Configure all mrtg paths to conform to the FHS specification
144 <http://www.pathname.com/fhs/>. The following default values are
145 assumed:
146
147 confcachefile - /var/cache/mrtg/mrtg.ok
148 pid-file - /var/run/mrtg.pid
149 lock-file - /var/cache/mrtg/mrtg.lck
150 log-file - /var/log/mrtg.log
151
152 --check
153 Only check the cfg file for errors. Do not do anything.
154
155 --pid-file=s
156 Define the name and path of the pid file for mrtg running as a
157 daemon
158
159 --log-only
160 Only update the logfile, do not produce graphics or html pages
161
162 --debug=s
163 Enable debug options. The argument of the debug option is a comma
164 separated list of debug values:
165
166 cfg - watch the config file reading
167 dir - directory mangeling
168 base - basic program flow
169 tarp - target parser
170 snpo - snmp polling
171 fork - forking view
172 time - some timing info
173 log - logging of data via rateup or rrdtool
174
175 Example:
176
177 --debug="cfg,snpo"
178
180 Learn more about MRTG by going to the mrtg home page on:
181 http://oss.oetiker.ch/mrtg
182
184 Tobias Oetiker <tobi@oetiker.ch> and many contributors
185
186
187
1882.17.7 2018-07-13 MRTG(1)