1MRTG-REFERENCE(1)                    mrtg                    MRTG-REFERENCE(1)
2
3
4

NAME

6       mrtg-reference - MRTG 2.16.4 configuration reference
7

OVERVIEW

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-
12       tuning is required.
13
14       This document describes all the configuration options understood by the
15       mrtg software.
16

SYNTAX

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
38           current working directory and the directory containing the main
39           config file will be searched for the files.
40

GLOBAL KEYWORDS

42   WorkDir
43       WorkDir specifies where the logfiles and the webpages should be
44       created.
45
46       Example:
47
48        WorkDir: /usr/tardis/pub/www/stats/mrtg
49

OPTIONAL GLOBAL KEYWORDS

51   HtmlDir
52       HtmlDir specifies the directory where the html (or shtml, but we'll get
53       on to those later) lives.
54
55       NOTE: Workdir overrides the settings for htmldir, imagedir and logdir.
56
57       Example:
58
59        Htmldir: /www/mrtg/
60
61   ImageDir
62       ImageDir specifies the directory where the images live. They should be
63       under the html directory.
64
65       Example:
66
67        Imagedir: /www/mrtg/images
68
69   LogDir
70       LogDir specifies the directory where the logs are stored.  This need
71       not be under htmldir directive.
72
73       Example:
74
75        Logdir: /www/mrtg/logs
76
77   Forks (UNIX only)
78       With system that supports fork (UNIX for example), mrtg can fork itself
79       into multiple instances while it is acquiring data via snmp.
80
81       For situations with high latency or a great number of devices this will
82       speed things up considerably. It will not make things faster, though,
83       if you query a single switch sitting next door.
84
85       As far as I know NT can not fork so this option is not available on NT.
86
87       Example:
88
89        Forks: 4
90
91   EnableIPv6
92       When set to yes, IPv6 support is enabled if the required libraries are
93       present (see the mrtg-ipv6 manpage). When IPv6 is enabled, mrtg can
94       talk to routers using SNMP over IPv6 and targets may be specified by
95       their numeric IPv6 addresses as well as by hostname or IPv4 address.
96
97       If IPv6 is enabled and the target is a hostname, mrtg will try to
98       resolve the hostname to an IPv6 address and, if this fails, to an IPv4
99       address.  Note that mrtg will only use IPv4 if you specify an IPv4
100       address or a hostname with no corresponding IPv6 address; it will not
101       fall back to IPv4 if it simply fails to communicate with the target
102       using IPv6. This is by design.
103
104       Note that many routers do not currently support SNMP over IPv6. Use the
105       IPv4Only per target option for these routers.
106
107       IPv6 is disabled by default.
108
109       Example:
110
111        EnableIPv6: Yes
112
113   EnableSnmpV3
114       When set to yes, uses the Net::SNMP module instead of the SNMP_SESSION
115       module for generating snmp queries.  This allows the use of SNMPv3 if
116       other snmpv3 parameters are set.
117
118       SNMPv3 is disabled by default.
119
120       Example:
121
122        EnableSnmpV3: yes
123
124   Refresh
125       How many seconds apart should the browser (Netscape) be instructed to
126       reload the page? If this is not defined, the default is 300 seconds (5
127       minutes).
128
129       Example:
130
131        Refresh: 600
132
133   Interval
134       How often do you call mrtg? The default is 5 minutes. If you call it
135       less often, you should specify it here.  This does two things:
136
137       ·   The generated HTML page contains the right information about the
138           calling interval ...
139
140       ·   A META header in the generated HTML page will instruct caches about
141           the time-to-live of this page .....
142
143       In this example, we tell mrtg that we will be calling it every 10
144       minutes. If you are calling mrtg every 5 minutes, you can leave this
145       line commented out.
146
147       Example:
148
149        Interval: 10
150
151       Note that unless you are using rrdtool you can not set Interval to less
152       than 5 minutes. If you are using rrdtool you can set interval in the
153       format
154
155        Interval: MM[:SS]
156
157       Down to 1 second. Note though, setting the Interval for an rrdtool/mrtg
158       setup will influence the initial creation of the database. If you
159       change the interval later, all existing databases will remain at the
160       resolution they were initially created with. Also note that you must
161       make sure that your mrtg-rrd Web-frontend can deal with this kind of
162       Interval setting.
163
164   MaxAge
165       MRTG relies heavily on the real time clock of your computer. If the
166       time is set to a wrong value, especially if it is advanced far into the
167       future, this will cause mrtg to expire lots of supposedly old data from
168       the log files.
169
170       To prevent this, you can add a 'reasonability' check by specifying a
171       maximum age for log files. If a file seems to be older, mrtg will not
172       touch it but complain instead, giving you a chance to investigate the
173       cause.
174
175       Example:
176
177        MaxAge: 7200
178
179       The example above will make mrtg refuse to update log files older than
180       2 hours (7200 seconds).
181
182   WriteExpires
183       With this switch mrtg will generate .meta files for CERN and Apache
184       servers which contain Expiration tags for the html and gif files. The
185       *.meta files will be created in the same directory as the other files,
186       so you will have to set "MetaDir ." and "MetaFiles on" in your
187       apache.conf or .htaccess file for this to work
188
189       NOTE: If you are running Apache-1.2 or later, you can use the
190       mod_expire to achieve the same effect ... see the file htaccess.txt
191
192       Example:
193
194        WriteExpires: Yes
195
196   NoMib2
197       Normally we ask the SNMP device for 'sysUptime' and 'sysName'
198       properties.  Some do not have these. If you want to avoid getting
199       complaints from mrtg about these missing properties, specify the nomib2
200       option.
201
202       An example of agents which do not implement base mib2 attributes are
203       Computer Associates - Unicenter TNG Agents.  CA relies on using the
204       base OS SNMP agent in addition to its own agents to supplement the
205       management of a system.
206
207       Example:
208
209        NoMib2: Yes
210
211   SingleRequest
212       Some SNMP implementations can not deal with requests asking for
213       multiple snmp variables in one go. Set this in your cfg file to force
214       mrtg to only ask for one variable per request.
215
216       Examples
217
218        SingleRequest: Yes
219
220   SnmpOptions
221       Apart from the per target timeout options, you can also configure the
222       behaviour of the snmpget process on a more profound level. SnmpOptions
223       accepts a hash of options. The following options are currently
224       supported:
225
226        timeout                   => $default_timeout,
227        retries                   => $default_retries,
228        backoff                   => $default_backoff,
229        default_max_repetitions   => $max_repetitions,
230        use_16bit_request_ids     => 1,
231        lenient_source_port_matching => 0,
232        lenient_source_address_matching => 1
233
234       The values behind the options indicate the current default value.  Note
235       that these settings OVERRIDE the per target timeout settings.
236
237       A per-target SnmpOptions[] keyword will override the global settings.
238       That keyword is primarily for SNMPv3.
239
240       The 16bit request ids are the only way to query the broken SNMP
241       implementation of SMC Barricade routers.
242
243       Example:
244
245        SnmpOptions: retries => 2, only_ip_address_matching => 0
246
247       Note that AS/400 snmp seems to be broken in a way which prevents mrtg
248       from working with it unless
249
250        SnmpOptions: lenient_source_port_matching => 1
251
252       is set.
253
254   IconDir
255       If you want to keep the mrtg icons in someplace other than the working
256       (or imagedir) directory, use the IconDir variable for defining the url
257       of the icons directory.
258
259       Example:
260
261        IconDir: /mrtgicons/
262
263   LoadMIBs
264       Load the MIB file(s) specified and make its OIDs available as symbolic
265       names. For better efficiancy, a cache of MIBs is maintained in the
266       WorkDir.
267
268       Example:
269
270        LoadMIBs: /dept/net/mibs/netapp.mib,/usr/local/lib/ft100m.mib
271
272   Language
273       Switch output format to the selected Language (Check the translate
274       directory to see which languages are supported at the moment. In this
275       directory you can also find instructions on how to create new
276       translations).
277
278       Currently the following laguages are supported:
279
280       big5 brazilian bulgarian catalan chinese croatian czech danish dutch
281       eucjp french galician gb gb2312 german greek hungarian icelandic
282       indonesia iso2022jp italian korean lithuanian malay norwegian polish
283       portuguese romanian russian russian1251 serbian slovak slovenian
284       spanish swedish turkish ukrainian
285
286       Example:
287
288        Language: danish
289
290   LogFormat
291       Setting LogFormat to 'rrdtool' in your mrtg.cfg file enables rrdtool
292       mode.  In rrdtool mode, mrtg relies on rrdtool to do its logging. See
293       mrtg-rrd.
294
295       Example:
296
297        LogFormat: rrdtool
298
299   LibAdd
300       If you are using rrdtool mode and your rrdtool Perl module (RRDs.pm) is
301       not installed in a location where perl can find it on its own, you can
302       use LibAdd to supply an appropriate path.
303
304       Example:
305
306        LibAdd: /usr/local/rrdtool/lib/perl/
307
308   PathAdd
309       If the rrdtool executable can not be found in the normal "PATH", you
310       can use this keyword to add a suitable directory to your path.
311
312       Example:
313
314        PathAdd: /usr/local/rrdtool/bin/
315
316   RunAsDaemon
317       The RunAsDaemon keyword enables daemon mode operation. The purpose of
318       daemon mode is that MRTG is launched once and not repeatedly (as it is
319       with cron).  This behavior saves computing resourses as loading and
320       parsing of configuration files happens only once.
321
322       Using daemon mode MRTG itself is responible for timing the measurement
323       intervals. Therfore its important to set the Interval keyword to an
324       apropiate value.
325
326       Note that when using daemon mode MRTG should no longer be started from
327       cron as each new process runs forever. Instead MRTG should be started
328       from the command prompt or by a system startup script.
329
330       If you want mrtg to run under a particular user and group (it is not
331       recomended to run MRTG as root) then you can use the --user=user_name
332       and --group=group_name options on the mrtg commandline.
333
334        mrtg --user=mrtg_user --group=mrtg_group mrtg.cfg
335
336       Also note that in daemon mode restarting the process is required in
337       order to activate changes in the config file.
338
339       Under UNIX, the Daemon switch causes mrtg to fork into background after
340       checking its config file. On Windows NT the MRTG process will detach
341       from the console, but because the NT/2000 shell waits for its children
342       you have to use this special start sequence when you launch the
343       program:
344
345        start /b perl mrtg mrtg.cfg
346
347       You may have to add path information equal to what you add when you run
348       mrtg from the commandline.
349
350       Example
351
352        RunAsDaemon: Yes
353        Interval:    5
354
355       This makes MRTG run as a daemon beginning data collection every 5
356       minutes
357
358       If you are daemontools and still want to run mrtg as a daemon you can
359       additionally specify
360
361        NoDetach:     Yes
362
363       this will make mrtg run but without detaching it from the terminal.
364
365   ConversionCode
366       Some devices may produce non-numeric values that would nevertheless be
367       useful to graph with MRTG if those values could be converted to
368       numbers.  The ConversionCode keyword specifies the path to a file
369       containing Perl code to perform such conversions. The code in this file
370       must consist of one or more Perl subroutines. Each subroutine must
371       accept a single string argument and return a single numeric value. When
372       RRDtool is in use, a decimal value may be returned. When the name of
373       one of these subroutines is specified in a target definition (see
374       below), MRTG calls it twice for that target, once to convert the the
375       input value being monitored and a second time to convert the output
376       value. The subroutine must return an undefined value if the conversion
377       fails. In case of failure, a warning may be posted to the MRTG log file
378       using Perl's warn function. MRTG imports the subroutines into a
379       separate name space (package MRTGConversion), so the user need not
380       worry about pollution of MRTG's global name space. MRTG automatically
381       prepends this package declaration to the user-supplied code.
382
383       Example: Suppose a particular OID returns a character string whose
384       length is proportional to the value to be monitored. To convert this
385       string to a number that can be graphed by MRTG, create a file
386       arbitrarily named "MyConversions.pl" containing the following code:
387
388        # Return the length of the string argument
389        sub Length2Int {
390          my $value = shift;
391          return length( $value );
392        }
393
394       Then include the following global keyword in the MRTG configuration
395       file (assuming that the conversion code file is saved in the mrtg/bin
396       directory along with mrtg itself):
397
398        ConversionCode: MyConversions.pl
399
400       This will cause MRTG to include the definition of the subroutine
401       Length2Int in its execution environment. Length2Int can then be invoked
402       on any target by appending "|Length2Int" to the target definition as
403       follows:
404
405        Target[myrouter]: 1.3.6.1.4.1.999.1&1.3.6.1.4.1.999.1:public@mydevice|Length2Int
406
407       See "Extended Host Name Syntax" below for complete target definition
408       syntax information.
409

