File: mrtg-conf.pod

package info (click to toggle)
mrtg 2.5.4c-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 956 kB
  • ctags: 488
  • sloc: perl: 4,995; ansic: 2,133; makefile: 204; csh: 49; sh: 40
file content (780 lines) | stat: -rw-r--r-- 19,986 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
=for html
<img src="/usr/doc/mrtg/mrtg-ti.gif">

=head1 Multi Router Traffic Grapher -- Configuration File Format

This file is for use with mrtg-2.5.3

Note:

=over 4

=item * 

Keywords must start at the beginning of a line.

=item * 

Lines which follow a keyword line which do start 
with a blank are appended to the keyword line

=item * 

Empty Lines are ignored

=item * 

Lines starting with a # sign are comments.

=back

=head1 Global Configuration 

Workdir specifies where the logfiles and the webpages should 
be created.

Example:

 WorkDir: /usr/tardis/pub/www/stats/mrtg

=head1 Optional Global Parameters

=head2 Refresh

How many seconds apart should the browser (Netscape) be 
 instructed to reload the page? If this is not defined, the 
 default is 300 seconds (5 minutes).

Example:

 Refresh: 600

=head2 Interval

How often do you call mrtg? The default is 5 minutes. If
you call it less often, you should specify it here. This
does two things:

=over 4

=item *

the generated HTML page does contain the right
information about the calling interval ...

=item *

a META header in the generated HTML page will instruct
caches about the time to live of this page .....

=back


In this example we tell mrtg that we will be calling it
every 10 minutes. If you are calling mrtg every 5
minutes, you can leave this line commented out.

Example:

 Interval: 10

=head2 WriteExpires

With this switch mrtg will generate .meta files for CERN
and Apache servers which contain Expiration tags for the
html and gif files. The *.meta files will be created in
the same directory as the other files, so you might have
to set "MetaDir ." in your srm.conf file for this to work

NOTE: If you are running Apache-1.2 you can use the mod_expire
to achieve the same effect ... see the file htaccess-dist

Example:

 WriteExpires: Yes

=head2 IconDir

If you want to keep the mrtg icons in some place other than the 
working directory, use the I<IconDir> variable to give its url.

Example:

 IconDir: /mrtgicons/

=head1 Configuration for each Target you want to monitor

The configuration keywords I<Target> must be followed by a
 unique name. This will also be the name used for the
 webpages, logfiles and gifs created for that target.

Note that the I<Target> sections can be auto-generated with
the B<cfgmaker> tool. Check F<readme.html> for instructions.

=head2 Target

With the I<Target> keyword you tell mrtg what it should
monitor. The I<Target> keyword takes arguments in a wide
range of formats:

=over 4

=item * 

The most basic format is "port:community@router"
This will generate a traffic graph for the interface 'port'
of the host 'router' (dns name or IP address)
and it will use the community 'community' (snmp password)
for the snmp query.

Example:

 Target[ezwf]: 2:public@wellfleet-fddi.ethz.ch

=item * 

Sometimes you are sitting on the wrong side of the
link, and you would like to have mrtg report Incoming
traffic as outgoing and vice versa. This can be achieved
by adding the '-' sign in front of the "Target"
description. It flips the incoming and outgoing traffic rates.

Example:

 Target[ezci]: -1:public@ezci-ether.ethz.ch

=item * 

You can also explicitly define the OID to query by using the
following syntax 'OID_1&OID_2:community@router'
The following example will retrieve error counts for input and output
on interface 1.  MRTG needs to graph two variables,
so you need to specify two OID's such as temperature and humidity
or error input and error output.

Example:

 Target[ezwf]: 1.3.6.1.2.1.2.2.1.14.1&1.3.6.1.2.1.2.2.1.20.1:public@myrouter

=item * 

MRTG knows a number of symbolical SNMP variable names.
See the file mibhelp.txt for a list of known names.
One example are the ifInErrors and ifOutErrors.
This means you can specify the above as:

Example:

 Target[ezwf]: ifInErrors.1&ifOutErrors.1:public@myrouter

=for html
<A NAME="Target-SNMP-Parameters"></A>

