1MRTG-REFERENCE(1) mrtg MRTG-REFERENCE(1)
2
3
4
6 mrtg-reference - MRTG 2.15.1 configuration reference
7
9 The runtime behaviour of MRTG is governed by a configuration file.
10 Run-of-the-mill configuration files can be generated with cfgmaker.
11 (Check cfgmaker). But for more elaborate configurations some hand-tun‐
12 ing is required.
13
14 This document describes all the configuration options understood by the
15 mrtg software.
16
18 MRTG configuration file syntax follows some simple rules:
19
20 · Keywords must start at the beginning of a line.
21
22 · Lines which follow a keyword line which start with a blank are
23 appended to the keyword line
24
25 · Empty Lines are ignored
26
27 · Lines starting with a # sign are comments.
28
29 · You can add other files into the configuration file using
30
31 Include: file
32
33 Example:
34
35 Include: base-options.inc
36
37 If included files are specified with relative paths, both the cur‐
38 rent working directory and the directory containing the main config
39 file will be searched for the files.
40
42 WorkDir
43
44 WorkDir specifies where the logfiles and the webpages should be cre‐
45 ated.
46
47 Example:
48
49 WorkDir: /usr/tardis/pub/www/stats/mrtg
50
52 HtmlDir
53
54 HtmlDir specifies the directory where the html (or shtml, but we'll get
55 on to those later) lives.
56
57 NOTE: Workdir overrides the settings for htmldir, imagedir and logdir.
58
59 Example:
60
61 Htmldir: /www/mrtg/
62
63 ImageDir
64
65 ImageDir specifies the directory where the images live. They should be
66 under the html directory.
67
68 Example:
69
70 Imagedir: /www/mrtg/images
71
72 LogDir
73
74 LogDir specifies the directory where the logs are stored. This need
75 not be under htmldir directive.
76
77 Example:
78
79 Logdir: /www/mrtg/logs
80
81 Forks (UNIX only)
82
83 With system that supports fork (UNIX for example), mrtg can fork itself
84 into multiple instances while it is acquiring data via snmp.
85
86 For situations with high latency or a great number of devices this will
87 speed things up considerably. It will not make things faster, though,
88 if you query a single switch sitting next door.
89
90 As far as I know NT can not fork so this option is not available on NT.
91
92 Example:
93
94 Forks: 4
95
96 EnableIPv6
97
98 When set to yes, IPv6 support is enabled if the required libraries are
99 present (see the mrtg-ipv6 manpage). When IPv6 is enabled, mrtg can
100 talk to routers using SNMP over IPv6 and targets may be specified by
101 their numeric IPv6 addresses as well as by hostname or IPv4 address.
102
103 If IPv6 is enabled and the target is a hostname, mrtg will try to
104 resolve the hostname to an IPv6 address and, if this fails, to an IPv4
105 address. Note that mrtg will only use IPv4 if you specify an IPv4
106 address or a hostname with no corresponding IPv6 address; it will not
107 fall back to IPv4 if it simply fails to communicate with the target
108 using IPv6. This is by design.
109
110 Note that many routers do not currently support SNMP over IPv6. Use the
111 IPv4Only per target option for these routers.
112
113 IPv6 is disabled by default.
114
115 Example:
116
117 EnableIPv6: Yes
118
119 EnableSnmpV3
120
121 When set to yes, uses the Net::SNMP module instead of the SNMP_SESSION
122 module for generating snmp queries. This allows the use of SNMPv3 if
123 other snmpv3 parameters are set.
124
125 SNMPv3 is disabled by default.
126
127 Example:
128
129 EnableSnmpV3: yes
130
131 Refresh
132
133 How many seconds apart should the browser (Netscape) be instructed to
134 reload the page? If this is not defined, the default is 300 seconds (5
135 minutes).
136
137 Example:
138
139 Refresh: 600
140
141 Interval
142
143 How often do you call mrtg? The default is 5 minutes. If you call it
144 less often, you should specify it here. This does two things:
145
146 · The generated HTML page contains the right information about the
147 calling interval ...
148
149 · A META header in the generated HTML page will instruct caches about
150 the time-to-live of this page .....
151
152 In this example, we tell mrtg that we will be calling it every 10 min‐
153 utes. If you are calling mrtg every 5 minutes, you can leave this line
154 commented out.
155
156 Example:
157
158 Interval: 10
159
160 Note that unless you are using rrdtool you can not set Interval to less
161 than 5 minutes. If you are using rrdtool you can set interval in the
162 format
163
164 Interval: MM[:SS]
165
166 Down to 1 second. Note though, setting the Interval for an rrdtool/mrtg
167 setup will influence the initial creation of the database. If you
168 change the interval later, all existing databases will remain at the
169 resolution they were initially created with. Also note that you must
170 make sure that your mrtg-rrd Web-frontend can deal with this kind of
171 Interval setting.
172
173 MaxAge
174
175 MRTG relies heavily on the real time clock of your computer. If the
176 time is set to a wrong value, especially if it is advanced far into the
177 future, this will cause mrtg to expire lots of supposedly old data from
178 the log files.
179
180 To prevent this, you can add a 'reasonability' check by specifying a
181 maximum age for log files. If a file seems to be older, mrtg will not
182 touch it but complain instead, giving you a chance to investigate the
183 cause.
184
185 Example:
186
187 MaxAge: 7200
188
189 The example above will make mrtg refuse to update log files older than
190 2 hours (7200 seconds).
191
192 WriteExpires
193
194 With this switch mrtg will generate .meta files for CERN and Apache
195 servers which contain Expiration tags for the html and gif files. The
196 *.meta files will be created in the same directory as the other files,
197 so you will have to set "MetaDir ." and "MetaFiles on" in your
198 apache.conf or .htaccess file for this to work
199
200 NOTE: If you are running Apache-1.2 or later, you can use the
201 mod_expire to achieve the same effect ... see the file htaccess.txt
202
203 Example:
204
205 WriteExpires: Yes
206
207 NoMib2
208
209 Normally we ask the SNMP device for 'sysUptime' and 'sysName' proper‐
210 ties. Some do not have these. If you want to avoid getting complaints
211 from mrtg about these missing properties, specify the nomib2 option.
212
213 An example of agents which do not implement base mib2 attributes are
214 Computer Associates - Unicenter TNG Agents. CA relies on using the
215 base OS SNMP agent in addition to its own agents to supplement the man‐
216 agement of a system.
217
218 Example:
219
220 NoMib2: Yes
221
222 SingleRequest
223
224 Some SNMP implementations can not deal with requests asking for multi‐
225 ple snmp variables in one go. Set this in your cfg file to force mrtg
226 to only ask for one variable per request.
227
228 Examples
229
230 SingleRequest: Yes
231
232 SnmpOptions
233
234 Apart from the per target timeout options, you can also configure the
235 behaviour of the snmpget process on a more profound level. SnmpOptions
236 accepts a hash of options. The following options are currently sup‐
237 ported:
238
239 timeout => $default_timeout,
240 retries => $default_retries,
241 backoff => $default_backoff,
242 default_max_repetitions => $max_repetitions,
243 use_16bit_request_ids => 1,
244 lenient_source_port_matching => 0,
245 lenient_source_address_matching => 1
246
247 The values behind the options indicate the current default value. Note
248 that these settings OVERRIDE the per target timeout settings.
249
250 A per-target SnmpOptions[] keyword will override the global settings.
251 That keyword is primarily for SNMPv3.
252
253 The 16bit request ids are the only way to query the broken SNMP imple‐
254 mentation of SMC Barricade routers.
255
256 Example:
257
258 SnmpOptions: retries => 2, only_ip_address_matching => 0
259
260 Note that AS/400 snmp seems to be broken in a way which prevents mrtg
261 from working with it unless
262
263 SnmpOptions: lenient_source_port_matching => 1
264
265 is set.
266
267 IconDir
268
269 If you want to keep the mrtg icons in someplace other than the working
270 (or imagedir) directory, use the IconDir variable for defining the url
271 of the icons directory.
272
273 Example:
274
275 IconDir: /mrtgicons/
276
277 LoadMIBs
278
279 Load the MIB file(s) specified and make its OIDs available as symbolic
280 names. For better efficiancy, a cache of MIBs is maintained in the
281 WorkDir.
282
283 Example:
284
285 LoadMIBs: /dept/net/mibs/netapp.mib,/usr/local/lib/ft100m.mib
286
287 Language
288
289 Switch output format to the selected Language (Check the translate
290 directory to see which languages are supported at the moment. In this
291 directory you can also find instructions on how to create new transla‐
292 tions).
293
294 Currently the following laguages are supported:
295
296 big5 brazilian bulgarian catalan chinese croatian czech danish dutch
297 eucjp french galician gb gb2312 german greek hungarian icelandic
298 indonesia iso2022jp italian korean lithuanian malay norwegian polish
299 portuguese romanian russian russian1251 serbian slovak slovenian span‐
300 ish swedish turkish ukrainian
301
302 Example:
303
304 Language: danish
305
306 LogFormat
307
308 Setting LogFormat to 'rrdtool' in your mrtg.cfg file enables rrdtool
309 mode. In rrdtool mode, mrtg relies on rrdtool to do its logging. See
310 mrtg-rrd.
311
312 Example:
313
314 LogFormat: rrdtool
315
316 LibAdd
317
318 If you are using rrdtool mode and your rrdtool Perl module (RRDs.pm) is
319 not installed in a location where perl can find it on its own, you can
320 use LibAdd to supply an appropriate path.
321
322 Example:
323
324 LibAdd: /usr/local/rrdtool/lib/perl/
325
326 PathAdd
327
328 If the rrdtool executable can not be found in the normal "PATH", you
329 can use this keyword to add a suitable directory to your path.
330
331 Example:
332
333 PathAdd: /usr/local/rrdtool/bin/
334
335 RunAsDaemon
336
337 The RunAsDaemon keyword enables daemon mode operation. The purpose of
338 daemon mode is that MRTG is launched once and not repeatedly (as it is
339 with cron). This behavior saves computing resourses as loading and
340 parsing of configuration files happens only once.
341
342 Using daemon mode MRTG itself is responible for timing the measurement
343 intervals. Therfore its important to set the Interval keyword to an
344 apropiate value.
345
346 Note that when using daemon mode MRTG should no longer be started from
347 cron as each new process runs forever. Instead MRTG should be started
348 from the command prompt or by a system startup script.
349
350 If you want mrtg to run under a particular user and group (it is not
351 recomended to run MRTG as root) then you can use the --user=user_name
352 and --group=group_name options on the mrtg commandline.
353
354 mrtg --user=mrtg_user --group=mrtg_group mrtg.cfg
355
356 Also note that in daemon mode restarting the process is required in
357 order to activate changes in the config file.
358
359 Under UNIX, the Daemon switch causes mrtg to fork into background after
360 checking its config file. On Windows NT the MRTG process will detach
361 from the console, but because the NT/2000 shell waits for its children
362 you have to use this special start sequence when you launch the pro‐
363 gram:
364
365 start /b perl mrtg mrtg.cfg
366
367 You may have to add path information equal to what you add when you run
368 mrtg from the commandline.
369
370 Example
371
372 RunAsDaemon: Yes
373 Interval: 5
374
375 This makes MRTG run as a daemon beginning data collection every 5 min‐
376 utes
377
378 If you are daemontools and still want to run mrtg as a daemon you can
379 additionally specify
380
381 NoDetach: Yes
382
383 this will make mrtg run but without detaching it from the terminal.
384
385 ConversionCode
386
387 Some devices may produce non-numeric values that would nevertheless be
388 useful to graph with MRTG if those values could be converted to num‐
389 bers. The ConversionCode keyword specifies the path to a file contain‐
390 ing Perl code to perform such conversions. The code in this file must
391 consist of one or more Perl subroutines. Each subroutine must accept a
392 single string argument and return a single numeric value. When RRDtool
393 is in use, a decimal value may be returned. When the name of one of
394 these subroutines is specified in a target definition (see below), MRTG
395 calls it twice for that target, once to convert the the input value
396 being monitored and a second time to convert the output value. The sub‐
397 routine must return an undefined value if the conversion fails. In case
398 of failure, a warning may be posted to the MRTG log file using Perl's
399 warn function. MRTG imports the subroutines into a separate name space
400 (package MRTGConversion), so the user need not worry about pollution of
401 MRTG's global name space. MRTG automatically prepends this package dec‐
402 laration to the user-supplied code.
403
404 Example: Suppose a particular OID returns a character string whose
405 length is proportional to the value to be monitored. To convert this
406 string to a number that can be graphed by MRTG, create a file arbitrar‐
407 ily named "MyConversions.pl" containing the following code:
408
409 # Return the length of the string argument
410 sub Length2Int {
411 my $value = shift;
412 return length( $value );
413 }
414
415 Then include the following global keyword in the MRTG configuration
416 file (assuming that the conversion code file is saved in the mrtg/bin
417 directory along with mrtg itself):
418
419 ConversionCode: MyConversions.pl
420
421 This will cause MRTG to include the definition of the subroutine
422 Length2Int in its execution environment. Length2Int can then be invoked
423 on any target by appending "⎪Length2Int" to the target definition as
424 follows:
425
426 Target[myrouter]: 1.3.6.1.4.1.999.1&1.3.6.1.4.1.999.1:public@mydevice⎪Length2Int
427
428 See "Extended Host Name Syntax" below for complete target definition
429 syntax information.
430
432 Each monitoring target must be identified by a unique name. This name
433 must be appended to each parameter belonging to the same target. The
434 name will also be used for naming the generated webpages, logfiles and
435 images for this target.
436
437 Target
438
439 With the Target keyword you tell mrtg what it should monitor. The Tar‐
440 get keyword takes arguments in a wide range of formats:
441
442 Basic
443 The most basic format is "port:community@router" This will generate
444 a traffic graph for the interface 'port' of the host 'router' (dns
445 name or IP address) and it will use the community 'community' (snmp
446 password) for the snmp query.
447
448 Example:
449
450 Target[myrouter]: 2:public@wellfleet-fddi.domain
451
452 If your community contains a "@" or a " " these characters must be
453 escaped with a "\".
454
455 Target[bla]: 2:stu\ pi\@d@router
456
457 SNMPv2c
458 If you have a fast router you might want to try to poll the ifHC*
459 counters. This feature gets activated by switching to SNMPv2c.
460 Unfortunately not all devices support SNMPv2c yet. If it works,
461 this will prevent your counters from wraping within the 5 minute
462 polling interval, since we now use 64 bit instead of the normal 32
463 bit.
464
465 Example:
466
467 Target[myrouter]: 2:public@router1:::::2
468
469 SNMPv3
470 As an alternative to SNMPv2c, SNMPv3 provides access to the ifHC*
471 counters, along with encryption. Not all devices support SNMPv3,
472 and you will also need the perl Net::SNMP library in order to use
473 it. It is recommended that cfgmaker be used to generate configura‐
474 tions involving SNMPv3, as it will check if the Net::SNMP library
475 is loadable, and will switch to SNMPv2c if v3 is unavailable.
476
477 SNMP v3 requires additional authentication parameters, passed using
478 the SnmpOptions[] per-target keyword.
479
480 Example:
481 Target[myrouter]: 2:router1:::::3
482 SnmpOptions[myrouter]: username=>'user1'
483
484 Reversing
485 Sometimes you are sitting on the wrong side of the link, and you
486 would like to have mrtg report Incoming traffic as Outgoing and
487 vice versa. This can be achieved by adding the '-' sign in front of
488 the "Target" description. It flips the incoming and outgoing traf‐
489 fic rates.
490
491 Example:
492
493 Target[ezci]: -1:public@ezci-ether.domain
494
495 Explicit OIDs
496 You can also explicitly define which OID to query by using the fol‐
497 lowing syntax 'OID_1&OID_2:community@router' The following example
498 will retrieve error counts for input and output on interface 1.
499 MRTG needs to graph two variables, so you need to specify two OID's
500 such as temperature and humidity or error input and error output.
501
502 Example:
503
504 Target[myrouter]: 1.3.6.1.2.1.2.2.1.14.1&1.3.6.1.2.1.2.2.1.20.1:public@myrouter
505
506 MIB Variables
507 MRTG knows a number of symbolic SNMP variable names. See the file
508 mibhelp.txt for a list of known names. One example are the ifIn‐
509 Errors and ifOutErrors. This means you can specify the above as:
510
511 Example:
512
513 Target[myrouter]: ifInErrors.1&ifOutErrors.1:public@myrouter
514
515 SnmpWalk
516 It may be that you want to monitor an snmp object that is only
517 reachable by 'walking'. You can get mrtg to walk by prepending the
518 OID with the string WaLK or if you want a particular entry from the
519 table returned by the walk you can use WaLKx where x is a number
520 starting from 0 (!).
521
522 Example:
523
524 Target[myrouter]: WaLKstrangeOid.1&WaLKstrangeOid.2:public@myrouter
525
526 Target[myrouter]: WaLK3strangeOid.1&WaLK4strangeOid.2:public@myrouter
527
528 Interface by IP
529 Sometimes SNMP interface index can change, like when new interfaces
530 are added or removed. This can cause all Target entries in your
531 config file to become offset, causing MRTG to graphs wrong
532 instances etc. MRTG supports IP address instead of ifindex in tar‐
533 get definition. Then MRTG will query snmp device and try to map IP
534 address to the current ifindex. You can use IP addresses in every
535 type of target definition by adding IP address of the numbered
536 interface after OID and separation char '/'.
537
538 Make sure that the given IP address is used on your same target
539 router, especially when graphing two different OIDs and/or inter‐
540 face split by '&' delimiter.
541
542 You can tell cfgmaker to generate such references with the option
543 --ifref=ip.
544
545 Example:
546
547 Target[myrouter]: /1.2.3.4:public@wellfleet-fddi.domain
548 Target[ezci]: -/1.2.3.4:public@ezci-ether.domain
549 Target[myrouter]: 1.3.6.1.2.1.2.2.1.14/1.2.3.4&1.3.6.1.2.1.2.2.1.14/1.2.3.4:public@myrouter
550 Target[myrouter]: ifInErrors/1.2.3.4&ifOutErrors/1.2.3.4:public@myrouter
551
552 Interface by Description
553 If you can not use IP addresses you might want to use the interface
554 names. This works similar to the IP address aproach except that the
555 prefix to use is a \ instead of a /
556
557 You can tell cfgmaker to generate such references with the option
558 --ifref=descr.
559
560 Example:
561
562 Target[myrouter]: \My-Interface2:public@wellfleet-fddi.domain
563 Target[ezci]: -\My-Interface2:public@ezci-ether.domain
564 Target[myrouter]: 1.3.6.1.2.1.2.2.1.14\My-Interface2&1.3.6.1.2.1.2.2.1.14\My-Interface3:public@myrouter
565 Target[myrouter]: ifInErrors\My-Interface2&ifOutErrors\My-Interface3:public@myrouter
566
567 If your description contains a "&", a ":", a "@" or a " " you can
568 include them but you must escape with a backlash:
569
570 Target[myrouter]: \fun\:\ ney\&ddd:public@hello.router
571
572 Interface by Name
573 This is the only sensible way to reference the interfaces of your
574 switches.
575
576 You can tell cfgmaker to generate such references with the option
577 --ifref=name.
578
579 Example:
580
581 Target[myrouter]: #2/11:public@wellfleet-fddi.domain
582 Target[ezci]: -#2/11:public@ezci-ether.domain
583 Target[myrouter]: 1.3.6.1.2.1.2.2.1.14#3/7&1.3.6.1.2.1.2.2.1.14#3/7:public@myrouter
584 Target[myrouter]: ifInErrors#3/7&ifOutErrors#3/7:public@myrouter
585
586 If your description contains a "&", a ":", a "@" or a " " you can
587 include them but you must escape with a backlash:
588
589 Target[myrouter]: #\:\ fun:public@hello.router
590
591 Note that the # sign will be interpreted as a comment character if
592 it is the first non white-space character on the line.
593
594 Interface by Ethernet Address
595 When the SNMP interface index changes, you can key that interface
596 by its 'Physical Address', sometimes called a 'hard address', which
597 is the SNMP variable 'ifPhysAddress'. Internally, MRTG matches the
598 Physical Address from the *.cfg file to its current index, and then
599 uses that index for the rest of the session.
600
601 You can use the Physical Address in every type of target definition
602 by adding the Physical Address after the OID and the separation
603 char '!' (analogous to the IP address option). The Physical
604 address is specified as '-' delimited octets, such as
605 "0a-0-f1-5-23-18" (omit the double quotes). Note that some routers
606 use the same Hardware Ethernet Address for all of their Interfaces
607 which prevents unique interface identification. Mrtg will notice
608 such problems and alert you.
609
610 You can tell cfgmaker to generate configuration files with hardware
611 ethernet address references by using the option --ifref=eth.
612
613 Example:
614
615 Target[myrouter]: !0a-0b-0c-0d:public@wellfleet-fddi.domain
616 Target[ezci]: -!0-f-bb-05-71-22:public@ezci-ether.domain
617 Target[myrouter]: 1.3.6.1.2.1.2.2.1.14!0a-00-10-23-44-51&!0a-00-10-23-44-51:public@myrouter
618 Target[myrouter]: ifInErrors!0a-00-10-23-44-51&ifOutErrors!0a-00-10-23-44-51:public@myrouter
619
620 Interface by Type
621 It seems that there are devices that try to defy all monitoring
622 efforts: the interesting interfaces have neither ifName nor a con‐
623 stant ifDescr not to mention a persistant ifIndex. The only way to
624 get a constant mapping is by looking at the interface type, because
625 the interface you are interested in is unique in the device you are
626 looking at ...
627
628 You can tell cfgmaker to generate such references with the option
629 --ifref=type.
630
631 Example:
632
633 Target[myrouter]: %13:public@wellfleet-fddi.domain
634 Target[ezci]: -%13:public@ezci-ether.domain
635 Target[myrouter]: 1.3.6.1.2.1.2.2.1.14%13&1.3.6.1.2.1.2.2.1.14%14:public@myrouter
636 Target[myrouter]: ifInErrors%13&ifOutErrors%14:public@myrouter
637
638 Extended positioning of ifIndex
639 There are OIDs that contain the interface index at some inner posi‐
640 tion within the OID. To use the above mentioned Interface by
641 IP/Description/Name/Type methods in the target definition the key‐
642 word 'IndexPOS' can be used to indicate the position of ifIndex. If
643 'IndexPOS' is not used the ifIndex will be appended at the end of
644 the OID.
645
646 Example:
647
648 Target[myrouter]: .1.3.6.1.4.1.9.10.117.1.1.4.1.10.IndexPOS.1/1.2.3.4&.1.3.6.1.4.1.9.10.117.1.1.4.1.11.IndexPOS.1/1.2.3.4:public@myrouter
649
650 Extended Host Name Syntax
651 In all places where ``community@router'' is accepted, you can add
652 additional parameters for the SNMP communication using colon-sepa‐
653 rated suffixes. You can also append a pipe symbol ( ⎪ ) and the
654 name of a numeric conversion subroutine as described under the
655 global keyword "ConversionCode" above. The full syntax is as fol‐
656 lows:
657
658 community@router[:[port][:[timeout][:[retries][:[backoff][:[version]][⎪name]]]]]
659
660 where the meaning of each parameter is as follows:
661
662 port
663 the UDP port under which to contact the SNMP agent (default:
664 161)
665
666 timeout
667 initial timeout for SNMP queries, in seconds (default: 2.0)
668
669 retries
670 number of times a timed-out request will be retried (default:
671 5)
672
673 backoff
674 factor by which the timeout is multiplied on every retry
675 (default: 1.0).
676
677 version
678 for SNMP version. If you have a fast router you might want to
679 put a '2' here. For authenticated or encrypted SNMP, you can
680 try to put a '3' here. This will make mrtg try to poll the 64
681 bit counters and thus prevent excessive counter wrapping. Not
682 all routers support this though. SNMP v3 requires additional
683 setup, see SnmpOptions[] for full details.
684
685 Example:
686
687 3:public@router1:::::2
688
689 name
690 the name of the subroutine that MRTG will call to convert the
691 input and output values to integers. See the complete example
692 under the global keyword "ConversionCode" above.
693
694 Example:
695
696 1.3.6.1.4.1.999.1&1.3.6.1.4.1.999.2:public@mydevice:161::::2⎪Length2Int
697
698 This would retrieve values from the OID 1.3.6.1.4.1.999.1 for
699 input and .2 for output on mydevice using UDP port 161 and SNMP
700 version 2, and would execute the user-defined numeric conver‐
701 sion subroutine Length2Int to convert those values to integers.
702
703 A value that equals the default value can be omitted. Trailing
704 colons can be omitted, too. The pipe symbol followed by the name
705 parameter, if present, must come at the end. There must be no spa‐
706 ces around the colons or pipe symbol.
707
708 Example:
709
710 Target[ezci]: 1:public@ezci-ether.domain:9161::4
711
712 This would refer to the input/output octet counters for the inter‐
713 face with ifIndex 1 on ezci-ether.domain, as known by the SNMP
714 agent listening on UDP port 9161. The standard initial timeout
715 (2.0 seconds) is used, but the number of retries is set to four.
716 The backoff value is the default.
717
718 Numeric IPv6 addresses
719 If IPv6 is enabled you may also specify a target using its IPv6
720 address. To avoid ambiguity with the port number, numeric IPv6
721 addresses must be placed in square brackets.
722
723 Example:
724
725 Target[IPv6test]: 2:public@[2001:760:4::]:6161::4
726
727 External Monitoring Scripts
728 If you want to monitor something which does not provide data via
729 snmp you can use some external program to do the data gathering.
730
731 The external command must return 4 lines of output:
732
733 Line 1
734 current state of the first variable, normally 'incoming bytes
735 count'
736
737 Line 2
738 current state of the second variable, normally 'outgoing bytes
739 count'
740
741 Line 3
742 string (in any human readable format), telling the uptime of
743 the target.
744
745 Line 4
746 string, telling the name of the target.
747
748 Depending on the type of data your script returns you might want to
749 use the 'gauge' or 'absolute' arguments for the Options keyword.
750
751 Example:
752
753 Target[myrouter]: `/usr/local/bin/df2mrtg /dev/dsk/c0t2d0s0`
754
755 Note the use of the backticks (`), not apostrophes (') around the
756 command.
757
758 If you want to use a backtick in the command name this can be done
759 but you must escape it with a backslash ...
760
761 If your script does not have any data to return but does not want
762 mrtg to complain about invalid data, it can return 'UNKNOWN'
763 instead of a number. Note though that only rrdtool is realy
764 equipped to handle unknown data well.
765
766 Multi Target Syntax
767 You can also combine several target definitions in a mathematical
768 expression. Any syntactically correct expression that the Perl
769 interpreter can evaluate to will work. An expression could be used,
770 for example, to aggregate both B channels in an ISDN connection or
771 to calculate the percentage hard disk utilization of a server from
772 the absolute used space and total capacity.
773
774 Examples:
775
776 Target[myrouter]: 2:public@wellfleetA + 1:public@wellfleetA
777
778 Target[myrouter]: 1.3.6.1.4.1.999.1&1.3.6.1.4.1.999.2:public@mydevice /
779 1.3.6.1.4.1.999.3&1.3.6.1.4.1.999.4:public@mydevice * 100
780
781 Note that whitespace must surround each target definition in the
782 expression. Target definitions themselves must not contain white‐
783 space, except in interface descriptions and interface names, where
784 each whitespace character is escaped by a backslash.
785
786 MRTG automatically rounds the result of the expression to an inte‐
787 ger unless RRDTool logging is in use and the gauge option is in
788 effect for the target. Internally MRTG uses Perl's Math::BigFloat
789 package to calculate the result of the expression with 40 digits of
790 precision. Even in extreme cases, where, for example, you take the
791 difference of two 64-bit integers, the result of the expression
792 should be accurate.
793
794 SNMP Request Optimization
795 MRTG is designed to economize on its SNMP requests. Where a target
796 definition appears more than once in the configuration file, MRTG
797 requests the data from the device only once per round of data col‐
798 lection and uses the collected data for each instance of a particu‐
799 lar target. Recognition of two target definitions as being identi‐
800 cal is based on a simple string match rather than any kind of
801 deeper semantic analysis.
802
803 Example:
804
805 Target[Targ1]: 1:public@CiscoA
806 Target[Targ2]: 2:public@CiscoA
807 Target[Targ3]: 1:public@CiscoA + 2:public@CiscoA
808 Target[Targ4]: 1:public@CISCOA
809
810 This results in a total of three SNMP requests. Data for 1:pub‐
811 lic@CiscoA and 2:public@CiscoA are requested only once each, and
812 used for Targ1, Targ2, and Targ3. Targ4 causes another SNMP request
813 for 1:public@CISCOA, which is not recognized as being identical to
814 1:public@CiscoA.
815
816 MaxBytes
817
818 The maximum value either of the two variables monitored are allowed to
819 reach. For monitoring router traffic this is normally the bytes per
820 second this interface port can carry.
821
822 If a number higher than MaxBytes is returned, it is ignored. Also read
823 the section on AbsMax for further info. The MaxBytes value is also
824 used in calculating the Y range for unscaled graphs (see the section on
825 Unscaled).
826
827 Since most links are rated in bits per second, you need to divide their
828 maximum bandwidth (in bits) by eight (8) in order to get bytes per sec‐
829 ond. This is very important to make your unscaled graphs display real‐
830 istic information. T1 = 193000, 56K = 7000, 10 MB Ethernet = 1250000,
831 100 MB Ethernet = 12500000. The MaxBytes value will be used by mrtg to
832 decide whether it got a valid response from the router.
833
834 If you need two different MaxBytes values for the two monitored vari‐
835 ables, you can use MaxBytes1 and MaxBytes2 instead of MaxBytes.
836
837 Example:
838
839 MaxBytes[myrouter]: 1250000
840
841 Title
842
843 Title for the HTML page which gets generated for the graph.
844
845 Example:
846
847 Title[myrouter]: Traffic Analysis for Our Nice Company
848
850 PageTop
851
852 Things to add to the top of the generated HTML page. Note that you can
853 have several lines of text as long as the first column is empty.
854
855 Note that the continuation lines will all end up on the same line in
856 the html page. If you want linebreaks in the generated html use the
857 '\n' sequence.
858
859 Example:
860
861 PageTop[myrouter]: <H1>Traffic Analysis for ETZ C95.1</H1>
862 Our Campus Backbone runs over an FDDI line\n
863 with a maximum transfer rate of 12.5 megabytes per
864 Second.
865
866 RouterUptime
867
868 In cases where you calculate the used bandwidth from several interfaces
869 you normaly don't get the router uptime and router name displayed on
870 the web page.
871
872 If these interfaces are on the same router and the uptime and name
873 should be displayed you have to specify its community and address again
874 with the RouterUptime keyword.
875
876 Example:
877
878 Target[kacisco.comp.edu]: 1:public@194.64.66.250 + 2:public@194.64.66.250
879 RouterUptime[kacisco.comp.edu]: public@194.64.66.250
880
881 RouterName
882
883 If the default name of the router is incorrect/uninformative, you can
884 use RouterName to specify a different OID on either the same or a dif‐
885 ferent host.
886
887 A practical example: sysName on BayTech DS72 units always display
888 "ds72", no matter what you set the Unit ID to be. Instead, the Unit ID
889 is stored at 1.3.6.1.4.1.4779.1.1.3.0, so we can have MRTG display this
890 instead of sysName.
891
892 Example:
893
894 RouterName[kacisco.comp.edu]: 1.3.6.1.4.1.4779.1.1.3.0
895
896 A different OID on a different host can also be specified:
897
898 RouterName[kacisco.comp.edu]: 1.3.6.1.4.1.4779.1.1.3.0:public@194.64.66.251
899
900 MaxBytes1
901
902 Same as MaxBytes, for variable 1.
903
904 MaxBytes2
905
906 Same as MaxBytes, for variable 2.
907
908 IPv4Only
909
910 Many IPv6 routers do not currently support SNMP over IPv6 and must be
911 monitored using IPv4. The IPv4Only option forces mrtg to use IPv4 when
912 communicating with the target, even if IPv6 is enabled. This is useful
913 if the target is a hostname with both IPv4 and IPv6 addresses; without
914 the IPv4Only keyword, monitoring such a router will not work if IPv6 is
915 enabled.
916
917 If set to no (the default), mrtg will use IPv6 unless the target has no
918 IPv6 addresses, in which case it will use IPv4. If set to yes, mrtg
919 will only use IPv4.
920
921 Note that if this option is set to yes and the target does not have an
922 IPv4 address, communication with the target will fail.
923
924 This option has no effect if IPv6 is not enabled.
925
926 Example:
927
928 Target[v4onlyrouter_1]: 1:public@v4onlyrouter
929 IPv4Only[v4onlyrouter_1]: Yes
930
931 SnmpOptions (V3)
932
933 SNMPv3 requires a fairly rich set of options. This per-target keyword
934 allows access to the User Security Model of SNMPv3. Options are listed
935 in the same syntax as a perl hash.
936
937 Security Modes
938
939 SNMPv3 has three security modes, defined on the device being polled.
940 For example, on Cisco routers the security mode is defined by the snmp-
941 server group global configuration command.
942
943 NoAuthNoPriv
944 Neither Authentication nor Privacy is defined. Only the Username
945 option is specified for this mode.
946
947 Example:
948
949 SnmpOptions[myrouter]: username=>'user1'
950
951 AuthNoPriv
952 Uses a Username and a password. The password can be hashed using
953 the snmpkey application, or passed in plain text along with the
954 ContextEngineID
955
956 Example:
957
958 SnmpOptions[myrouter]: username=>'user1',authpassword=>'example',
959 contextengineid=>'80000001110000004000000'
960
961 Priv
962 Both Authentication and Privacy is defined. The default privacy
963 protocol is des.
964
965 Example:
966 SnmpOptions[myrouter]:
967 authkey=>'0x1e93ab5a396e2af234c8920e61cfe2028072c0e2',
968 authprotocol=>'sha',privprotocol=>'des',username=>'user1',
969 privkey=>'0x498d74940c5872ed387201d74b9b25e2'
970
971 snmp options
972
973 The following option keywords are recognized:
974
975 username
976 The user associated with the User Security Model
977
978 contextname
979 An SNMP agent can define multiple contexts. This keyword allows
980 them to be polled.
981
982 contextengineid
983 A unique 24-byte string identifying the snmp-agent.
984
985 authpassword
986 The plaintext password for a user in either AuthNoPriv or Priv
987 mode.
988
989 authkey
990 A md5 or sha hash of the plain-text password, along with the
991 engineid. Use the snmpkey commandline program to generate this
992 hash, or use Net::SNMP::Security::USM in a script.
993
994 authprotocol {sha⎪md5}
995 The hashing algorithm defined on the SNMP client. Defaults to md5.
996
997 privpassword
998 A plaintext pre-shared key for encrypting snmp packets in Priv
999 mode.
1000
1001 privkey
1002 A hash of the plain-text pre-shared key, along with the engineid.
1003 Use the snmpkey commandline program to generate this hash, or use
1004 Net::SNMP::Security::USM in a script.
1005
1006 privprotocol {des⎪3desede⎪aescfb128⎪aescfb192⎪aescfb256}
1007 Specifies the encryption method defined on the snmp agent. The
1008 default is des.
1009
1010 PageFoot
1011
1012 Things to add to the bottom of the generated HTML page. Note that you
1013 can have several lines of text as long as the first column is empty.
1014
1015 Note that the continuation lines will all end up on the same line in
1016 the html page. If you want linebreaks in the generated html use the
1017 '\n' sequence.
1018
1019 The material will be added just before the </BODY> tag:
1020
1021 Example:
1022
1023 PageFoot[myrouter]: Contact <A HREF="mailto:peter@x.yz">Peter</A>
1024 if you have questions regarding this page
1025
1026 AddHead
1027
1028 Use this tag like the PageTop header, but its contents will be added
1029 between </TITLE> and </HEAD>.
1030
1031 Example:
1032
1033 AddHead[myrouter]: <link rev="made" href="mailto:mrtg@blabla.edu">
1034
1035 BodyTag
1036
1037 BodyTag lets you supply your very own <body ...> tag for the generated
1038 webpages.
1039
1040 Example:
1041
1042 BodyTag[myrouter]: <BODY LEFTMARGIN="1" TOPMARGIN="1"
1043 BACKGROUND="/stats/images/bg.neo2.gif">
1044
1045 AbsMax
1046
1047 If you are monitoring a link which can handle more traffic than the
1048 MaxBytes value. Eg, a line which uses compression or some frame relay
1049 link, you can use the AbsMax keyword to give the absolute maximum value
1050 ever to be reached. We need to know this in order to sort out unreal‐
1051 istic values returned by the routers. If you do not set AbsMax, rateup
1052 will ignore values higher than MaxBytes.
1053
1054 Example:
1055
1056 AbsMax[myrouter]: 2500000
1057
1058 Unscaled
1059
1060 By default each graph is scaled vertically to make the actual data vis‐
1061 ible even when it is much lower than MaxBytes. With the Unscaled vari‐
1062 able you can suppress this. It's argument is a string, containing one
1063 letter for each graph you don't want to be scaled: d=day w=week m=month
1064 y=year. There is also a special case to unset the variable completely:
1065 n=none. This could be useful in the event you need to override a global
1066 configuration. In the example scaling for the yearly and the monthly
1067 graph are suppressed.
1068
1069 Example:
1070
1071 Unscaled[myrouter]: ym
1072
1073 WithPeak
1074
1075 By default the graphs only contain the average values of the monitored
1076 variables - normally the transfer rates for incoming and outgoing traf‐
1077 fic. The following option instructs mrtg to display the peak 5 minute
1078 values in the [w]eekly, [m]onthly and [y]early graph. In the example we
1079 define the monthly and the yearly graph to contain peak as well as
1080 average values.
1081
1082 Examples:
1083
1084 WithPeak[myrouter]: ym
1085
1086 Suppress
1087
1088 By default mrtg produces 4 graphs. With this option you can suppress
1089 the generation of selected graphs. The option value syntax is analo‐
1090 gous to the above two options. In this example we suppress the yearly
1091 graph as it is quite empty in the beginning.
1092
1093 Example:
1094
1095 Suppress[myrouter]: y
1096
1097 Extension
1098
1099 By default, mrtg creates .html files. Use this option to tell mrtg to
1100 use a different extension. For example you could set the extension to
1101 php3, then you will be able to enclose PHP tags into the output (useful
1102 for getting a router name out of a database).
1103
1104 Example:
1105
1106 Extension[myrouter]: phtml
1107
1108 Directory
1109
1110 By default, mrtg puts all the files that it generates for each target
1111 (the GIFs, the HTML page, the log file, etc.) in WorkDir.
1112
1113 If the Directory option is specified, the files are instead put into a
1114 directory under WorkDir or Log-, Image- and HtmlDir). (For example the
1115 Directory option below would cause all the files for a target myrouter
1116 to be put into directory /usr/tardis/pub/www/stats/mrtg/myrouter/ .)
1117
1118 The directory must already exist; mrtg will not create it.
1119
1120 Example:
1121
1122 WorkDir: /usr/tardis/pub/www/stats/mrtg
1123 Directory[myrouter]: myrouter
1124
1125 NOTE: the Directory option must always be 'relative' or bad things will
1126 happen.
1127
1128 Clonedirectory
1129
1130 If the Directory option is specified, the Clonedirectory option will
1131 copy all the contents of Directory to the Clonedirectory.
1132
1133 As well as the Directory option requires, the clone directory must
1134 already exist; mrtg will not create it.
1135
1136 Example:
1137
1138 WorkDir: /usr/tardis/pub/www/stats/mrtg
1139 Directory[myrouter]: myrouter
1140 Clonedirectory[myrouter]: myclonedirectory
1141
1142 NOTE: the Clonedirectory option must always be 'relative' or bad things
1143 will happen.
1144
1145 XSize and YSize
1146
1147 By default mrtgs graphs are 100 by 400 pixels wide (plus some more for
1148 the labels. In the example we get almost square graphs ...
1149
1150 Note: XSize must be between 20 and 600; YSize must be larger than 20
1151
1152 Example:
1153
1154 XSize[myrouter]: 300
1155 YSize[myrouter]: 300
1156
1157 XZoom and YZoom
1158
1159 If you want your graphs to have larger pixels, you can "Zoom" them.
1160
1161 Example:
1162
1163 XZoom[myrouter]: 2.0
1164 YZoom[myrouter]: 2.0
1165
1166 XScale and YScale
1167
1168 If you want your graphs to be actually scaled use XScale and YScale.
1169 (Beware: while this works, the results look ugly (to be frank) so if
1170 someone wants to fix this: patches are welcome.
1171
1172 Example:
1173
1174 XScale[myrouter]: 1.5
1175 YScale[myrouter]: 1.5
1176
1177 YTics and YTicsFactor
1178
1179 If you want to show more than 4 lines per graph, use YTics. If you
1180 want to scale the value used for the YLegend of these tics, use YTics‐
1181 Factor. The default value for YTics is 4 and the default value for
1182 YTicsFactor is 1.0 .
1183
1184 Example:
1185
1186 Suppose you get values ranging from 0 to 700. You want to plot 7 lines
1187 and want to show 0, 1, 2, 3, 4, 5, 6, 7 instead of 0, 100, 200, 300,
1188 400, 500, 600, 700. You should write then:
1189
1190 YTics[myrouter]: 7
1191 YTicsFactor[myrouter]: 0.01
1192
1193 Factor
1194
1195 If you want to multiply all numbers shown below the graph with a con‐
1196 stant factor, use this directive to define it ..
1197
1198 Example:
1199
1200 Factor[as400]: 4096
1201
1202 Step
1203
1204 Change the default step from 5 * 60 seconds to something else (I have
1205 not tested this much ...)
1206
1207 Example:
1208
1209 Step[myrouter]: 60
1210
1211 PNGTitle
1212
1213 When using rateup for graph generation, this will print the given title
1214 in the graph it generates.
1215
1216 Example:
1217
1218 PNGTitle[myrouter]: WAN Link UK-US
1219
1220 Options
1221
1222 The Options Keyword allows you to set some boolean switches:
1223
1224 growright
1225 The graph grows to the left by default. This option flips the
1226 direction of growth causing the current time to be at the right
1227 edge of the graph and the history values to the left of it.
1228
1229 bits
1230 All the monitored variable values are multiplied by 8 (i.e. shown
1231 in bits instead of bytes) ... looks much more impressive :-) It
1232 also affects the 'factory default' labeling and units for the given
1233 target.
1234
1235 perminute
1236 All the monitored variable values are multiplied by 60 (i.e. shown
1237 in units per minute instead of units per second) in case of small
1238 values more accurate graphs are displayed. It also affects the
1239 'factory default' labeling and units for the given target.
1240
1241 perhour
1242 All the monitored variable values are multiplied by 3600 (i.e.
1243 shown in units per hour instead of units per second) in case of
1244 small values more accurate graphs are displayed. It also affects
1245 the 'factory default' labeling and units for the given target.
1246
1247 noinfo
1248 Suppress the information about uptime and device name in the gener‐
1249 ated webpage.
1250
1251 nopercent
1252 Don't print usage percentages.
1253
1254 transparent
1255 Make the background of the generated gifs transparent.
1256
1257 integer
1258 Print summary lines below graph as integers without commas.
1259
1260 dorelpercent
1261 The relative percentage of IN-traffic to OUT-traffic is calculated
1262 and displayed in the graph as an additional line. Note: Only a
1263 fixed scale is available (from 0 to 100%). Therefore if IN-traffic
1264 is greater than OUT-traffic then 100% is displayed. If you suspect
1265 that your IN-traffic is not always less than or equal to your OUT-
1266 traffic you are urged to not use this options. Note: If you use
1267 this option in combination with the Colours options, a fifth
1268 colour-name colour-value pair is required there.
1269
1270 avgpeak
1271 There are some ISPs who use the average Peak values to bill their
1272 customers. Using this option MRTG displays these values for each
1273 graph. The value is built by averaging the max 5 minute traffic
1274 average for each 'step' shown in the graph. For the Weekly graph
1275 this means that it builds the average of all 2 hour intervals 5
1276 minute peak values. (Confused? Thought so!)
1277
1278 gauge
1279 Treat the values gathered from target as 'current status' measure‐
1280 ments and not as ever incrementing counters. This would be useful
1281 to monitor things like disk space, processor load, temperature, and
1282 the like ...
1283
1284 In the absence of 'gauge' or 'absolute' options, MRTG treats vari‐
1285 ables as a counters and calculates the difference between the cur‐
1286 rent and the previous value and divides that by the elapsed time
1287 between the last two readings to get the value to be plotted.
1288
1289 absolute
1290 This is for counter type data sources which reset their value when
1291 they are read. This means that rateup does not have to build the
1292 difference between the current and the last value read from the
1293 data source. The value obtained is still divided by the elapsed
1294 time between the current and the last reading, which makes it dif‐
1295 ferent from the 'gauge' option. Useful for external data gatherers.
1296
1297 derive
1298 If you are using rrdtool as logger/grapher you can use a third type
1299 of data source. Derive is like counter, except that it is not
1300 required to go UP all the time. It is useful for situations where
1301 the change of some value should be graphed.
1302
1303 unknaszero
1304 Log unknown data as zero instead of the default behaviour of
1305 repeating the last value seen. Be careful with this, often a flat
1306 line in the graph is much more obvious than a line at 0.
1307
1308 withzeroes
1309 Normally we ignore all values which are zero when calculating the
1310 average transfer rate on a line. If this is not desirable use this
1311 option.
1312
1313 noborder
1314 If you are using rateup to log data, MRTG will create the graph
1315 images. Normally these images have a shaded border around them. If
1316 you do not want the border to be drawn, enable this option. This
1317 option has no effect if you are not using rateup.
1318
1319 noarrow
1320 As with the option above, this effects rateup graph generation
1321 only. Normally rateup will generate graphs with a small arrow show‐
1322 ing the direction of the data. If you do not want this arrow to be
1323 drawn, enable this option. This option has no effect if you are not
1324 using rateup.
1325
1326 noi When using rateup for graph generation, you can use this option to
1327 stop rateup drawing a graph for the 'I' or first variable. This
1328 also removes entries for this variable in the HTML page MRTG gener‐
1329 ates, and will remove the peaks for this variable if they are
1330 enabled. This allows you to hide this data, or can be very useful
1331 if you are only graphing one line of data rather than two. This
1332 option is not destructive - any data received for the the variable
1333 continued to be logged, it just isn't shown.
1334
1335 noo Same as above, except relating to the 'O' or second variable.
1336
1337 nobanner
1338 When using rateup for graph generation, this option disables MRTG
1339 adding the MRTG banner to the HTML pages it generates.
1340
1341 nolegend
1342 When using rateup for graph generation, this option will stop MRTG
1343 from creating a legend at the bottom of the HTML pages it gener‐
1344 ates.
1345
1346 printrouter
1347 When using rateup for graph generation, this option will print the
1348 router name in the graph it generates. This option is overridden
1349 by the value of PNGTitle if one is given
1350
1351 pngdate
1352 When using rateup for graph generation, this option will print a
1353 timestamp in the graph it generates, including a timezone if one is
1354 specified by the 'Timezone' parameter.
1355
1356 logscale
1357 The logscale option causes rateup to display the data with the Y
1358 axis scaled logarithmically. Doing so allows the normal traffic to
1359 occupy the majority of the vertical range, while still showing any
1360 spikes at their full height.
1361
1362 logscale displays all the available data and will always produce
1363 well-behaved graphs. People often consider a logarithmically
1364 scaled graph counterintuitive, however, and thus hard to interpret.
1365
1366 expscale
1367 The expscale option causes rateup to display the data with the Y
1368 axis scaled exponentially. Doing so emphasizes small changes at
1369 the top of the scale; this can be useful when graphing values that
1370 fluctuate by a small amount near the top of the scale, such as line
1371 voltage.
1372
1373 expscale is essentially the inverse of logscale.
1374
1375 secondmean
1376 The secondmean option sets the maximum value on the graph to the
1377 mean of the data greater than the mean of all data. This produces
1378 a graph that focuses more on the typical data, while clipping large
1379 peaks.
1380
1381 Using secondmean will give a more intutive linearly scaled graph,
1382 but can result in a uselessly high or low scale in some rare situa‐
1383 tions (specifically, when the data includes a large portion of val‐
1384 ues far from the actual mean)
1385
1386 If a target includes both logscale and secondmean in the options,
1387 the secondmean takes precedence.
1388
1389 Example:
1390
1391 Options[myrouter]: growright, bits
1392
1393 kilo
1394
1395 Use this option to change the multiplier value for building prefixes.
1396 Defaultvalue is 1000. This tag is for the special case that 1kB =
1397 1024B, 1MB = 1024kB and so far.
1398
1399 Example:
1400
1401 kilo[myrouter]: 1024
1402
1403 kMG
1404
1405 Change the default multiplier prefixes (,k,M,G,T,P). In the tag Short‐
1406 Legend define only the basic units. Format: Comma seperated list of
1407 prefixed. Two consecutive commas or a comma at start or end of the line
1408 gives no prefix on this item. If you do not want prefixes, just put
1409 two consecutive commas. If you want to skip a magnitude select '-' as
1410 value.
1411
1412 Example: velocity in nm/s (nanometers per second) displayed in nm/h.
1413
1414 ShortLegend[myrouter]: m/h
1415 kMG[myrouter]: n,u,m,,k,M,G,T,P
1416 options[myrouter]: perhour
1417
1418 Colours
1419
1420 The Colours tag allows you to override the default colour scheme.
1421 Note: All 4 of the required colours must be specified here. The colour
1422 name ('Colourx' below) is the legend name displayed, while the RGB
1423 value is the real colour used for the display, both on the graph and in
1424 the html doc.
1425
1426 Format is: Col1#RRGGBB,Col2#RRGGBB,Col3#RRGGBB,Col4#RRGGBB
1427
1428 Important: If you use the dorelpercent options tag a fifth colour name
1429 colour value pair is required:
1430 Col1#RRGGBB,Col2#RRGGBB,Col3#RRGGBB,Col4#RRGGBB,Col5#RRGGBB
1431
1432 Colour1
1433 First variable (normally Input) on default graph.
1434
1435 Colour2
1436 Second variable (normally Output) on default graph.
1437
1438 Colour3
1439 Max first variable (input).
1440
1441 Colour4
1442 Max second variable (output).
1443
1444 RRGGBB
1445 2 digit hex values for Red, Green and Blue.
1446
1447 Example:
1448
1449 Colours[myrouter]: GREEN#00eb0c,BLUE#1000ff,DARK GREEN#006600,VIOLET#ff00ff
1450
1451 Background
1452
1453 With the Background tag you can configure the background colour of the
1454 generated HTML page.
1455
1456 Example:
1457
1458 Background[myrouter]: #a0a0a0a
1459
1460 YLegend, ShortLegend, Legend[1234]
1461
1462 The following keywords allow you to override the text displayed for the
1463 various legends of the graph and in the HTML document:
1464
1465 YLegend
1466 The Y-axis label of the graph. Note that a text which is too long
1467 to fit in the graph will be silently ignored.
1468
1469 ShortLegend
1470 The units string (default 'b/s') used for Max, Average and Current
1471
1472 Legend[1234IO]
1473 The strings for the colour legend.
1474
1475 Example:
1476
1477 YLegend[myrouter]: Bits per Second
1478 ShortLegend[myrouter]: b/s
1479 Legend1[myrouter]: Incoming Traffic in Bits per Second
1480 Legend2[myrouter]: Outgoing Traffic in Bits per Second
1481 Legend3[myrouter]: Maximal 5 Minute Incoming Traffic
1482 Legend4[myrouter]: Maximal 5 Minute Outgoing Traffic
1483 LegendI[myrouter]: In:
1484 LegendO[myrouter]: Out:
1485
1486 Note, if LegendI or LegendO are set to an empty string with
1487
1488 LegendO[myrouter]:
1489
1490 The corresponding line below the graph will not be printed at all.
1491
1492 Timezone
1493
1494 If you live in an international world, you might want to generate the
1495 graphs in different timezones. This is set in the TZ variable. Under
1496 certain operating systems like Solaris, this will provoke the localtime
1497 call to give the time in the selected timezone.
1498
1499 Example:
1500
1501 Timezone[myrouter]: Japan
1502
1503 The Timezone is the standard timezone of your system, ie Japan,
1504 Hongkong, GMT, GMT+1 etc etc.
1505
1506 Weekformat
1507
1508 By default, mrtg (actually rateup) uses the strftime(3) '%V' option to
1509 format week numbers in the monthly graphs. The exact semantics of this
1510 format option vary between systems. If you find that the week numbers
1511 are wrong, and your system's strftime(3) routine supports it, you can
1512 try another format option. The POSIX '%V' option correspond to the
1513 widely used ISO 8601 week numbering standard. The week format charac‐
1514 ter should be specified as a single letter; either W, V, or U.
1515
1516 The UNIX version of rateup uses the libc implementation of strftime.
1517 On Windows, the native strftime implementation does not know about %V.
1518 So there we use a different implementation of strftime that does sup‐
1519 port %V.
1520
1521 Example:
1522
1523 Weekformat[myrouter]: W
1524
1525 RRDRowCount
1526
1527 This affects the creation of new rrd files. By default rrds are created
1528 to hold about 1 day's worth of high resolution data. (plus 1 week of 30
1529 minute data, 2 months of 2 hour data and 2 years of 1 day data). With
1530 this Keyword you can change the number of base interval entries config‐
1531 ured for new rrds as they get created. Note that you must take the
1532 interval time into account.
1533
1534 Example:
1535
1536 RRDRowCount[myrouter]: 1600
1537
1538 TimeStrPos
1539
1540 This defines placement of the timestamp string on the image. Possible
1541 values are RU, LU, RL, LL (which stand, respectively, for RightUpper,
1542 LeftUpper, RightLower and LeftLower corner) and NO (for no timestamp).
1543 By default, no timestamp is placed on the image.
1544
1545 Example:
1546
1547 TimeStrPos[myrouter]: RU
1548
1549 TimeStrFmt
1550
1551 Using this keyword you may specify format of the timestamp to be placed
1552 on the image (if enabled by the TimeStrPos keyword). Specified string
1553 will be used by the strftime() function - see strftime(3) documentation
1554 for conversion specifiers available on your system. Default format:
1555 %Y-%m-%d %H:%M
1556
1557 Example:
1558
1559 TimeStrFmt[myrouter]: %H:%M:%S
1560
1562 Through its threshold checking functionality mrtg is able to detect
1563 threshold problems for the various targets and can call external
1564 scripts to handle those problems (e.g. send email or a page to an
1565 administrator).
1566
1567 Threshold checking is configured through the following parameters:
1568
1569 ThreshDir (GLOBAL)
1570
1571 By defining ThreshDir to point to a writable directory, MRTG will only
1572 alert you when a threshold boundery has been crossed.
1573
1574 Example:
1575
1576 ThreshDir: /var/mrtg/thresh
1577
1578 ThreshHyst (GLOBAL)
1579
1580 If a threshold is broken, and you have a threshdir defined, then mrtg
1581 will send mail once the threshold becomes 'unborken' to avoid situa‐
1582 tions where broken and un-broken messages get sent in close succession,
1583 we only send an unbroken message once the curent value is 0.1 (10%)
1584 away from the threshold. using the ThreshHyst config variable you can
1585 customize this value.
1586
1587 Example for 5%:
1588
1589 ThreshHyst: 0.05
1590
1591 ThreshMailServer (GLOBAL)
1592
1593 Adderss of an SMTP server which is going to accept mail about Thresh‐
1594 olds being broken and unbroken.
1595
1596 ThreshMailSender (GLOBAL)
1597
1598 What is the sender address of the threshold mail.
1599
1600 Example:
1601
1602 ThreshMailSender: mrtg@example.com
1603
1604 ThreshMailAddress (PER TARGET)
1605
1606 Email address for Threshold related Mails. This will only work if a
1607 mailserver has been configured.
1608
1609 Example:
1610
1611 ThreshMailAddress[_]: admin@example.com
1612 ThreshMailAddress[router]:
1613
1614 This would bring threshold releaed mail to all but the target called
1615 'router'.
1616
1617 ThreshMinI (PER TARGET)
1618
1619 This is the minimum acceptable value for the Input (first) parameter.
1620 If the parameter falls below this value, the program specified in
1621 ThreshProgI will be run. If the value ends in '%' then the threshold is
1622 defined relative to MaxBytes.
1623
1624 ThreshMaxI (PER TARGET)
1625
1626 This is the maximum acceptable value for the Input (first) parameter.
1627 If the parameter falls above this value, the program specified in
1628 ThreshProgI will be run. If the value ends in '%' then the threshold is
1629 defined relative to MaxBytes.
1630
1631 ThreshDesc (PER TARGET)
1632
1633 Its value will be assigned to the environment variable THRESH_DESC
1634 before any of the programs mentioned below are called. The programms
1635 can use the value of this variable to produce more user-friendly out‐
1636 put.
1637
1638 ThreshProgI (PER TARGET)
1639
1640 This defines a program to be run if ThreshMinI or ThreshMaxI is broken.
1641 MRTG passes 3 arguments: the $router variable, the threshold value bro‐
1642 ken, and the current parameter value.
1643
1644 ThreshProgOKI (PER TARGET)
1645
1646 This defines a program to be run if the parameter is currently OK
1647 (based on ThreshMinI and ThreshMaxI), but wasn't OK on the previous
1648 running -- based on the files found in ThreshDir. MRTG passes 3 argu‐
1649 ments: the $router variable the unbroken threshold value, and the cur‐
1650 rent parameter value.
1651
1652 ThreshMinO, ThreshMaxO, ThreshProgO, and ThreshProgOKO
1653
1654 These work the same as their *I counterparts, except on the Output
1655 (second) parameter.
1656
1657 SetEnv
1658
1659 When calling threshold scripts from within your cfg file you might want
1660 to pass some data on to the script. This can be done with the SetEnv
1661 configuration option which takes a series of environment variable
1662 assignments. Note that the quotes are mandatory. This does not work for
1663 external scripts. It is not possible to set environment variables per
1664 target.
1665
1666 Example:
1667
1668 SetEnv[myrouter]: EMAIL="contact_email@someplace.net"
1669 HOST="www.some_server.net"
1670
1672 Pre- and Postfix
1673
1674 To save yourself some typing you can define a target called '^'. The
1675 text of every Keyword you define for this target will be PREPENDED to
1676 the corresponding Keyword of all the targets defined below this line.
1677 The same goes for a Target called '$' but its text will be APPENDED.
1678
1679 Note that a space is inserted between the prepended text and the Key‐
1680 word value, as well as between the Keyword value and the appended text.
1681 This works well for text-valued Keywords, but is not very useful for
1682 other Keywords. See the "default" target description below.
1683
1684 The example will make mrtg use a common header and a common contact
1685 person in all the pages generated from targets defined later in this
1686 file.
1687
1688 Example:
1689
1690 PageTop[^]: <H1>NoWhere Unis Traffic Stats</H1><HR>
1691 PageTop[$]: Contact Peter Norton if you have any questions<HR>
1692
1693 To remove the prepend/append value, specify an empty value, e.g.:
1694
1695 PageTop[^]:
1696 PageTop[$]:
1697
1698 NoSpaceChar
1699
1700 With PREPEND and APPEND (see below) there is normally a space inserted
1701 between the local value and the PRE- or APPEND value. Sometimes this is
1702 not desirable. You can use the global option NoSpaceChar to define a
1703 character which can be mentioned at the end of a $ or ^ definition in
1704 order to supress the space.
1705
1706 Example:
1707
1708 NoSpaceChar: ~
1709 Target[^]: 1.3.6.1.4.1.482.50.2.4.20.0&1.3.6.1.4.1.482.50.2.4.21.0:get@~
1710 Target[a]: a.tolna.net
1711 Target[b]: b.tolna.net
1712 Target[c]: c.tolna.net
1713 Target[d]: d.tolna.net
1714
1715 Default Values
1716
1717 The target name '_' specifies a default value for that Keyword. In the
1718 absence of explicit Keyword value, the prepended and the appended key‐
1719 word value, the default value will be used.
1720
1721 Example:
1722
1723 YSize[_]: 150
1724 Options[_]: growright,bits,nopercent
1725 WithPeak[_]: ymw
1726 Suppress[_]: y
1727 MaxBytes[_]: 1250000
1728
1729 To remove the default value and return to the 'factory default', spec‐
1730 ify an empty value, e.g.:
1731
1732 YLegend[_]:
1733
1734 There can be several instances of setting the default/prepend/append
1735 values in the configuration file. The later setting replaces the previ‐
1736 ous one for the rest of the configuration file. The
1737 default/prepend/append values used for a given keyword/target pair are
1738 the ones that were in effect at the point in the configuration file
1739 where the target was mentioned for the first time.
1740
1741 Example:
1742
1743 MaxBytes[_]: 1250000
1744 Target[myrouter.somplace.edu.2]: 2:public@myrouter.somplace.edu
1745 MaxBytes[_]: 8000
1746 Title[myrouter.somplace.edu.2]: Traffic Analysis for myrouter.somplace.edu IF 2
1747
1748 The default MaxBytes for the target myrouter.someplace.edu.2 in the
1749 above example will be 1250000, which was in effect where the target
1750 name myrouter.someplace.edu.2 first appeared in the config file.
1751
1753 --user username and --group groupname
1754 Run as the given user and/or group. (Unix Only)
1755
1756 --lock-file filename
1757 Use an alternate lock-file (the default is to use the configura‐
1758 tion-file appended with "_l").
1759
1760 --confcache-file filename
1761 Use an alternate confcache-file (the default is to use the configu‐
1762 ration-file appended with ".ok")
1763
1764 --logging filename⎪eventlog
1765 If this is set to writable filename, all output from mrtg (warn‐
1766 ings, debug messages, errors) will go to filename. If you are run‐
1767 ning on Win32 you can specify eventlog instead of a filename which
1768 will send all error to the windows event log.
1769
1770 NOTE: Note, there is no Message DLL for mrtg included with mrtg.
1771 This has the side effect that the windows event logger will display
1772 a nice message with every entry in the event log, complaing about
1773 the fact that mrtg has no message dll. If you go to the mrtg con‐
1774 trib download area (on the website) you will find the mrtg-mes‐
1775 sage-dll.zip which does contain such a thing.
1776
1777 --daemon
1778 Put MRTG into the background, running as a daemon. This works the
1779 same way as the config file option, but the switch is required for
1780 proper FHS operation (because /var/run is writable only by root)
1781
1782 --fhs
1783 Configure all mrtg paths to conform to the FHS specification;
1784 http://www.pathname.com/fhs/
1785
1786 --check
1787 Only check the cfg file for errors. Do not do anything.
1788
1789 --pid-file=s
1790 Define the name and path of the pid file for mrtg running as a dae‐
1791 mon
1792
1793 --debug=s
1794 Enable debug options. The argument of the debug option is a comma
1795 separated list of debug values:
1796
1797 cfg - watch the config file reading
1798 dir - directory mangeling
1799 base - basic program flow
1800 tarp - target parser
1801 snpo - snmp polling
1802 coca - confcache operations
1803 fork - forking view
1804 time - some timing info
1805 log - logging of data via rateup or rrdtool
1806 eval - print eval strings before evaluting them
1807 prof - add hires timing info the rrd calls
1808
1809 Example:
1810
1811 --debug="cfg,snpo"
1812
1814 An exit code of 0 indicates that all targets were successful. Gener‐
1815 ally speaking, most codes greater than 0 indicate that there was an
1816 unrecoverable problem. One exception to this is code 91, which indi‐
1817 cates that at least one of the targets was succesful. A partial list‐
1818 ing of the codes follows:
1819
1820 0: All targets sucessful
1821
1822 2: Config error (can't read, fatal error in config, etc)
1823 17: Another MRTG process is processing config
1824
1825 91: At least one target sucessful
1826 92: No targets were sucessful
1827
1829 Minimal mrtg.cfg
1830
1831 WorkDir: /usr/tardis/pub/www/stats/mrtg
1832 Target[r1]: 2:public@myrouter.somplace.edu
1833 MaxBytes[r1]: 8000
1834 Title[r1]: Traffic Analysis ISDN
1835 PageTop[r1]: <H1>Stats for our ISDN Line</H1>
1836
1837 Cfg for several Routers.
1838
1839 WorkDir: /usr/tardis/pub/www/stats/mrtg
1840 Title[^]: Traffic Analysis for
1841 PageTop[^]: <H1>Stats for
1842 PageTop[$]: Contact The Chief if you notice anybody<HR>
1843 MaxBytes[_]: 8000
1844 Options[_]: growright
1845
1846 Title[isdn]: our ISDN Line
1847 PageTop[isdn]: our ISDN Line</H1>
1848 Target[isdn]: 2:public@router.somplace.edu
1849
1850 Title[backb]: our Campus Backbone
1851 PageTop[backb]: our Campus Backbone</H1>
1852 Target[backb]: 1:public@router.somplace.edu
1853 MaxBytes[backb]: 1250000
1854
1855 # the following line removes the default prepend value
1856 # defined above
1857
1858 Title[^]:
1859
1860 Title[isdn2]: Traffic for the Backup ISDN Line
1861 PageTop[isdn2]: our ISDN Line</H1>
1862 Target[isdn2]: 3:public@router.somplace.edu
1863
1865 Tobias Oetiker <tobi@oetiker.ch> and many contributors
1866
1867
1868
18692.15.1 2007-02-01 MRTG-REFERENCE(1)