PER TARGET CONFIGURATION

411       Each monitoring target must be identified by a unique name. This name
412       must be appended to each parameter belonging to the same target. The
413       name will also be used for naming the generated webpages, logfiles and
414       images for this target.
415
416   Target
417       With the Target keyword you tell mrtg what it should monitor. The
418       Target keyword takes arguments in a wide range of formats:
419
420       Basic
421           The most basic format is "port:community@router" This will generate
422           a traffic graph for the interface 'port' of the host 'router' (dns
423           name or IP address) and it will use the community 'community' (snmp
424           password) for the snmp query.
425
426           Example:
427
428            Target[myrouter]: 2:public@wellfleet-fddi.domain
429
430           If your community contains a "@" or a " " these characters must be
431           escaped with a "\".
432
433            Target[bla]: 2:stu\ pi\@d@router
434
435       SNMPv2c
436           If you have a fast router you might want to try to poll the ifHC*
437           counters.  This feature gets activated by switching to SNMPv2c.
438           Unfortunately not all devices support SNMPv2c yet. If it works,
439           this will prevent your counters from wraping within the 5 minute
440           polling interval, since we now use 64 bit instead of the normal 32
441           bit.
442
443           Example:
444
445            Target[myrouter]: 2:public@router1:::::2
446
447       SNMPv3
448           As an alternative to SNMPv2c, SNMPv3 provides access to the ifHC*
449           counters, along with encryption.  Not all devices support SNMPv3,
450           and you will also need the perl Net::SNMP library in order to use
451           it.  It is recommended that cfgmaker be used to generate
452           configurations involving SNMPv3, as it will check if the Net::SNMP
453           library is loadable, and will switch to SNMPv2c if v3 is
454           unavailable.
455
456           SNMP v3 requires additional authentication parameters, passed using
457           the SnmpOptions[] per-target keyword.
458
459           Example:
460             Target[myrouter]: 2:router1:::::3
461             SnmpOptions[myrouter]: username=>'user1'
462
463       noHC
464           Not all routers that support SNMPv2 or SNMPv3 provide the ifHC*
465           counters on every interface.  The noHC[] per-target keyword signals
466           that the low-speed counters ifInOctets and ifOutOctets should be
467           queried instead.  cfgmaker will automatically insert this tag if
468           SNMPv2 or SNMPv3 is specified but the ifHC* counters are
469           unavailable.
470
471           Example:
472             Target[myrouter]: #Bri0:router1:::::3
473             SnmpOptions[myrouter]: username=>'user1'
474             noHC[myrouter]: yes
475
476       Reversing
477           Sometimes you are sitting on the wrong side of the link, and you
478           would like to have mrtg report Incoming traffic as Outgoing and
479           vice versa. This can be achieved by adding the '-' sign in front of
480           the "Target" description. It flips the incoming and outgoing
481           traffic rates.
482
483           Example:
484
485            Target[ezci]: -1:public@ezci-ether.domain
486
487       Explicit OIDs
488           You can also explicitly define which OID to query by using the
489           following syntax 'OID_1&OID_2:community@router' The following
490           example will retrieve error counts for input and output on
491           interface 1.  MRTG needs to graph two variables, so you need to
492           specify two OID's such as temperature and humidity or error input
493           and error output.
494
495           Example:
496
497            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
498
499       MIB Variables
500           MRTG knows a number of symbolic SNMP variable names.  See the file
501           mibhelp.txt for a list of known names.  One example are the
502           ifInErrors and ifOutErrors.  This means you can specify the above
503           as:
504
505           Example:
506
507            Target[myrouter]: ifInErrors.1&ifOutErrors.1:public@myrouter
508
509       SnmpWalk
510           It may be that you want to monitor an snmp object that is only
511           reachable by 'walking'. You can get mrtg to walk by prepending the
512           OID with the string WaLK or if you want a particular entry from the
513           table returned by the walk you can use WaLKx where x is a number
514           starting from 0 (!).
515
516           Example:
517
518             Target[myrouter]: WaLKstrangeOid.1&WaLKstrangeOid.2:public@myrouter
519
520             Target[myrouter]: WaLK3strangeOid.1&WaLK4strangeOid.2:public@myrouter
521
522       SnmpGetNext
523           A special case of an snmp object that is only reachable by
524           'walking' occurs when a single snmpgetnext will return the correct
525           value, but snmpwalk fails.  This may occur with snmp V2 or V3, as
526           the snmpgetbulk method is used in these versions. You can get mrtg
527           to use getnext instead of getbulk by prepending the OID with the
528           string GeTNEXT.
529
530           Example:
531
532             Target[myrouter]: GeTNEXTstrangeOid&GeTNEXTstrangeOid:public@myrouter
533
534       Counted SNMP Walk
535           In other situations, an snmpwalk is needed to count rows, but the
536           actual data is uninteresting.  For example, counting the number of
537           mac-addresses in a CAM table, or the number of simultaneous dialup
538           sessions.  You can get MRTG to count the number of instances by
539           prepending the OID with the string CnTWaLK.  The following will
540           retrieve the number of simultaneous VOIP calls on some routers:
541
542           Example:
543
544              Target[myrouter]: CnTWaLK1.3.6.1.4.1.9.10.55.1.1.1.1.3&CnTWaLK1.3.6.1.4.1.9.10.55.1.1.1.1.3:public@myrouter
545
546       Interface by IP
547           Sometimes SNMP interface index can change, like when new interfaces
548           are added or removed. This can cause all Target entries in your
549           config file to become offset, causing MRTG to graphs wrong
550           instances etc.  MRTG supports IP address instead of ifindex in
551           target definition. Then MRTG will query snmp device and try to map
552           IP address to the current ifindex.  You can use IP addresses in
553           every type of target definition by adding IP address of the
554           numbered interface after OID and separation char '/'.
555
556           Make sure that the given IP address is used on your same target
557           router, especially when graphing two different OIDs and/or
558           interface split by '&' delimiter.
559
560           You can tell cfgmaker to generate such references with the option
561           --ifref=ip.
562
563           Example:
564
565            Target[myrouter]: /1.2.3.4:public@wellfleet-fddi.domain
566            Target[ezci]: -/1.2.3.4:public@ezci-ether.domain
567            Target[myrouter]: ifInErrors/1.2.3.4&ifOutErrors/1.2.3.4:public@myrouter
568
569       Interface by Description
570           If you can not use IP addresses you might want to use the interface
571           names. This works similar to the IP address aproach except that the
572           prefix to use is a \ instead of a /
573
574           You can tell cfgmaker to generate such references with the option
575           --ifref=descr.
576
577           Example:
578
579            Target[myrouter]: \My-Interface2:public@wellfleet-fddi.domain
580            Target[ezci]: -\My-Interface2:public@ezci-ether.domain
581            Target[myrouter]: ifInErrors\My-If2&ifOutErrors\My-If3:public@myrouter
582
583           If your description contains a "&", a ":", a "@" or a " " you can
584           include them but you must escape with a backlash:
585
586            Target[myrouter]: \fun\:\ ney\&ddd:public@hello.router
587
588       Interface by Name
589           This is the only sensible way to reference the interfaces of your
590           switches.
591
592           You can tell cfgmaker to generate such references with the option
593           --ifref=name.
594
595           Example:
596
597            Target[myrouter]: #2/11:public@wellfleet-fddi.domain
598            Target[ezci]: -#2/11:public@ezci-ether.domain
599            Target[myrouter]: ifInErrors#3/7&ifOutErrors#3/7:public@myrouter
600
601           If your description contains a "&", a ":", a "@" or a " " you can
602           include them but you must escape with a backlash:
603
604            Target[myrouter]: #\:\ fun:public@hello.router
605
606           Note that the # sign will be interpreted as a comment character if
607           it is the first non white-space character on the line.
608
609       Interface by Ethernet Address
610           When the SNMP interface index changes, you can key that interface
611           by its 'Physical Address', sometimes called a 'hard address', which
612           is the SNMP variable 'ifPhysAddress'.  Internally, MRTG matches the
613           Physical Address from the *.cfg file to its current index, and then
614           uses that index for the rest of the session.
615
616           You can use the Physical Address in every type of target definition
617           by adding the Physical Address after the OID and the separation
618           char '!' (analogous to the IP address option).  The Physical
619           address is specified as '-' delimited octets, such as
620           "0a-0-f1-5-23-18" (omit the double quotes). Note that some routers
621           use the same Hardware Ethernet Address for all of their Interfaces
622           which prevents unique interface identification. Mrtg will notice
623           such problems and alert you.
624
625           You can tell cfgmaker to generate configuration files with hardware
626           ethernet address references by using the option --ifref=eth.
627
628           Example:
629
630            Target[myrouter]: !0a-0b-0c-0d:public@wellfleet-fddi.domain
631            Target[ezci]: -!0-f-bb-05-71-22:public@ezci-ether.domain
632            Target[myrouter]: 1.3.6.1.2.1.2.2.1.14!0a-00-10-23-44-51& *BREAK*
633                       1.3.6.1.2.1.2.2.1.14!0a-00-10-23-44-51:public@myrouter
634            Target[myrouter]: ifInErrors!0a-00-10-23-44-51& *BREAK*
635                       ifOutErrors!0a-00-10-23-44-51:public@myrouter
636
637           Join the lines at *BREAK* ...
638
639       Interface by Type
640           It seems that there are devices that try to defy all monitoring
641           efforts: the interesting interfaces have neither ifName nor a
642           constant ifDescr not to mention a persistent ifIndex. The only way
643           to get a constant mapping is by looking at the interface type,
644           because the interface you are interested in is unique in the device
645           you are looking at ...
646
647           You can tell cfgmaker to generate such references with the option
648           --ifref=type.
649
650           Example:
651
652            Target[myrouter]: %13:public@wellfleet-fddi.domain
653            Target[ezci]: -%13:public@ezci-ether.domain
654            Target[myrouter]: ifInErrors%13&ifOutErrors%14:public@myrouter
655
656       Extended positioning of ifIndex
657           There are OIDs that contain the interface index at some inner
658           position within the OID. To use the above mentioned Interface by
659           IP/Description/Name/Type methods in the target definition the
660           keyword 'IndexPOS' can be used to indicate the position of ifIndex.
661           If 'IndexPOS' is not used the ifIndex will be appended at the end
662           of the OID.
663
664           Example:
665
666            Target[myrouter]: OID.IndexPOS.1/1.2.3.4&OID.IndexPOS.1/1.2.3.4:public@myrouter
667
668           Replace OID by your numeric OID.
669
670       Extended Host Name Syntax
671           In all places where ``community@router'' is accepted, you can add
672           additional parameters for the SNMP communication using colon-
673           separated suffixes. You can also append a pipe symbol ( | ) and the
674           name of a numeric conversion subroutine as described under the
675           global keyword "ConversionCode" above. The full syntax is as
676           follows:
677
678            community@router[:[port][:[timeout][:[retries][:[backoff][:[version]][|name]]]]]
679
680           where the meaning of each parameter is as follows:
681
682           port
683               the UDP port under which to contact the SNMP agent (default:
684               161)
685
686               The complete syntax of the port parameter is
687
688                remote_port[!local_address[!local_port]]
689
690               Some machines have additional security features that only allow
691               SNMP queries to come from certain IP addresses. If the host
692               doing the query has multiple interface, it may be necessary to
693               specify the interface the query should come from.
694
695               The port parameter allows the specification of the port of the
696               machine being queried. In addition, the IP address (or
697               hostname) and port of the machine doing the query may be
698               specified.
699
700               Examples:
701
702                somehost
703                somehost:161
704                somehost:161!192.168.2.4!4000 use 192.168.2.4 and port 4000 as source
705                somehost:!192.168.2.4 use 192.168.2.4 as source
706                somehost:!!4000 use port 4000 as source
707
708           timeout
709               initial timeout for SNMP queries, in seconds (default: 2.0)
710
711           retries
712               number of times a timed-out request will be retried (default:
713               5)
714
715           backoff
716               factor by which the timeout is multiplied on every retry
717               (default: 1.0).
718
719           version
720               for SNMP version. If you have a fast router you might want to
721               put a '2' here.  For authenticated or encrypted SNMP, you can
722               try to put a '3' here.  This will make mrtg try to poll the 64
723               bit counters and thus prevent excessive counter wrapping. Not
724               all routers support this though.  SNMP v3 requires additional
725               setup, see SnmpOptions[] for full details.
726
727               Example:
728
729                3:public@router1:::::2
730
731           name
732               the name of the subroutine that MRTG will call to convert the
733               input and output values to integers. See the complete example
734               under the global keyword "ConversionCode" above.
735
736               Example:
737
738                1.3.6.1.4.1.999.1&1.3.6.1.4.1.999.2:public@mydevice:161::::2|Length2Int
739
740               This would retrieve values from the OID 1.3.6.1.4.1.999.1 for
741               input and .2 for output on mydevice using UDP port 161 and SNMP
742               version 2, and would execute the user-defined numeric
743               conversion subroutine Length2Int to convert those values to
744               integers.
745
746           A value that equals the default value can be omitted.  Trailing
747           colons can be omitted, too. The pipe symbol followed by the name
748           parameter, if present, must come at the end. There must be no
749           spaces around the colons or pipe symbol.
750
751           Example:
752
753             Target[ezci]: 1:public@ezci-ether.domain:9161::4
754
755           This would refer to the input/output octet counters for the
756           interface with ifIndex 1 on ezci-ether.domain, as known by the SNMP
757           agent listening on UDP port 9161.  The standard initial timeout
758           (2.0 seconds) is used, but the number of retries is set to four.
759           The backoff value is the default.
760
761       Numeric IPv6 addresses
762           If IPv6 is enabled you may also specify a target using its IPv6
763           address. To avoid ambiguity with the port number, numeric IPv6
764           addresses must be placed in square brackets.
765
766           Example:
767
768            Target[IPv6test]: 2:public@[2001:760:4::]:6161::4
769
770       External Monitoring Scripts
771           If you want to monitor something which does not provide data via
772           snmp you can use some external program to do the data gathering.
773
774           The external command must return 4 lines of output:
775
776           Line 1
777               current state of the first variable, normally 'incoming bytes
778               count'
779
780           Line 2
781               current state of the second variable, normally 'outgoing bytes
782               count'
783
784           Line 3
785               string (in any human readable format), telling the uptime of
786               the target.
787
788           Line 4
789               string, telling the name of the target.
790
791           Depending on the type of data your script returns you might want to
792           use the 'gauge' or 'absolute' arguments for the Options keyword.
793
794           Example:
795
796            Target[myrouter]: `/usr/local/bin/df2mrtg /dev/dsk/c0t2d0s0`
797
798           Note the use of the backticks (`), not apostrophes (') around the
799           command.
800
801           If you want to use a backtick in the command name this can be done
802           but you must escape it with a backslash ...
803
804           If your script does not have any data to return but does not want
805           mrtg to complain about invalid data, it can return 'UNKNOWN'
806           instead of a number.  Note though that only rrdtool is realy
807           equipped to handle unknown data well.
808
809       Multi Target Syntax
810           You can also combine several target definitions in a mathematical
811           expression.  Any syntactically correct expression that the Perl
812           interpreter can evaluate to will work. An expression could be used,
813           for example, to aggregate both B channels in an ISDN connection or
814           to calculate the percentage hard disk utilization of a server from
815           the absolute used space and total capacity.
816
817           Examples:
818
819            Target[myrouter]: 2:public@wellfleetA + 1:public@wellfleetA
820
821            Target[myrouter]: .1.3.6.1.4.1.999.1&.1.3.6.1.4.1.999.2:public@mydevice /
822                .1.3.6.1.4.1.999.3&.1.3.6.1.4.1.999.4:public@mydevice * 100
823
824           Note that whitespace must surround each target definition in the
825           expression.  Target definitions themselves must not contain
826           whitespace, except in interface descriptions and interface names,
827           where each whitespace character is escaped by a backslash.
828
829           MRTG automatically rounds the result of the expression to an
830           integer unless RRDTool logging is in use and the gauge option is in
831           effect for the target.  Internally MRTG uses Perl's Math::BigFloat
832           package to calculate the result of the expression with 40 digits of
833           precision. Even in extreme cases, where, for example, you take the
834           difference of two 64-bit integers, the result of the expression
835           should be accurate.
836
837       SNMP Request Optimization
838           MRTG is designed to economize on its SNMP requests. Where a target
839           definition appears more than once in the configuration file, MRTG
840           requests the data from the device only once per round of data
841           collection and uses the collected data for each instance of a
842           particular target. Recognition of two target definitions as being
843           identical is based on a simple string match rather than any kind of
844           deeper semantic analysis.
845
846           Example:
847
848            Target[Targ1]: 1:public@CiscoA
849            Target[Targ2]: 2:public@CiscoA
850            Target[Targ3]: 1:public@CiscoA + 2:public@CiscoA
851            Target[Targ4]: 1:public@CISCOA
852
853           This results in a total of three SNMP requests. Data for
854           1:public@CiscoA and 2:public@CiscoA are requested only once each,
855           and used for Targ1, Targ2, and Targ3. Targ4 causes another SNMP
856           request for 1:public@CISCOA, which is not recognized as being
857           identical to 1:public@CiscoA.
858
859   MaxBytes
860       The maximum value either of the two variables monitored are allowed to
861       reach. For monitoring router traffic this is normally the bytes per
862       second this interface port can carry.
863
864       If a number higher than MaxBytes is returned, it is ignored.  Also read
865       the section on AbsMax for further info.  The MaxBytes value is also
866       used in calculating the Y range for unscaled graphs (see the section on
867       Unscaled).
868
869       Since most links are rated in bits per second, you need to divide their
870       maximum bandwidth (in bits) by eight (8) in order to get bytes per
871       second.  This is very important to make your unscaled graphs display
872       realistic information. T1 = 193000, 56K = 7000, 10 MB Ethernet =
873       1250000, 100 MB Ethernet = 12500000. The MaxBytes value will be used by
874       mrtg to decide whether it got a valid response from the router.
875
876       If you need two different MaxBytes values for the two monitored
877       variables, you can use MaxBytes1 and MaxBytes2 instead of MaxBytes.
878
879       Example:
880
881        MaxBytes[myrouter]: 1250000
882
883   Title
884       Title for the HTML page which gets generated for the graph.
885
886       Example:
887
888        Title[myrouter]: Traffic Analysis for Our Nice Company
889

OPTIONAL PER TARGET KEYWORDS

891   PageTop
892       Things to add to the top of the generated HTML page.  Note that you can
893       have several lines of text as long as the first column is empty.
894
895       Note that the continuation lines will all end up on the same line in
896       the html page. If you want linebreaks in the generated html use the
897       '\n' sequence.
898
899       Example:
900
901        PageTop[myrouter]: <H1>Traffic Analysis for ETZ C95.1</H1>
902          Our Campus Backbone runs over an FDDI line\n
903          with a maximum transfer rate of 12.5 megabytes per
904          Second.
905
906   RouterUptime
907       In cases where you calculate the used bandwidth from several interfaces
908       you normaly don't get the router uptime and router name displayed on
909       the web page.
910
911       If these interfaces are on the same router and the uptime and name
912       should be displayed you have to specify its community and address again
913       with the RouterUptime keyword.
914
915       If you want to use a special OID for queriing the router uptime, use
916       prepend the oid.
917
918       Example:
919
920        Target[kacisco.comp.edu]: 1:public@194.64.66.250 + 2:public@194.64.66.250
921        RouterUptime[kacisco.comp.edu]: public@194.64.66.250
922
923        RouterUptime[kacisco.comp.edu]: hrSystemUptime.0:public@194.64.66.250
924
925   RouterName
926       If the default name of the router is incorrect/uninformative, you can
927       use RouterName to specify a different OID on either the same or a
928       different host.
929
930       A practical example: sysName on BayTech DS72 units always display
931       "ds72", no matter what you set the Unit ID to be.  Instead, the Unit ID
932       is stored at 1.3.6.1.4.1.4779.1.1.3.0, so we can have MRTG display this
933       instead of sysName.
934
935       Example:
936
937        RouterName[kacisco.comp.edu]: 1.3.6.1.4.1.4779.1.1.3.0
938
939       A different OID on a different host can also be specified:
940
941        RouterName[kacisco.comp.edu]: 1.3.6.1.4.1.4779.1.1.3.0:public@194.64.66.251
942
943   MaxBytes1
944       Same as MaxBytes, for variable 1.
945
946   MaxBytes2
947       Same as MaxBytes, for variable 2.
948
949   IPv4Only
950       Many IPv6 routers do not currently support SNMP over IPv6 and must be
951       monitored using IPv4. The IPv4Only option forces mrtg to use IPv4 when
952       communicating with the target, even if IPv6 is enabled. This is useful
953       if the target is a hostname with both IPv4 and IPv6 addresses; without
954       the IPv4Only keyword, monitoring such a router will not work if IPv6 is
955       enabled.
956
957       If set to no (the default), mrtg will use IPv6 unless the target has no
958       IPv6 addresses, in which case it will use IPv4. If set to yes, mrtg
959       will only use IPv4.
960
961       Note that if this option is set to yes and the target does not have an
962       IPv4 address, communication with the target will fail.
963
964       This option has no effect if IPv6 is not enabled.
965
966       Example:
967
968        Target[v4onlyrouter_1]: 1:public@v4onlyrouter
969        IPv4Only[v4onlyrouter_1]: Yes
970
971   SnmpOptions (V3)
972       SNMPv3 requires a fairly rich set of options.  This per-target keyword
973       allows access to the User Security Model of SNMPv3.  Options are listed
974       in the same syntax as a perl hash.
975
976       Security Modes
977
978       SNMPv3 has three security modes, defined on the device being polled.
979       For example, on Cisco routers the security mode is defined by the snmp-
980       server group global configuration command.
981
982       NoAuthNoPriv
983           Neither Authentication nor Privacy is defined.  Only the Username
984           option is specified for this mode.
985
986           Example:
987
988            SnmpOptions[myrouter]: username=>'user1'
989
990       AuthNoPriv
991           Uses a Username and a password.  The password can be hashed using
992           the snmpkey application, or passed in plain text along with the
993           ContextEngineID
994
995           Example:
996
997            SnmpOptions[myrouter]: username=>'user1',authpassword=>'example',
998              contextengineid=>'80000001110000004000000'
999
1000       Priv
1001           Both Authentication and Privacy is defined.  The default privacy
1002           protocol is des.
1003
1004           Example:
1005            SnmpOptions[myrouter]:
1006           authkey=>'0x1e93ab5a396e2af234c8920e61cfe2028072c0e2',
1007              authprotocol=>'sha',privprotocol=>'des',username=>'user1',
1008              privkey=>'0x498d74940c5872ed387201d74b9b25e2'
1009
1010       snmp options
1011
1012       The following option keywords are recognized:
1013
1014       username
1015           The user associated with the User Security Model
1016
1017       contextname
1018           An SNMP agent can define multiple contexts.  This keyword allows
1019           them to be polled.
1020
1021       contextengineid
1022           A unique 24-byte string identifying the snmp-agent.
1023
1024       authpassword
1025           The plaintext password for a user in either AuthNoPriv or Priv
1026           mode.
1027
1028       authkey
1029           A md5 or sha hash of the plain-text password, along with the
1030           engineid.  Use the snmpkey commandline program to generate this
1031           hash, or use Net::SNMP::Security::USM in a script.
1032
1033       authprotocol {sha|md5}
1034           The hashing algorithm defined on the SNMP client.  Defaults to md5.
1035
1036       privpassword
1037           A plaintext pre-shared key for encrypting snmp packets in Priv
1038           mode.
1039
1040       privkey
1041           A hash of the plain-text pre-shared key, along with the engineid.
1042           Use the snmpkey commandline program to generate this hash, or use
1043           Net::SNMP::Security::USM in a script.
1044
1045       privprotocol {des|3desede|aescfb128|aescfb192|aescfb256}
1046           Specifies the encryption method defined on the snmp agent.  The
1047           default is des.
1048
1049   PageFoot
1050       Things to add to the bottom of the generated HTML page.  Note that you
1051       can have several lines of text as long as the first column is empty.
1052
1053       Note that the continuation lines will all end up on the same line in
1054       the html page. If you want linebreaks in the generated html use the
1055       '\n' sequence.
1056
1057       The material will be added just before the </BODY> tag:
1058
1059       Example:
1060
1061        PageFoot[myrouter]: Contact <A HREF="mailto:peter@x.yz">Peter</A>
1062         if you have questions regarding this page
1063
1064   AddHead
1065       Use this tag like the PageTop header, but its contents will be added
1066       between </TITLE> and </HEAD>.
1067
1068       Example:
1069
1070        AddHead[myrouter]: <link rev="made" href="mailto:mrtg@blabla.edu">
1071
1072   BodyTag
1073       BodyTag lets you supply your very own <body ...> tag for the generated
1074       webpages.
1075
1076       Example:
1077
1078        BodyTag[myrouter]: <BODY LEFTMARGIN="1" TOPMARGIN="1"
1079                             BACKGROUND="/stats/images/bg.neo2.gif">
1080
1081   AbsMax
1082       If you are monitoring a link which can handle more traffic than the
1083       MaxBytes value. Eg, a line which uses compression or some frame relay
1084       link, you can use the AbsMax keyword to give the absolute maximum value
1085       ever to be reached. We need to know this in order to sort out
1086       unrealistic values returned by the routers. If you do not set AbsMax,
1087       rateup will ignore values higher than MaxBytes.
1088
1089       Example:
1090
1091        AbsMax[myrouter]: 2500000
1092
1093   Unscaled
1094       By default each graph is scaled vertically to make the actual data
1095       visible even when it is much lower than MaxBytes.  With the Unscaled
1096       variable you can suppress this.  It's argument is a string, containing
1097       one letter for each graph you don't want to be scaled: d=day w=week
1098       m=month y=year.  There is also a special case to unset the variable
1099       completely: n=none. This could be useful in the event you need to
1100       override a global configuration. In the example scaling for the yearly
1101       and the monthly graph are suppressed.
1102
1103       Example:
1104
1105        Unscaled[myrouter]: ym
1106
1107   WithPeak
1108       By default the graphs only contain the average values of the monitored
1109       variables - normally the transfer rates for incoming and outgoing
1110       traffic.  The following option instructs mrtg to display the peak 5
1111       minute values in the [w]eekly, [m]onthly and [y]early graph. In the
1112       example we define the monthly and the yearly graph to contain peak as
1113       well as average values.
1114
1115       Examples:
1116
1117        WithPeak[myrouter]: ym
1118
1119   Suppress
1120       By default mrtg produces 4 graphs. With this option you can suppress
1121       the generation of selected graphs.  The option value syntax is
1122       analogous to the above two options.  In this example we suppress the
1123       yearly graph as it is quite empty in the beginning.
1124
1125       Example:
1126
1127        Suppress[myrouter]: y
1128
1129   Extension
1130       By default, mrtg creates .html files. Use this option to tell mrtg to
1131       use a different extension. For example you could set the extension to
1132       php3, then you will be able to enclose PHP tags into the output (useful
1133       for getting a router name out of a database).
1134
1135       Example:
1136
1137        Extension[myrouter]: phtml
1138
1139   Directory
1140       By default, mrtg puts all the files that it generates for each target
1141       (the GIFs, the HTML page, the log file, etc.) in WorkDir.
1142
1143       If the Directory option is specified, the files are instead put into a
1144       directory under WorkDir or Log-, Image- and HtmlDir).  (For example the
1145       Directory option below would cause all the files for a target myrouter
1146       to be put into directory /usr/tardis/pub/www/stats/mrtg/myrouter/ .)
1147
1148       The directory must already exist; mrtg will not create it.
1149
1150       Example:
1151
1152        WorkDir: /usr/tardis/pub/www/stats/mrtg
1153        Directory[myrouter]: myrouter
1154
1155       NOTE: the Directory option must always be 'relative' or bad things will
1156       happen.
1157
1158   Clonedirectory
1159       If the Directory option is specified, the Clonedirectory option will
1160       copy all the contents of Directory to the Clonedirectory.
1161
1162       Example:
1163
1164        WorkDir: /usr/tardis/pub/www/stats/mrtg
1165        Directory[myrouter]: myrouter
1166        Clonedirectory[myrouter]: myclonedirectory
1167
1168       Optionally the target name can be changed in the cloning process.
1169
1170       Example:
1171
1172        WorkDir: /usr/tardis/pub/www/stats/mrtg
1173        Directory[myrouter]: myrouter
1174        Clonedirectory[myrouter]: myclonedirectory mynewtarget
1175
1176       NOTE1: The clone directory must already exist; mrtg will not create it.
1177
1178       NOTE2: The Clonedirectory option must also always be 'relative' or bad
1179       things will happen.
1180
1181       NOTE3: This requires the File::Copy module
1182
1183   XSize and YSize
1184       By default mrtgs graphs are 100 by 400 pixels wide (plus some more for
1185       the labels. In the example we get almost square graphs ...
1186
1187       Note: XSize must be between 20 and 600; YSize must be larger than 20
1188
1189       Example:
1190
1191        XSize[myrouter]: 300
1192        YSize[myrouter]: 300
1193
1194   XZoom and YZoom
1195       If you want your graphs to have larger pixels, you can "Zoom" them.
1196
1197       Example:
1198
1199        XZoom[myrouter]: 2.0
1200        YZoom[myrouter]: 2.0
1201
1202   XScale and YScale
1203       If you want your graphs to be actually scaled use XScale and YScale.
1204       (Beware: while this works, the results look ugly (to be frank) so if
1205       someone wants to fix this: patches are welcome.
1206
1207       Example:
1208
1209        XScale[myrouter]: 1.5
1210        YScale[myrouter]: 1.5
1211
1212   YTics and YTicsFactor
1213       If you want to show more than 4 lines per graph, use YTics.  If you
1214       want to scale the value used for the YLegend of these tics, use
1215       YTicsFactor.  The default value for YTics is 4 and the default value
1216       for YTicsFactor is 1.0 .
1217
1218       Example:
1219
1220       Suppose you get values ranging from 0 to 700.  You want to plot 7 lines
1221       and want to show 0, 1, 2, 3, 4, 5, 6, 7 instead of 0, 100, 200, 300,
1222       400, 500, 600, 700.  You should write then:
1223
1224         YTics[myrouter]: 7
1225         YTicsFactor[myrouter]: 0.01
1226
1227   Factor
1228       If you want to multiply all numbers shown below the graph with a
1229       constant factor, use this directive to define it ..
1230
1231       Example:
1232
1233         Factor[as400]: 4096
1234
1235   Step
1236       Change the default step from 5 * 60 seconds to something else (I have
1237       not tested this much ...)
1238
1239       Example:
1240
1241        Step[myrouter]: 60
1242
1243   PNGTitle
1244       When using rateup for graph generation, this will print the given title
1245       in the graph it generates.
1246
1247       Example:
1248
1249        PNGTitle[myrouter]: WAN Link UK-US
1250
1251   Options
1252       The Options Keyword allows you to set some boolean switches:
1253
1254       growright
1255           The graph grows to the left by default.  This option flips the
1256           direction of growth causing the current time to be at the right
1257           edge of the graph and the history values to the left of it.
1258
1259       bits
1260           All the monitored variable values are multiplied by 8 (i.e. shown
1261           in bits instead of bytes) ... looks much more impressive :-) It
1262           also affects the 'factory default' labeling and units for the given
1263           target.
1264
1265       perminute
1266           All the monitored variable values are multiplied by 60 (i.e. shown
1267           in units per minute instead of units per second) in case of small
1268           values more accurate graphs are displayed.  It also affects the
1269           'factory default' labeling and units for the given target.
1270
1271       perhour
1272           All the monitored variable values are multiplied by 3600 (i.e.
1273           shown in units per hour instead of units per second) in case of
1274           small values more accurate graphs are displayed.  It also affects
1275           the 'factory default' labeling and units for the given target.
1276
1277       noinfo
1278           Suppress the information about uptime and device name in the
1279           generated webpage.
1280
1281       nopercent
1282           Don't print usage percentages.
1283
1284       transparent
1285           Make the background of the generated gifs transparent.
1286
1287       integer
1288           Print summary lines below graph as integers without commas.
1289
1290       dorelpercent
1291           The relative percentage of IN-traffic to OUT-traffic is calculated
1292           and displayed in the graph as an additional line.  Note: Only a
1293           fixed scale is available (from 0 to 100%). Therefore if IN-traffic
1294           is greater than OUT-traffic then 100% is displayed.  If you suspect
1295           that your IN-traffic is not always less than or equal to your OUT-
1296           traffic you are urged to not use this options.  Note: If you use
1297           this option in combination with the Colours options, a fifth
1298           colour-name colour-value pair is required there.
1299
1300       avgpeak
1301           There are some ISPs who use the average Peak values to bill their
1302           customers.  Using this option MRTG displays these values for each
1303           graph. The value is built by averaging the max 5 minute traffic
1304           average for each 'step' shown in the graph. For the Weekly graph
1305           this means that it builds the average of all 2 hour intervals 5
1306           minute peak values. (Confused? Thought so!)
1307
1308       gauge
1309           Treat the values gathered from target as 'current status'
1310           measurements and not as ever incrementing counters.  This would be
1311           useful to monitor things like disk space, processor load,
1312           temperature, and the like ...
1313
1314           In the absence of 'gauge' or 'absolute' options, MRTG treats
1315           variables as a counters and calculates the difference between the
1316           current and the previous value and divides that by the elapsed time
1317           between the last two readings to get the value to be plotted.
1318
1319       absolute
1320           This is for counter type data sources which reset their value when
1321           they are read. This means that rateup does not have to build the
1322           difference between the current and the last value read from the
1323           data source. The value obtained is still divided by the elapsed
1324           time between the current and the last reading, which makes it
1325           different from the 'gauge' option. Useful for external data
1326           gatherers.
1327
1328       derive
1329           If you are using rrdtool as logger/grapher you can use a third type
1330           of data source. Derive is like counter, except that it is not
1331           required to go UP all the time. It is useful for situations where
1332           the change of some value should be graphed.
1333
1334       unknaszero
1335           Log unknown data as zero instead of the default behaviour of
1336           repeating the last value seen. Be careful with this, often a flat
1337           line in the graph is much more obvious than a line at 0.
1338
1339       withzeroes
1340           Normally we ignore all values which are zero when calculating the
1341           average transfer rate on a line. If this is not desirable use this
1342           option.
1343
1344       noborder
1345           If you are using rateup to log data, MRTG will create the graph
1346           images.  Normally these images have a shaded border around them. If
1347           you do not want the border to be drawn, enable this option. This
1348           option has no effect if you are not using rateup.
1349
1350       noarrow
1351           As with the option above, this effects rateup graph generation
1352           only. Normally rateup will generate graphs with a small arrow
1353           showing the direction of the data. If you do not want this arrow to
1354           be drawn, enable this option. This option has no effect if you are
1355           not using rateup.
1356
1357       noi When using rateup for graph generation, you can use this option to
1358           stop rateup drawing a graph for the 'I' or first variable. This
1359           also removes entries for this variable in the HTML page MRTG
1360           generates, and will remove the peaks for this variable if they are
1361           enabled. This allows you to hide this data, or can be very useful
1362           if you are only graphing one line of data rather than two.  This
1363           option is not destructive - any data received for the the variable
1364           continued to be logged, it just isn't shown.
1365
1366       noo Same as above, except relating to the 'O' or second variable.
1367
1368       nobanner
1369           When using rateup for graph generation, this option disables MRTG
1370           adding the MRTG banner to the HTML pages it generates.
1371
1372       nolegend
1373           When using rateup for graph generation, this option will stop MRTG
1374           from creating a legend at the bottom of the HTML pages it
1375           generates.
1376
1377       printrouter
1378           When using rateup for graph generation, this option will print the
1379           router name in the graph it generates.  This option is overridden
1380           by the value of PNGTitle if one is given
1381
1382       pngdate
1383           When using rateup for graph generation, this option will print a
1384           timestamp in the graph it generates, including a timezone if one is
1385           specified by the 'Timezone' parameter.
1386
1387       logscale
1388           The logscale option causes rateup to display the data with the Y
1389           axis scaled logarithmically.  Doing so allows the normal traffic to
1390           occupy the majority of the vertical range, while still showing any
1391           spikes at their full height.
1392
1393           logscale displays all the available data and will always produce
1394           well-behaved graphs.  People often consider a logarithmically
1395           scaled graph counterintuitive, however, and thus hard to interpret.
1396
1397       expscale
1398           The expscale option causes rateup to display the data with the Y
1399           axis scaled exponentially.  Doing so emphasizes small changes at
1400           the top of the scale; this can be useful when graphing values that
1401           fluctuate by a small amount near the top of the scale, such as line
1402           voltage.
1403
1404           expscale is essentially the inverse of logscale.
1405
1406       secondmean
1407           The secondmean option sets the maximum value on the graph to the
1408           mean of the data greater than the mean of all data.  This produces
1409           a graph that focuses more on the typical data, while clipping large
1410           peaks.
1411
1412           Using secondmean will give a more intutive linearly scaled graph,
1413           but can result in a uselessly high or low scale in some rare
1414           situations (specifically, when the data includes a large portion of
1415           values far from the actual mean)
1416
1417           If a target includes both logscale and secondmean in the options,
1418           the secondmean takes precedence.
1419
1420       Example:
1421
1422        Options[myrouter]: growright, bits
1423
1424   kilo
1425       Use this option to change the multiplier value for building prefixes.
1426       Defaultvalue is 1000. This tag is for the special case that 1kB =
1427       1024B, 1MB = 1024kB and so far.
1428
1429       Example:
1430
1431        kilo[myrouter]: 1024
1432
1433   kMG
1434       Change the default multiplier prefixes (,k,M,G,T,P). In the tag
1435       ShortLegend define only the basic units.  Format: Comma separated list
1436       of prefixed. Two consecutive commas or a comma at start or end of the
1437       line gives no prefix on this item.  If you do not want prefixes, just
1438       put two consecutive commas.  If you want to skip a magnitude select '-'
1439       as value.
1440
1441       Example: velocity in nm/s (nanometers per second) displayed in nm/h.
1442
1443        ShortLegend[myrouter]: m/h
1444        kMG[myrouter]: n,u,m,,k,M,G,T,P
1445        options[myrouter]: perhour
1446
1447   Colours
1448       The Colours tag allows you to override the default colour scheme.
1449       Note: All 4 of the required colours must be specified here. The colour
1450       name ('Colourx' below) is the legend name displayed, while the RGB
1451       value is the real colour used for the display, both on the graph and in
1452       the html doc.
1453
1454       Format is: Col1#RRGGBB,Col2#RRGGBB,Col3#RRGGBB,Col4#RRGGBB
1455
1456       Important: If you use the dorelpercent options tag a fifth colour name
1457       colour value pair is required:
1458       Col1#RRGGBB,Col2#RRGGBB,Col3#RRGGBB,Col4#RRGGBB,Col5#RRGGBB
1459
1460       Colour1
1461           First variable (normally Input) on default graph.
1462
1463       Colour2
1464           Second variable (normally Output) on default graph.
1465
1466       Colour3
1467           Max first variable (input).
1468
1469       Colour4
1470           Max second variable (output).
1471
1472       RRGGBB
1473           2 digit hex values for Red, Green and Blue.
1474
1475       Example:
1476
1477        Colours[myrouter]: GREEN#00eb0c,BLUE#1000ff,DARK GREEN#006600,VIOLET#ff00ff
1478
1479   Background
1480       With the Background tag you can configure the background colour of the
1481       generated HTML page.
1482
1483       Example:
1484
1485        Background[myrouter]: #a0a0a0a
1486
1487   YLegend, ShortLegend, Legend[1234]
1488       The following keywords allow you to override the text displayed for the
1489       various legends of the graph and in the HTML document:
1490
1491       YLegend
1492           The Y-axis label of the graph. Note that a text which is too long
1493           to fit in the graph will be silently ignored.
1494
1495       ShortLegend
1496           The units string (default 'b/s') used for Max, Average and Current
1497
1498       Legend[1234IO]
1499           The strings for the colour legend.
1500
1501       Example:
1502
1503         YLegend[myrouter]: Bits per Second
1504         ShortLegend[myrouter]: b/s
1505         Legend1[myrouter]: Incoming Traffic in Bits per Second
1506         Legend2[myrouter]: Outgoing Traffic in Bits per Second
1507         Legend3[myrouter]: Maximal 5 Minute Incoming Traffic
1508         Legend4[myrouter]: Maximal 5 Minute Outgoing Traffic
1509         LegendI[myrouter]: &nbsp;In:
1510         LegendO[myrouter]: &nbsp;Out:
1511
1512       Note, if LegendI or LegendO are set to an empty string with
1513
1514        LegendO[myrouter]:
1515
1516       The corresponding line below the graph will not be printed at all.
1517
1518   Timezone
1519       If you live in an international world, you might want to generate the
1520       graphs in different timezones. This is set in the TZ variable. Under
1521       certain operating systems like Solaris, this will provoke the localtime
1522       call to give the time in the selected timezone.
1523
1524       Example:
1525
1526        Timezone[myrouter]: Japan
1527
1528       The Timezone is the standard timezone of your system, ie Japan,
1529       Hongkong, GMT, GMT+1 etc etc.
1530
1531   Weekformat
1532       By default, mrtg (actually rateup) uses the strftime(3) '%V' option to
1533       format week numbers in the monthly graphs.  The exact semantics of this
1534       format option vary between systems.  If you find that the week numbers
1535       are wrong, and your system's strftime(3) routine supports it, you can
1536       try another format option.  The POSIX '%V' option correspond to the
1537       widely used ISO 8601 week numbering standard.  The week format
1538       character should be specified as a single letter; either W, V, or U.
1539
1540       The UNIX version of rateup uses the libc implementation of strftime.
1541       On Windows, the native strftime implementation does not know about %V.
1542       So there we use a different implementation of strftime that does
1543       support %V.
1544
1545       Example:
1546
1547        Weekformat[myrouter]: W
1548
1549   RRDRowCount
1550       This affects the creation of new rrd files. By default rrds are created
1551       to hold about 1 day's worth of high resolution data. (plus 1 week of 30
1552       minute data, 2 months of 2 hour data and 2 years of 1 day data).  With
1553       this Keyword you can change the number of base interval entries
1554       configured for new rrds as they get created. Note that you must take
1555       the interval time into account.
1556
1557       Example:
1558
1559        RRDRowCount[myrouter]: 1600
1560
1561   RRDRowCount30m
1562       As per RRDRowCount, but for the RRA's -typically- used for 30 minute
1563       data.  Even so, you must still take the base interval into account.
1564       Leaving out this keyword will force the old default of 800 rows.
1565
1566       Example:
1567
1568        RRDRowCount30m[myrouter]: 800
1569
1570   RRDRowCount2h
1571       As per RRDRowCount, but for the RRA's -typically- used for 2 hour data.
1572       Even so, you must still take the base interval into account.  Leaving
1573       out this keyword will force the old default of 800 rows.
1574
1575       Example:
1576
1577        RRDRowCount2h[myrouter]: 400
1578
1579   RRDRowCount1d
1580       As per RRDRowCount, but for the RRA's -typically- used for 1 day data.
1581       Even so, you must still take the base interval into account.  Leaving
1582       out this keyword will force the old default of 800 rows.
1583
1584       Example:
1585
1586        RRDRowCount1d[myrouter]: 200
1587
1588   RRDHWRRAs
1589       Normally the RRDs created by MRTG will just contain the information
1590       gathered directly from the respective target. With this option you can
1591       tap into rrdtools advanced aberrant behaviour detection module based on
1592       Holt-Winters forecasting. The RRDHWRRAs property specifies the Holt-
1593       Winters RRAs as described in the rrdcreate manual page.
1594
1595       Note, this setting will only affect newly created RRDs (targets).
1596
1597       Example:
1598
1599        RRDHWRRAs[myrouter]: RRA:HWPREDICT:1440:0.1:0.0035:288
1600
1601   TimeStrPos
1602       This defines placement of the timestamp string on the image. Possible
1603       values are RU, LU, RL, LL (which stand, respectively, for RightUpper,
1604       LeftUpper, RightLower and LeftLower corner) and NO (for no timestamp).
1605       By default, no timestamp is placed on the image.
1606
1607       Example:
1608
1609        TimeStrPos[myrouter]: RU
1610
1611   TimeStrFmt
1612       Using this keyword you may specify format of the timestamp to be placed
1613       on the image (if enabled by the TimeStrPos keyword). Specified string
1614       will be used by the strftime() function - see strftime(3) documentation
1615       for conversion specifiers available on your system.  Default format:
1616       %Y-%m-%d %H:%M
1617
1618       Example:
1619
1620        TimeStrFmt[myrouter]: %H:%M:%S
1621

THRESHOLD CHECKING

1623       Through its threshold checking functionality mrtg is able to detect
1624       threshold problems for the various targets and can call external
1625       scripts to handle those problems (e.g. send email or a page to an
1626       administrator).
1627
1628       Threshold checking is configured through the following parameters:
1629
1630   ThreshDir (GLOBAL)
1631       By defining ThreshDir to point to a writable directory, MRTG will only
1632       alert you when a threshold boundery has been crossed.
1633
1634       Example:
1635
1636        ThreshDir: /var/mrtg/thresh
1637
1638   ThreshHyst (GLOBAL)
1639       If a threshold is broken, and you have a threshdir defined, then mrtg
1640       will send mail once the threshold becomes 'unborken' to avoid
1641       situations where broken and un-broken messages get sent in close
1642       succession, we only send an unbroken message once the curent value is
1643       0.1 (10%) away from the threshold.  using the ThreshHyst config
1644       variable you can customize this value.
1645
1646       Example for 5%:
1647
1648        ThreshHyst: 0.05
1649
1650   ThreshMailServer (GLOBAL)
1651       Adderss of an SMTP server which is going to accept mail about
1652       Thresholds being broken and unbroken.
1653
1654   ThreshMailSender (GLOBAL)
1655       What is the sender address of the threshold mail.
1656
1657       Example:
1658
1659        ThreshMailSender: mrtg@example.com
1660
1661   ThreshMailAddress (PER TARGET)
1662       Email address for Threshold related Mails. This will only work if a
1663       mailserver has been configured.
1664
1665       Example:
1666
1667        ThreshMailAddress[_]: admin@example.com
1668        ThreshMailAddress[router]:
1669
1670       This would bring threshold releaed mail to all but the target called
1671       'router'.
1672
1673   ThreshMinI  (PER TARGET)
1674       This is the minimum acceptable value for the Input (first) parameter.
1675       If the parameter falls below this value, the program specified in
1676       ThreshProgI will be run and a mail will be sent to the
1677       ThreshMailAddress if specified.  If the value ends in '%' then the
1678       threshold is defined relative to MaxBytes.
1679
1680   ThreshMaxI (PER TARGET)
1681       Works the same as TheshMinI but it acts when the value is higher than
1682       ThreshMaxI.
1683
1684   ThreshDesc (PER TARGET)
1685       Its value will be assigned to the environment variable THRESH_DESC
1686       before any of the programs mentioned below are called. The programs can
1687       use the value of this variable to produce more user-friendly output.
1688
1689   ThreshProgI  (PER TARGET)
1690       This defines a program to be run if ThreshMinI or ThreshMaxI is broken.
1691       MRTG passes 3 arguments: the $router variable, the threshold value
1692       broken, and the current parameter value.
1693
1694   ThreshProgOKI  (PER TARGET)
1695       This defines a program to be run if the parameter is currently OK
1696       (based on ThreshMinI and ThreshMaxI), but wasn't OK on the previous
1697       running -- based on the files found in ThreshDir. MRTG passes 3
1698       arguments: the $router variable the unbroken threshold value, and the
1699       current parameter value.
1700
1701   ThreshMinO, ThreshMaxO, ThreshProgO, and ThreshProgOKO
1702       These work the same as their *I counterparts, except on the Output
1703       (second) parameter.
1704
1705   SetEnv
1706       When calling threshold scripts from within your cfg file you might want
1707       to pass some data on to the script. This can be done with the SetEnv
1708       configuration option which takes a series of environment variable
1709       assignments. Note that the quotes are mandatory. This does not work for
1710       external scripts. It is not possible to set environment variables per
1711       target.
1712
1713       Example:
1714
1715        SetEnv[myrouter]:  EMAIL="contact_email@someplace.net"
1716                           HOST="www.some_server.net"
1717
1718   HW Failure Bassed Threshold Checking
1719       When using rrd based logging with HW RRAs defined. You can use the
1720       confidence bounds violations stored in the FAILURES RRA for threshold
1721       based alerts.
1722
1723       There the all target specific threshold variables have a Hold-Winters
1724       counterpart:
1725
1726        ThreshMailAddress -> HWThreshMailAddress
1727        ThreshMinI        -> HWThreshMinI
1728        ...
1729
1730       The global variables for threshold checking are shared except for the
1731
1732        ThreshHyst        -> HWThreshHyst
1733
1734       And HWThreshDesc sets the HWTHRESH_DESC variable.
1735

PER TARGET DEFAULT VALUES

1737   Pre- and Postfix
1738       To save yourself some typing you can define a target called '^'. The
1739       text of every Keyword you define for this target will be PREPENDED to
1740       the corresponding Keyword of all the targets defined below this line.
1741       The same goes for a Target called '$' but its text will be APPENDED.
1742
1743       Note that a space is inserted between the prepended text and the
1744       Keyword value, as well as between the Keyword value and the appended
1745       text. This works well for text-valued Keywords, but is not very useful
1746       for other Keywords. See the "default" target description below.
1747
1748       The example will make mrtg use a common header and a common contact
1749       person in all the pages generated from targets defined later in this
1750       file.
1751
1752       Example:
1753
1754        PageTop[^]: <H1>NoWhere Unis Traffic Stats</H1><HR>
1755        PageTop[$]: Contact Peter Norton if you have any questions<HR>
1756
1757       To remove the prepend/append value, specify an empty value, e.g.:
1758
1759        PageTop[^]:
1760        PageTop[$]:
1761
1762   NoSpaceChar
1763       With PREPEND and APPEND (see below) there is normally a space inserted
1764       between the local value and the PRE- or APPEND value. Sometimes this is
1765       not desirable. You can use the global option NoSpaceChar to define a
1766       character which can be mentioned at the end of a $ or ^ definition in
1767       order to supress the space.
1768
1769       Example:
1770
1771         NoSpaceChar: ~
1772         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@~
1773         Target[a]: a.tolna.net
1774         Target[b]: b.tolna.net
1775         Target[c]: c.tolna.net
1776         Target[d]: d.tolna.net
1777
1778   Default Values
1779       The target name '_' specifies a default value for that Keyword. In the
1780       absence of explicit Keyword value, the prepended and the appended
1781       keyword value, the default value will be used.
1782
1783       Example:
1784
1785        YSize[_]: 150
1786        Options[_]: growright,bits,nopercent
1787        WithPeak[_]: ymw
1788        Suppress[_]: y
1789        MaxBytes[_]: 1250000
1790
1791       To remove the default value and return to the 'factory default',
1792       specify an empty value, e.g.:
1793
1794        YLegend[_]:
1795
1796       There can be several instances of setting the default/prepend/append
1797       values in the configuration file. The later setting replaces the
1798       previous one for the rest of the configuration file.  The
1799       default/prepend/append values used for a given keyword/target pair are
1800       the ones that were in effect at the point in the configuration file
1801       where the target was mentioned for the first time.
1802
1803       Example:
1804
1805        MaxBytes[_]: 1250000
1806        Target[myrouter.somplace.edu.2]: 2:public@myrouter.somplace.edu
1807        MaxBytes[_]: 8000
1808        Title[myrouter.somplace.edu.2]: Traffic Analysis for myrouter.somplace.edu IF 2
1809
1810       The default MaxBytes for the target myrouter.someplace.edu.2 in the
1811       above example will be 1250000, which was in effect where the target
1812       name myrouter.someplace.edu.2 first appeared in the config file.
1813

COMMAND LINE OPTIONS

1815       --user username  and --group groupname
1816           Run as the given user and/or group. (Unix Only)
1817
1818       --lock-file filename
1819           Use an alternate lock-file (the default is to use the
1820           configuration-file appended with "_l").
1821
1822       --confcache-file filename
1823           Use an alternate confcache-file (the default is to use the
1824           configuration-file appended with ".ok")
1825
1826       --logging filename|eventlog
1827           If this is set to writable filename, all output from mrtg
1828           (warnings, debug messages, errors) will go to filename. If you are
1829           running on Win32 you can specify eventlog instead of a filename
1830           which will send all error to the windows event log.
1831
1832           NOTE: Note, there is no Message DLL for mrtg included with mrtg.
1833           This has the side effect that the windows event logger will display
1834           a nice message with every entry in the event log, complaing about
1835           the fact that mrtg has no message dll. If you go to the mrtg
1836           contrib download area (on the website) you will find the
1837           mrtg-message-dll.zip which does contain such a thing.
1838
1839       --daemon
1840           Put MRTG into the background, running as a daemon. This works the
1841           same way as the config file option, but the switch is required for
1842           proper FHS operation (because /var/run is writable only by root)
1843
1844       --fhs
1845           Configure all mrtg paths to conform to the FHS specification;
1846           http://www.pathname.com/fhs/
1847
1848       --check
1849           Only check the cfg file for errors. Do not do anything.
1850
1851       --pid-file=s
1852           Define the name and path of the pid file for mrtg running as a
1853           daemon
1854
1855       --debug=s
1856           Enable debug options. The argument of the debug option is a comma
1857           separated list of debug values:
1858
1859            cfg  - watch the config file reading
1860            dir  - directory mangeling
1861            base - basic program flow
1862            tarp - target parser
1863            snpo - snmp polling
1864            coca - confcache operations
1865            fork - forking view
1866            time - some timing info
1867            log  - logging of data via rateup or rrdtool
1868            eval - print eval strings before evaluting them
1869            prof - add hires timing info the rrd calls
1870
1871           Example:
1872
1873            --debug="cfg,snpo"
1874

EXIT CODES

1876       An exit code of 0 indicates that all targets were successful.
1877       Generally speaking, most codes greater than 0 indicate that there was
1878       an unrecoverable problem.  One exception to this is code 91, which
1879       indicates that at least one of the targets was successful.  A partial
1880       listing of the codes follows:
1881
1882         0: All targets sucessful
1883
1884         2: Config error (can't read, fatal error in config, etc)
1885        17: Another MRTG process is processing config
1886
1887        91: At least one target sucessful
1888        92: No targets were sucessful
1889

EXAMPLES

1891   Minimal mrtg.cfg
1892        WorkDir: /usr/tardis/pub/www/stats/mrtg
1893        Target[r1]: 2:public@myrouter.somplace.edu
1894        MaxBytes[r1]: 8000
1895        Title[r1]: Traffic Analysis ISDN
1896        PageTop[r1]: <H1>Stats for our ISDN Line</H1>
1897
1898   Cfg for several Routers.
1899        WorkDir: /usr/tardis/pub/www/stats/mrtg
1900        Title[^]: Traffic Analysis for
1901        PageTop[^]: <H1>Stats for
1902        PageTop[$]: Contact The Chief if you notice anybody<HR>
1903        MaxBytes[_]: 8000
1904        Options[_]: growright
1905
1906        Title[isdn]: our ISDN Line
1907        PageTop[isdn]: our ISDN Line</H1>
1908        Target[isdn]: 2:public@router.somplace.edu
1909
1910        Title[backb]: our Campus Backbone
1911        PageTop[backb]: our Campus Backbone</H1>
1912        Target[backb]: 1:public@router.somplace.edu
1913        MaxBytes[backb]: 1250000
1914
1915        # the following line removes the default prepend value
1916        # defined above
1917
1918        Title[^]:
1919
1920        Title[isdn2]: Traffic for the Backup ISDN Line
1921        PageTop[isdn2]: our ISDN Line</H1>
1922        Target[isdn2]: 3:public@router.somplace.edu
1923

AUTHOR

1925       Tobias Oetiker <tobi@oetiker.ch> and many contributors
1926
1927
1928
19292.16.4                            2010-05-17                 MRTG-REFERENCE(1)
Impressum