1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
|
MRTG(1) mrtg MRTG(1)
NNAAMMEE
mrtg - What is MRTG ?
DDEESSCCRRIIPPTTIIOONN
The Multi Router Traffic Grapher (MRTG) is a tool to moni-
tor the traffic load on network links. MRTG generates
HTML pages containing PNG images which provide a LIVE
visual representation of this traffic. Check
http://www.stat.ee.ethz.ch/mrtg/ to see what it does.
Go to
http://oss.oetiker.ch/mrtg for all the details about
mrtg.
HHIIGGHHLLIIGGHHTTSS
Portable
MRTG works on most UNIX platforms and Windows NT.
Perl
MRTG is written in Perl and comes with full source.
Portable SNMP
MRTG Uses a highly portable SNMP implementation writ-
ten entirely in Perl (thanks to Simon Leinen). There
is no need to install any external SNMP package.
SNMPv2c support
MRTG can read the new SNMPv2c 64bit counters. No more
counter wrapping.
Reliable Interface Identification
Router interfaces can be identified by IP address,
description and ethernet address in addition to the
normal interface number.
Constant size Logfiles
MRTG's logfiles do NOT grow thanks to the use of a
unique data consolidation algorithm.
Automatic Configuration
MRTG comes with a set of configuration tools which
make configuration and setup very simple.
Performance
Time critical routines are written in C (thanks to the
initiative of Dave Rand my Co-Author).
GIF free Graphics
Graphics are generated directly in PNG format using
the GD library by Thomas Boutell.
Customizability
The look of the webpages produced by MRTG is highly
configurable.
RRDtool
MRTG has built-in hooks for using RRDtool. If you are
strapped for performance this may help.
DDEETTAAIILLSS
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 connec-
tion. These graphs are embedded into webpages which can be
viewed from any modern Web-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 auto-
matically consolidated so that it does not grow over time,
but still contains all the relevant data for all the traf-
fic 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.
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.
HHIISSTTOORRYY
In 1994 I was working at a site where we had one 64kbit
line to the outside world. Obviously, everybody was inter-
ested 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.
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.)
CCoommmmaanndd--lliinnee
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.
----uusseerr _u_s_e_r_n_a_m_e and ----ggrroouupp _g_r_o_u_p_n_a_m_e
Run as the given user and/or group. (Unix Only)
----lloocckk--ffiillee _f_i_l_e_n_a_m_e
Use an alternate lock-file (the default is to use the
configuration-file appended with "_l").
----ccoonnffccaacchhee--ffiillee _f_i_l_e_n_a_m_e
Use an alternate confcache-file (the default is to use
the configuration-file appended with ".ok")
----llooggggiinngg _f_i_l_e_n_a_m_e|eevveennttlloogg
If this is set to writable filename, all output from
mrtg (warnings, debug messages, errors) will go to
_f_i_l_e_n_a_m_e. If you are running on Win32 you can specify
eevveennttlloogg instead of a filename which will send all
error to the windows event log.
NNOOTTEE::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, complaing about the fact that mrtg has no message
dll. If any of the Windows folks want to contribute
one, they are welcome.
----ddaaeemmoonn
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/run is writable only by root)
----ffhhss
Configure all mrtg paths to conform to the FHS speci-
fication; http://www.pathname.com/fhs/
----cchheecckk
Only check the cfg file for errors. Do not do any-
thing.
----ppiidd--ffiillee==ss
Define the name and path of the pid file for mrtg run-
ning as a daemon
----lloogg--oonnllyy
Only update the logfile, do not produce graphics or
html pages
----ddeebbuugg==ss
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"
RREEAADD OONN
Learn more about MRTG by going to the mrtg home page on:
http://oss.oetiker.ch/mrtg
AAUUTTHHOORR
Tobias Oetiker <tobi@oetiker.ch> and many contributors
2.14.7 2006-09-06 MRTG(1)
|