=item *

In all places where ``community@router'' is accepted, you can add
additional parameters for the SNMP communication using
colon-separated suffixes. The full syntax is as follows:

 community@router[:port[:timeout[:retries[:backoff]]]]

where the meaning of each parameter is as follows:

=over 4

=item port

the UDP port under which to contact the SNMP agent (default: 161)

=item timeout

initial timeout for SNMP queries, in seconds (default: 2.0)

=item retries

number of times a timed-out request will be retried (default: 5)

=item backoff

factor by which the timeout is multiplied on every retry (default: 1.0).

=back

A value that equals the default value can be omitted.  Trailing colons
can be omitted, too.

Example:

 Target[ezci]: 1:public@ezci-ether.ethz.ch:9161::4

This would refer to the input/output octet counters for the interface
with I<ifIndex 1> on I<ezci-ether.ethz.ch>, as known
by the SNMP agent listening on UDP port 9161.  The standard initial
timeout (2.0 seconds) is used, but the number of retries is set to
four.  The backoff value is the default.

=item * 

if you want to monitor something which does not provide
data via snmp you can use some external program to do
the data gathering.

The external command must return 4 lines of output:

=over 8

=item Line 1

current state of the first variable, normally 'incoming bytes count'

=item Line 2

current state of the second variable, normally 'outgoing bytes count'
   

=item Line 3

string (in any human readable format), telling the uptime of the target.

=item Line 4

string, telling the name of the target. 

=back

Depending on the type of data your script returns you
might want to use the 'gauge' or 'absolute' arguments
for the I<Options> keyword.

Example:

 Target[ezwf]: `/usr/local/bin/df2mrtg /dev/dsk/c0t2d0s0`

Note the use of the backticks (`), not apostrophes (')
around the command.

=item * 

You can also use several statements in a mathematical 
expression.  This could be used to aggregate both B channels
in an ISDN connection or multiple T1s that are aggregated
into a single channel for greater bandwidth.
Note the whitespace arround the target definitions.

Example:

 Target[ezwf]: 2:public@wellfleetA + 1:public@wellfleetA
              * 4:public@ciscoF

=back

=head2 RouterUptime

In cases where you calculate the used bandwidth from
several interfaces you normaly don't get the router uptime
and router name displayed on the web page.

If these interfaces are on the same router and the uptime and
name should be displayed nevertheless you have to specify
its community and address again with the I<RouterUptime> keyword.


Example:

 Target[kacisco.comp.edu]: 1:public@194.64.66.250 + 2:public@194.64.66.250
 RouterUptime[kacisco.comp.edu]: public@194.64.66.250

=head2 MaxBytes

The maximum value either of the two variables monitored
are allowed to reach. For monitoring router traffic
this is normally specified in bytes per second this
interface port can carry.

If a number higher than I<MaxBytes> is returned, it is ignored.
Also read the section on I<AbsMax> for further info.
The I<MaxBytes> value is also used in calculating the Y range
for unscaled graphs (see the section on I<Unscaled>).

Since most links are rated in bits per second, you need to divide
their maximum bandwidth (in bits) by eight (8) in order to get
bytes per second.  This is very important to make your
unscaled graphs display realistic information.  
T1 = 193000, 56K = 7000, Ethernet = 1250000. The I<MaxBytes>
value will be used by mrtg to decide whether it got a
valid response from the router.

Example:

 MaxBytes[ezwf]: 1250000

=head2 Title 

Title for the HTML page which gets generated for the graph.

Example:

 Title[ezwf]: Traffic Analysis for Our Nice Company

=head2 PageTop

Things to add to the top of the generated HTML page.  Note
that you can have several lines of text as long as the
first column is empty.

Note that the continuation lines will all end up on the same
line in the html page. If you want linebreaks in the generated 
html use the '\n' sequence.

Example:

 PageTop[ezwf]: <H1>Traffic Analysis for ETZ C95.1</H1>
  Our Campus Backbone runs over an FDDI line\n
  with a maximum transfer rate of 12.5 megabytes per
  Second.


=head1 Optional Target Configuration Tags


=head2 AddHead

Use this tag like the I<PageTop> header, but its contents
will be added between </TITLE> and </HEAD>.

Example:

 AddHead[ezwf]: <link rev="made" href="mailto:mrtg@blabla.edu">

=head2 AbsMax 

If you are monitoring a link which can handle more traffic
than the I<MaxBytes> value. Eg, a line which uses compression
or some frame relay link, you can use the I<AbsMax> keyword
to give the absolute maximum value ever to be reached.
We need to know this in order to sort out unrealistic values
returned by the routers. If you do not set I<AbsMax>, rateup
will ignore values higher then I<MaxBytes>.

Example:

 AbsMax[ezwf]: 2500000

=head2 Unscaled

By default each graph is scaled vertically to make the
actual data visible even when it is much lower than
I<MaxBytes>.  With the I<Unscaled> variable you can suppress
this.  It's argument is a string, containing one letter
for each graph you don't want to be scaled: d=day w=week
m=month y=year.  In the example scaling for the
yearly and the monthly graph are suppressed.

Example:

 Unscaled[ezwf]: ym

=head2 WithPeak

By default the graphs only contain the average
values of the monitored variables - normally the
transfer rates for incoming and outgoing traffic.
The following option instructs mrtg to display the peak
5 minute values in the [w]eekly, [m]onthly and
[y]early graph. In the example we define the monthly
and the yearly graph to contain peak as well as average
values.

Examples:

 WithPeak[ezwf]: ym

=head2 Suppress

By default mrtg produces 4 graphs. With this option
you can suppress the generation of selected graphs.
The option value syntax is analogous to the above two options.
In this example we suppress the yearly graph
as it is quite empty in the beginning.

Example:

 Suppress[ezwf]: y

=head2 Directory

By default, mrtg puts all the files that it generates for each
target (the GIFs, the HTML page, the log file, etc.) in I<WorkDir>.

If the I<Directory> option is specified, the files are instead put
into a directory under I<WorkDir>.  (For example the I<Directory>
option below would cause all the files for a target ezwf
to be put into directory /usr/tardis/pub/www/stats/mrtg/ezwf/ .)

The directory must already exist; mrtg will not create it.

Example:

 WorkDir: /usr/tardis/pub/www/stats/mrtg
 Directory[ezwf]: ezwf

=head2 XSize and YSize

By default mrtgs graphs are 100 by 400 pixels wide (plus
some more for the labels. In the example we get almost
square graphs ...

Note: XSize must be between 20 and 600; YSize must be larger than 20

Example:

 XSize[ezwf]: 300
 YSize[ezwf]: 300

=head2 XZoom and YZoom

If you want your graphs to have larger pixels, you can
"Zoom" them.

Example:

 XZoom[ezwf]: 2.0
 YZoom[ezwf]: 2.0

=head2 XScale and YScale

If you want your graphs to be actually scaled use I<XScale>
and I<YScale>. (Beware while this works, the results look ugly 
(to be frank) so if someone wants to fix this: patches are welcome.

Example:

 XScale[ezwf]: 1.5
 YScale[ezwf]: 1.5


=head2 Step

Change the default step from 5 * 60 seconds to 
something else (I have not tested this well ...)

Example:

 Step[ezwf]: 60

=head2 Options

The I<Options> Keyword allows you to set some boolean 
switches:

=over 4

=item growright 

The graph grows to the left by default.
This option flips the direction of growth
causing the current time to be at the right edge
of the graph and the history values to the left of it.

=item bits 

All the monitored variable values are multiplied by 8
(i.e. shown in bits instead of bytes) ... looks much more impressive :-)
It also affects the 'factory default' labeling and units
for the given target.

=item noinfo

Suppress the information about uptime and
device name in the generated webpage.

=item nopercent

Don't print usage percentages

=item gauge

Treat the values gathered from target as absolute
and not as ever incrementing counters.
This would be useful to monitor things like disk space,
processor load, temperature, and the like ...

In the absence of 'gauge' and 'absolute' options,
MRTG treats variable as a counter and calculates
the difference between the current and the previous value
and divides that by the elapsed time between
the last two readings to get the value to be plotted.

=item absolute

This is for data sources which reset their 
value when they are read. This means that 
rateup has not to build the difference between 
this and the last value read from the data
source. The value obtained is still divided
by the elapsed time between the last two readings,
which makes it different from the 'gauge' option.
Useful for external data gatherers.

=back

Example:

 Options[ezwf]: growright, bits


=head2 Colours

The I<Colours> tag allows you to override the default colour
scheme.  Note: All 4 of the required colours must be
specified here. The colour name ('Colourx' below) is the
legend name displayed, while the RGB value is the real
colour used for the display, both on the graph and in the
html doc.

Format is: Colour1#RRGGBB,Colour2#RRGGBB,Colour3#RRGGBB,Colour4#RRGGBB

=over 4

=item Colour1

First variable (normally Input) on default graph

=item Colour2

Second variable (normally Output) on default graph

=item Colour3

Max first variable (input)

=item Colour4

Max second variable (output)

=item RRGGBB

2 digit hex values for Red, Green and Blue

=back 

Example:

 Colours[ezwf]: GREEN#00eb0c,BLUE#1000ff,DARK GREEN#006600,VIOLET#ff00ff

=head2 Background

With the I<Background> tag you can configure the background
colour of the generated HTML page

Example:

 Background[ezwf]: #a0a0a0a

=head2 YLegend, ShortLegend, Legend[1234]

The following keywords allow you to override the text
displayed for the various legends of the graph and in the
HTML document

=over 4

=item YLegend

The Y-axis label of the graph. Note that a text which is too long
to fit in the graph will be silently ignored.

=item ShortLegend

The units string (default 'b/s') used for Max, Average and Current

=item Legend[1234IO]

The strings for the colour legend

=back

Example:

  YLegend[ezwf]: Bits per Second
  ShortLegend[ezwf]: b/s
  Legend1[ezwf]: Incoming Traffic in Bits per Second
  Legend2[ezwf]: Outgoing Traffic in Bits per Second
  Legend3[ezwf]: Maximal 5 Minute Incoming Traffic
  Legend4[ezwf]: Maximal 5 Minute Outgoing Traffic
  LegendI[ezwf]: &nbsp;In:
  LegendO[ezwf]: &nbsp;Out:

Note, if I<LegendI> or I<LegendO> are set to an empty string with

 LegendO[ezwf]:

The corresponding line below the graph will not be printed at all.

=head2 Timezone

If you live in an international world, you might want to 
generate the graphs in different timezones. This is set in the 
TZ variable. Under certain operating systems like Solaris, 
this will provoke the localtime call to give the time in 
the selected timezone ...

Example:

 Timezone[ezwf]: Japan

The Timezone is the standard Solaris timezone, ie Japan, Hongkong,
GMT, GMT+1 etc etc.

=head2 Weekformat

By default, mrtg (actually rateup) uses the strftime(3) '%W' option
to format week numbers in the monthly graphs.  The exact semantics
of this format option vary between systems.  If you find that the
week numbers are wrong, and your system's strftime(3) routine
supports it, you can try another format option.  The POSIX '%V'
option seems to correspond to a widely used week numbering
convention.  The week format character should be specified as a
single letter; either W, V, or U.

Example:

 Weekformat[ezwf]: V
 

=head1 Two very special Target names

To save yourself some typing you can define a target
called '^'. The text of every Keyword you define for this
target will be PREPENDED to the corresponding Keyword of
all the targets defined below this line. The same goes for
a Target called '$' but its text will be APPENDED.

Note that a space is inserted between the prepended text
and the Keyword value, as well as between the Keyword value
and the appended text. This works well for text-valued Keywords,
but is not very useful for other Keywords. See the "default"
target description below.

The example will make mrtg use a common header and a
common contact person in all the pages generated from
targets defined later in this file.

Example:

 PageTop[^]: <H1>NoWhere Unis Traffic Stats</H1><HR>
 PageTop[$]: Contact Peter Norton if you have any questions<HR>

To remove the prepend/append value, specify an empty value, e.g.:

 PageTop[^]:
 PageTop[$]:

=head1 And one more very special Target name

The target name '_' specifies a default value for that
Keyword. In the absence of explicit Keyword value, the prepended
and the appended keyword value, the default value will be used.

Example:

 YSize[_]: 150
 Options[_]: growright,bits,nopercent
 WithPeak[_]: ymw
 Suppress[_]: y
 MaxBytes[_]: 1250000

To remove the default value and return to the 'factory default',
specify an empty value, e.g.:

 YLegend[_]:

There can be several instances of setting the default/prepend/append
values in the configuration file. The later setting replaces the
previous one for the rest of the configuration file.
The default/prepend/append values used for a given
keyword/target pair are the ones that were in effect
at the point in the configuration file where the target
was mentioned for the first time.

Example:

 MaxBytes[_]: 1250000
 Target[myrouter.somplace.edu.2]: 2:public@myrouter.somplace.edu
 MaxBytes[_]: 8000
 Title[myrouter.somplace.edu.2]: Traffic Analysis for myrouter.somplace.edu IF 2

The default I<MaxBytes> for the target myrouter.somplace.edu.2
in the above example will be 1250000, which was in effect
where the target name myrouter.somplace.edu.2 first appeared
in the config file.


=head1 Some example mrtg.cfg files


=head2 Minimal mrtg.cfg

 WorkDir: /usr/tardis/pub/www/stats/mrtg
 Target[r1]: 2:public@myrouter.somplace.edu
 MaxBytes[r1]: 64000
 Title[r1]: Traffic Analysis ISDN
 PageTop[r1]: <H1>Stats for our ISDN Line</H1>


=head2 Cfg for several Routers.

 WorkDir: /usr/tardis/pub/www/stats/mrtg
 Title[^]: Traffic Analysis for
 PageTop[^]: <H1>Stats for
 PageTop[$]: Contact The Chief if you notice anybody<HR>
 MaxBytes[_]: 64000
 Options[_]: growright

 Title[isdn]: our ISDN Line
 PageTop[isdn]: our ISDN Line</H1>
 Target[isdn]: 2:public@router.somplace.edu
 
 Title[backb]: our Campus Backbone
 PageTop[backb]: our Campus Backbone</H1>
 Target[backb]: 1:public@router.somplace.edu
 MaxBytes[backb]: 1250000

 # the following line removes the default prepend value
 # defined above

 Title[^]:

 Title[isdn2]: Traffic for the Backup ISDN Line
 PageTop[isdn2]: our ISDN Line</H1>
 Target[isdn2]: 3:public@router.somplace.edu


=begin html
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
  <TR>
    <TD WIDTH=63><A ALT="MRTG"
    HREF="http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html"><IMG
    BORDER=0 SRC="/usr/doc/mrtg/mrtg-l.gif"></A></TD>
    <TD WIDTH=25><A ALT=""
    HREF="http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html"><IMG
    BORDER=0 SRC="/usr/doc/mrtg/mrtg-m.gif"></A></TD>
    <TD WIDTH=388><A ALT=""
    HREF="http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html"><IMG
    BORDER=0 SRC="/usr/doc/mrtg/mrtg-r.gif"></A></TD>
  </TR>
</TABLE>
<SPACER TYPE=VERTICAL SIZE=4>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
  <TR VALIGN=top>
  <TD WIDTH=88 ALIGN=RIGHT><FONT FACE="Arial,Helvetica" SIZE=2>
  2.5.2-1998/2/6</FONT></TD>
  <TD WIDTH=388 ALIGN=RIGHT><FONT FACE="Arial,Helvetica" SIZE=2>
  <A HREF="http://ee-staff.ethz.ch/~oetiker/">Tobias Oetiker</A>
  <A HREF="mailto:oetiker@ee.ethz.ch">&lt;oetiker@ee.ethz.ch&gt;</A> 
  and&nbsp;<A HREF="http://www.bungi.com">Dave&nbsp;Rand</A>&nbsp;<A HREF="mailto:dlr@bungi.com">&lt;dlr@bungi.com&gt;</A></FONT>
  </TD>
</TR>
</TABLE>

=end html