File: mrtg-reference.1

package info (click to toggle)
mrtg 2.17.10-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,332 kB
  • sloc: perl: 25,747; ansic: 4,568; sh: 1,518; php: 227; awk: 225; makefile: 196; csh: 49; exp: 16
file content (2447 lines) | stat: -rw-r--r-- 84,321 bytes parent folder | download | duplicates (2)
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
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "MRTG-REFERENCE 1"
.TH MRTG-REFERENCE 1 "2022-01-19" "2.17.10" "mrtg"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
mrtg\-reference \- MRTG 2.17.10 configuration reference
.SH "OVERVIEW"
.IX Header "OVERVIEW"
The runtime behaviour of \s-1MRTG\s0 is governed by a configuration file.
Run-of-the-mill configuration files can be generated with \fBcfgmaker\fR.
(Check cfgmaker). But for more elaborate configurations some hand-tuning
is required.
.PP
This document describes all the configuration options understood by
the mrtg software.
.SH "SYNTAX"
.IX Header "SYNTAX"
\&\s-1MRTG\s0 configuration file syntax follows some simple rules:
.IP "\(bu" 4
Keywords must start at the beginning of a line.
.IP "\(bu" 4
Lines which follow a keyword line which start
with a blank are appended to the keyword line
.IP "\(bu" 4
Empty Lines are ignored
.IP "\(bu" 4
Lines starting with a # sign are comments.
.IP "\(bu" 4
You can add other files into the configuration file using
.Sp
\&\fBInclude:\fR \fIfile\fR
.Sp
Example:
.Sp
.Vb 1
\& Include: base\-options.inc
.Ve
.Sp
If included files are specified with relative paths, both the current
working directory and the directory containing the main config file will
be searched for the files.  The current working directory will be searched
first.
.Sp
If the included filename contains an asterisk, then this is taken as a
wildcard for zero or more characters, and all matching files are included.
Thus, you can use this statement to include all files in a specified
subdirectory.
.Sp
Example:
.Sp
.Vb 1
\& Include: servers/*.cfg
.Ve
.Sp
In this case, you should be very careful that your wildcard pattern does not
find a match relative to the current working directory if you mean it to be
relative to the main config file directory, since the working directory is 
checked for a match first (as with a normal Include directive).  Therefore,
use of something like '*/*' is discouraged.
.SH "GLOBAL KEYWORDS"
.IX Header "GLOBAL KEYWORDS"
.SS "WorkDir"
.IX Subsection "WorkDir"
WorkDir specifies where the logfiles and the webpages should
be created.
.PP
Example:
.PP
.Vb 1
\& WorkDir: /usr/tardis/pub/www/stats/mrtg
.Ve
.SH "OPTIONAL GLOBAL KEYWORDS"
.IX Header "OPTIONAL GLOBAL KEYWORDS"
.SS "HtmlDir"
.IX Subsection "HtmlDir"
HtmlDir specifies the directory where the html (or shtml,
but we'll get on to those later) lives.
.PP
\&\s-1NOTE:\s0 Workdir overrides the settings for htmldir, imagedir
and logdir.
.PP
Example:
.PP
.Vb 1
\& Htmldir: /www/mrtg/
.Ve
.SS "ImageDir"
.IX Subsection "ImageDir"
ImageDir specifies the directory where the images live. They
should be under the html directory.
.PP
Example:
.PP
.Vb 1
\& Imagedir: /www/mrtg/images
.Ve
.SS "LogDir"
.IX Subsection "LogDir"
LogDir specifies the directory where the logs are stored.
This need not be under htmldir directive.
.PP
Example:
.PP
.Vb 1
\& Logdir: /www/mrtg/logs
.Ve
.SS "Forks (\s-1UNIX\s0 only)"
.IX Subsection "Forks (UNIX only)"
With system that supports fork (\s-1UNIX\s0 for example), mrtg can fork itself into multiple
instances while it is acquiring data via snmp.
.PP
For situations with high latency or a great number of devices
this will speed things up considerably. It will not make things faster,
though, if you query a single switch sitting next door.
.PP
As far as I know \s-1NT\s0 can not fork so this option is not available on \s-1NT.\s0
.PP
Example:
.PP
.Vb 1
\& Forks: 4
.Ve
.SS "EnableIPv6"
.IX Subsection "EnableIPv6"
When set to yes, IPv6 support is enabled if the required libraries are
present (see the mrtg\-ipv6 manpage). When IPv6 is enabled, mrtg can talk
to routers using \s-1SNMP\s0 over IPv6 and targets may be specified by their
numeric IPv6 addresses as well as by hostname or IPv4 address.
.PP
If IPv6 is enabled and the target is a hostname, mrtg will try to resolve
the hostname to an IPv6 address and, if this fails, to an IPv4 address.
Note that mrtg will only use IPv4 if you specify an IPv4 address or a
hostname with no corresponding IPv6 address; it will not fall back to IPv4
if it simply fails to communicate with the target using IPv6. This is by
design.
.PP
Note that many routers do not currently support \s-1SNMP\s0 over IPv6. Use the
\&\fIIPv4Only\fR per target option for these routers.
.PP
IPv6 is disabled by default.
.PP
Example:
.PP
.Vb 1
\& EnableIPv6: Yes
.Ve
.SS "EnableSnmpV3"
.IX Subsection "EnableSnmpV3"
When set to yes, uses the Net::SNMP module instead of the \s-1SNMP_SESSION\s0 module for
generating snmp queries.  This allows the use of SNMPv3 if other snmpv3 parameters
are set.
.PP
SNMPv3 is disabled by default.
.PP
Example:
.PP
.Vb 1
\& EnableSnmpV3: yes
.Ve
.SS "Refresh"
.IX Subsection "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).
.PP
Example:
.PP
.Vb 1
\& Refresh: 600
.Ve
.SS "Interval"
.IX Subsection "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:
.IP "\(bu" 4
The generated \s-1HTML\s0 page contains the right
information about the calling interval ...
.IP "\(bu" 4
A \s-1META\s0 header in the generated \s-1HTML\s0 page will instruct
caches about the time-to-live of this page .....
.PP
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.
.PP
Example:
.PP
.Vb 1
\& Interval: 10
.Ve
.PP
Note that unless you are using rrdtool you can not set Interval to less
than 5 minutes. If you are using rrdtool you can set interval in the format
.PP
.Vb 1
\& Interval: MM[:SS]
.Ve
.PP
Down to 1 second. Note though, setting the Interval for an rrdtool/mrtg
setup will influence the initial creation of the database. If you change the
interval later, all existing databases will remain at the resolution they
were initially created with. Also note that you must make sure that your
mrtg-rrd Web-frontend can deal with this kind of Interval setting.
.SS "MaxAge"
.IX Subsection "MaxAge"
\&\s-1MRTG\s0 relies heavily on the real time clock of your computer. If the time is
set to a wrong value, especially if it is advanced far into the future,
this will cause mrtg to expire lots of supposedly old data from the log files.
.PP
To prevent this, you can add a 'reasonability' check by specifying a maximum
age for log files. If a file seems to be older, mrtg will not touch it but
complain instead, giving you a chance to investigate the cause.
.PP
Example:
.PP
.Vb 1
\& MaxAge: 7200
.Ve
.PP
The example above will make mrtg refuse to update log files older than 2
hours (7200 seconds).
.SS "WriteExpires"
.IX Subsection "WriteExpires"
With this switch mrtg will generate .meta files for \s-1CERN\s0
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 will have
to set \*(L"MetaDir .\*(R" and \*(L"MetaFiles on\*(R"
in your apache.conf or .htaccess file for this to work
.PP
\&\s-1NOTE:\s0 If you are running Apache\-1.2 or later, you can use the mod_expire
to achieve the same effect ... see the file htaccess.txt
.PP
Example:
.PP
.Vb 1
\& WriteExpires: Yes
.Ve
.SS "NoMib2"
.IX Subsection "NoMib2"
Normally we ask the \s-1SNMP\s0 device for 'sysUptime' and 'sysName' properties.
Some do not have these. If you want to avoid getting complaints from
mrtg about these missing properties, specify the nomib2 option.
.PP
An example of agents which do not implement base mib2 attributes are
Computer Associates \- Unicenter \s-1TNG\s0 Agents.  \s-1CA\s0 relies on using the base
\&\s-1OS SNMP\s0 agent in addition to its own agents to supplement the management
of a system.
.PP
Example:
.PP
.Vb 1
\& NoMib2: Yes
.Ve
.SS "SingleRequest"
.IX Subsection "SingleRequest"
Some \s-1SNMP\s0 implementations can not deal with requests asking for
multiple snmp variables in one go. Set this in your cfg file to force
mrtg to only ask for one variable per request.
.PP
Examples
.PP
.Vb 1
\& SingleRequest: Yes
.Ve
.SS "SnmpOptions"
.IX Subsection "SnmpOptions"
Apart from the per target timeout options, you can also configure the
behaviour of the snmpget process on a more profound level. SnmpOptions
accepts a hash of options. The following options are currently supported:
.PP
.Vb 7
\& timeout                   => $default_timeout,
\& retries                   => $default_retries,
\& backoff                   => $default_backoff,
\& default_max_repetitions   => $max_repetitions,
\& use_16bit_request_ids     => 1,
\& lenient_source_port_matching => 0,
\& lenient_source_address_matching => 1
.Ve
.PP
The values behind the options indicate the current default value.
Note that these settings \s-1OVERRIDE\s0 the per target timeout settings.
.PP
A per-target SnmpOptions[] keyword will override the global settings.  
That keyword is primarily for SNMPv3.
.PP
The 16bit request ids are the only way to query the broken \s-1SNMP\s0
implementation of \s-1SMC\s0 Barricade routers.
.PP
Example:
.PP
.Vb 1
\& SnmpOptions: retries => 2, only_ip_address_matching => 0
.Ve
.PP
Note that \s-1AS/400\s0 snmp seems to be broken in a way which prevents mrtg from
working with it unless
.PP
.Vb 1
\& SnmpOptions: lenient_source_port_matching => 1
.Ve
.PP
is set.
.SS "IconDir"
.IX Subsection "IconDir"
If you want to keep the mrtg icons in someplace other than the
working (or imagedir) directory, use the \fIIconDir\fR variable for
defining the url of the icons directory.
.PP
Example:
.PP
.Vb 1
\& IconDir: /mrtgicons/
.Ve
.SS "LoadMIBs"
.IX Subsection "LoadMIBs"
Load the \s-1MIB\s0 file(s) specified and make its OIDs available as
symbolic names. For better efficiency, a cache of MIBs is maintained
in the WorkDir.
.PP
Example:
.PP
.Vb 1
\& LoadMIBs: /dept/net/mibs/netapp.mib,/usr/local/lib/ft100m.mib
.Ve
.SS "Language"
.IX Subsection "Language"
Switch output format to the selected Language (Check the \fItranslate\fR directory
to see which languages are supported at the moment. In this directory you
can also find instructions on how to create new translations).
.PP
Currently the following languages are supported:
.PP
big5 
brazilian 
bulgarian 
catalan 
chinese 
croatian 
czech 
danish 
dutch 
eucjp 
french 
galician 
gb 
gb2312 
german 
greek 
hungarian 
icelandic 
indonesia 
iso2022jp 
italian 
korean 
lithuanian 
malay 
norwegian 
polish 
portuguese 
romanian 
russian 
russian1251 
serbian 
slovak 
slovenian 
spanish 
swedish 
turkish 
ukrainian
.PP
Example:
.PP
.Vb 1
\& Language: danish
.Ve
.SS "LogFormat"
.IX Subsection "LogFormat"
Setting LogFormat to 'rrdtool' in your mrtg.cfg file enables rrdtool mode.
In rrdtool mode, mrtg relies on \fBrrdtool\fR to do its logging. See mrtg-rrd.
.PP
Example:
.PP
.Vb 1
\& LogFormat: rrdtool
.Ve
.SS "LibAdd"
.IX Subsection "LibAdd"
If you are using rrdtool mode and your \fBrrdtool\fR Perl module (RRDs.pm)
is not installed in a location where perl can find it on its own, you can
use LibAdd to supply an appropriate path.
.PP
Example:
.PP
.Vb 1
\& LibAdd: /usr/local/rrdtool/lib/perl/
.Ve
.SS "PathAdd"
.IX Subsection "PathAdd"
If the \fBrrdtool\fR executable can not be found in the normal \f(CW\*(C`PATH\*(C'\fR, you can
use this keyword to add a suitable directory to your path.
.PP
Example:
.PP
.Vb 1
\& PathAdd: /usr/local/rrdtool/bin/
.Ve
.SS "RRDCached"
.IX Subsection "RRDCached"
If you are running RRDTool 1.4 or later with \fBrrdcached\fR, then you can 
configure \s-1MRTG\s0 to take advantage of this for updates, either by using the 
\&\s-1RRDCACHED_ADDRESS\s0 environment variable, or by setting the RRDCached keyword 
in the configuration file.  Note that, if both are set, the configuration file
keyword will take precedence.
.PP
Only \s-1UNIX\s0 domain sockets are fully supported prior to RRDTool v1.5, and 
you should note that using RRDCached mode will disable all Threshold checking 
normally done by \s-1MRTG.\s0  Appropriate warning messages will be printed if
necessary.
.PP
Examples:
.PP
.Vb 1
\& RRDCached: unix:/var/tmp/rrdcached.sock
\& 
\& RRDCached: localhost:42217
.Ve
.SS "RunAsDaemon"
.IX Subsection "RunAsDaemon"
The RunAsDaemon keyword enables daemon mode operation. The purpose of daemon
mode is that \s-1MRTG\s0 is launched once and not repeatedly (as it is with cron). 
This behavior saves computing resources as loading and parsing
of configuration files happens only once on startup, and if the configuration 
file is modified.
.PP
Using daemon mode \s-1MRTG\s0 itself is responsible for timing the measurement
intervals. Therefore its important to set the Interval keyword to an
appropriate value.
.PP
Note that when using daemon mode \s-1MRTG\s0 should no longer be started from cron
as each new process runs forever. Instead \s-1MRTG\s0 should be
started from the command prompt or by a system startup script.
.PP
If you want mrtg to run under a particular user and group (it is not
recommended to run \s-1MRTG\s0 as root) then you can use the \fB\-\-user=\fR\fIuser_name\fR
and \fB\-\-group=\fR\fIgroup_name\fR options on the mrtg commandline.
.PP
.Vb 1
\& mrtg \-\-user=mrtg_user \-\-group=mrtg_group mrtg.cfg
.Ve
.PP
Also note that in daemon mode restarting the process is required in order to
activate changes in the config file.
.PP
Under \s-1UNIX,\s0 the Daemon switch causes mrtg to fork into background after
checking its config file. On Windows \s-1NT\s0 the \s-1MRTG\s0 process will detach from
the console, but because the \s-1NT/2000\s0 shell waits for its children you have to
use this special start sequence when you launch the program:
.PP
.Vb 1
\& start /b perl mrtg mrtg.cfg
.Ve
.PP
You may have to add path information equal to what you add when you run mrtg
from the commandline.
.PP
Example
.PP
.Vb 2
\& RunAsDaemon: Yes
\& Interval:    5
.Ve
.PP
This makes \s-1MRTG\s0 run as a daemon beginning data collection every 5 minutes
.PP
If you are daemontools and still want to run mrtg as a daemon you can
additionally specify
.PP
.Vb 1
\& NoDetach:     Yes
.Ve
.PP
this will make mrtg run but without detaching it from the terminal.
.PP
If the modification date on the configuration file changes during operation,
then \s-1MRTG\s0 will re-read the configuration on the next polling cycle.  Note that
sub-files which are included from the main configuration do not have their
modification times monitored, only the top-level file is so checked.
.SS "ConversionCode"
.IX Subsection "ConversionCode"
Some devices may produce non-numeric values that would nevertheless
be useful to graph with \s-1MRTG\s0 if those values could be converted to numbers.
The ConversionCode keyword specifies the path to a file containing Perl code
to perform such conversions. The code in this file must consist of one or more
Perl subroutines. Each subroutine must accept a single string argument and
return a single numeric value. When RRDtool is in use, a decimal value may
be returned. When the name of one of these subroutines is specified in a
target definition (see below), \s-1MRTG\s0 calls it twice for that target, once to
convert the the input value being monitored and a second time to convert the
output value. The subroutine must return an undefined value if the conversion
fails. In case of failure, a warning may be posted to the \s-1MRTG\s0 log file using
Perl's warn function. \s-1MRTG\s0 imports the subroutines into a separate name space
(package MRTGConversion), so the user need not worry about pollution of \s-1MRTG\s0's
global name space. \s-1MRTG\s0 automatically prepends this package declaration to
the user-supplied code.
.PP
Example: Suppose a particular \s-1OID\s0 returns a character string whose length is
proportional to the value to be monitored. To convert this string to a
number that can be graphed by \s-1MRTG,\s0 create a file arbitrarily named
\&\*(L"MyConversions.pl\*(R" containing the following code:
.PP
.Vb 5
\& # Return the length of the string argument
\& sub Length2Int {
\&   my $value = shift;
\&   return length( $value );
\& }
.Ve
.PP
Then include the following global keyword in the \s-1MRTG\s0 configuration file
(assuming that the conversion code file is saved in the mrtg/bin directory
along with mrtg itself):
.PP
.Vb 1
\& ConversionCode: MyConversions.pl
.Ve
.PP
This will cause \s-1MRTG\s0 to include the definition of the subroutine Length2Int
in its execution environment. Length2Int can then be invoked on any target
by appending \*(L"|Length2Int\*(R" to the target definition as follows:
.PP
.Vb 1
\& Target[myrouter]: 1.3.6.1.4.1.999.1&1.3.6.1.4.1.999.1:public@mydevice|Length2Int
.Ve
.PP
See \*(L"Extended Host Name Syntax\*(R" below for complete target definition syntax
information.
.SS "SendToGraphite"
.IX Subsection "SendToGraphite"
If you want to send a copy of the collected data into a Graphite database in addition
to storing it in the RRDfile, you can provide your Graphite database name/ip and port
number here.
.PP
This requires the Net::Graphite perl module which is available from \s-1CPAN.\s0
.PP
Examples:
.PP
.Vb 2
\& # If your Graphite receiver is running on the same host as the MRTG daemon and using the default port 
\& SendToGraphite: 127.0.0.1,2003
\&
\& # If your Graphite receiver is running on 192.168.100.50 port 5000
\& SendToGraphite: 192.168.100.50,5000
\&
\& # If your Graphite receiver is running on graphite.mydomain.com port 2003
\& SendToGraphite: graphite.mydomain.com,2003
.Ve
.PP
Graphite's namespace has a number of restrictions on what characters are 
allowed. The SendToGraphite functionality makes an attempt to convert the \s-1MRTG\s0 
target name and, if specified, the Legendi and Legendo values to Graphite namespace
friendly values. Specifically, the following conversion rules apply:
.IP "\(bu" 4
Underscores in the target_name are converted to periods which are Graphite namespace delimiters.
.IP "\(bu" 4
Comma characters are not allowed so they are removed.
.IP "\(bu" 4
The string \*(L"m2g\*(R" for \s-1MRTG\s0 to Graphite is prepended onto the Graphite namespace variable.
.PP
Example \s-1MRTG\s0 target to Graphite namespace conversion:
.PP
.Vb 2
\& # Our MRTG target name from mrtg.cfg is as follows
\& Target[switch_GigabitEthernet0_5]: \eGigabitEthernet0/5:public1@switch:::::2
.Ve
.PP
After the conversion you will end up with these Graphite namespace values
.PP
.Vb 2
\& m2g.switch.gigabitethernet0.5.in
\& m2g.switch.gigabitethernet0.5.out
.Ve
.PP
Next is a more complicated example because Legendi and Legendo are in use to denote min and max
voltage values that pertain to some \s-1APC UPS SNMP\s0 OIDs
.PP
.Vb 4
\& # Target, Legendi, and Legendo are specified in mrtg.cfg as follows
\& Target[apc_minmaxline]: 1.3.6.1.4.1.318.1.1.1.3.2.3.0&1.3.6.1.4.1.318.1.1.1.3.2.2.0:public@apc:
\& LegendI[apc_minmaxline]: upsAdvInputMinLineVoltage
\& LegendO[apc_minmaxline]: upsAdvInputMaxLineVoltage
.Ve
.PP
After the conversion you will end up with these Graphite namespace values
.PP
.Vb 2
\& m2g.apc.minmaxline.upsAdvInputMinLineVoltage
\& m2g.apc.minmaxline.upsAdvInputMaxLineVoltage
.Ve
.PP
If you don't see the data showing up in Graphite, chances are there are invalid characters in
the namespace. To debug this, use the DEBUG=qw(log) directive at the top of the \s-1MRTG\s0 script 
to find out what is happening with the \s-1MRTG\s0 to Graphite namespace conversion.
.PP
DEBUG=qw(log) will generate some output similar to what appears below
.PP
.Vb 2
\& 2016\-10\-13 06:08:39 \-\- \-\-log: RRDs::update(/var/www/mrtg/switch/switch_gigabitethernet0_5.rrd, \*(Aq1476356919:2738746035:2927936327\*(Aq)
\& 2016\-10\-13 06:08:39 \-\- \-\-log: graphite\->send(m2g.switch.gigabitethernet0.5.in,2738746035,1476356919)
\&
\& 2016\-10\-13 06:08:39 \-\- \-\-log: graphite\->send(m2g.switch.gigabitethernet0.5.out,2927936327,1476356919)
\&
\& 2016\-10\-13 06:09:25 \-\- \-\-log: RRDs::update(/var/www/mrtg/apc/apc_minmaxline.rrd, \*(Aq1476356965:122:123\*(Aq)
\& 2016\-10\-13 06:09:25 \-\- \-\-log: graphite\->send(m2g.apc.minmaxline.upsAdvInputMinLineVoltage,122,1476356965)
\&
\& 2016\-10\-13 06:09:25 \-\- \-\-log: graphite\->send(m2g.apc.minmaxline.upsAdvInputMaxLineVoltage,123,1476356965)
.Ve
.PP
If the \s-1MRTG\s0 log output looks reasonable, then take a look at Graphite's carbon-cache logs.
.SH "PER TARGET CONFIGURATION"
.IX Header "PER TARGET CONFIGURATION"
Each monitoring target must be identified by a unique name. This
name must be appended to each parameter belonging to the same
target. The name will also be used for naming the
generated webpages, logfiles and images for this target.
.SS "Target"
.IX Subsection "Target"
With the \fITarget\fR keyword you tell mrtg what it should
monitor. The \fITarget\fR keyword takes arguments in a wide
range of formats:
.IP "Basic" 4
.IX Item "Basic"
The most basic format is \*(L"port:community@router\*(R"
This will generate a traffic graph for the interface 'port'
of the host 'router' (dns name or \s-1IP\s0 address)
and it will use the community 'community' (snmp password)
for the snmp query.
.Sp
Example:
.Sp
.Vb 1
\& Target[myrouter]: 2:public@wellfleet\-fddi.domain
.Ve
.Sp
If your community contains a \*(L"@\*(R" or a \*(L" \*(R" these characters
must be escaped with a \*(L"\e\*(R".
.Sp
.Vb 1
\& Target[bla]: 2:stu\e pi\e@d@router
.Ve
.IP "SNMPv2c" 4
.IX Item "SNMPv2c"
If you have a fast router you might want to try to poll the ifHC* counters.
This feature gets activated by switching to SNMPv2c. Unfortunately not all
devices support SNMPv2c yet. If it works, this will prevent your counters
from wrapping within the 5 minute polling interval, since we now use 64 bit
instead of the normal 32 bit.
.Sp
Example:
.Sp
.Vb 1
\& Target[myrouter]: 2:public@router1:::::2
.Ve
.IP "SNMPv3" 4
.IX Item "SNMPv3"
As an alternative to SNMPv2c, SNMPv3 provides access to the ifHC* counters,
along with encryption.  Not all devices support SNMPv3, and you will also
need the perl Net::SNMP library in order to use it.  It is recommended that
cfgmaker be used to generate configurations involving SNMPv3, as it will 
check if the Net::SNMP library is loadable, and will switch to SNMPv2c if
v3 is unavailable.
.Sp
\&\s-1SNMP\s0 v3 requires additional authentication parameters, passed using the 
SnmpOptions[] per-target keyword.
.Sp
Example:
  Target[myrouter]: 2:router1:::::3
  SnmpOptions[myrouter]: username=>'user1'
.IP "noHC" 4
.IX Item "noHC"
Not all routers that support SNMPv2 or SNMPv3 provide the ifHC* counters
on every interface.  The noHC[] per-target keyword signals that the
low-speed counters ifInOctets and ifOutOctets should be queried instead.
cfgmaker will automatically insert this tag if SNMPv2 or SNMPv3 is specified
but the ifHC* counters are unavailable.
.Sp
Example:
  Target[myrouter]: #Bri0:router1:::::3
  SnmpOptions[myrouter]: username=>'user1'
  noHC[myrouter]: yes
.IP "Reversing" 4
.IX Item "Reversing"
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 \*(L"Target\*(R"
description. It flips the incoming and outgoing traffic rates.
.Sp
Example:
.Sp
.Vb 1
\& Target[ezci]: \-1:public@ezci\-ether.domain
.Ve
.IP "Explicit OIDs" 4
.IX Item "Explicit OIDs"
You can also explicitly define which \s-1OID\s0 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.  \s-1MRTG\s0 needs to graph two variables,
so you need to specify two \s-1OID\s0's such as temperature and humidity
or error input and error output.
.Sp
Example:
.Sp
.Vb 1
\& 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
.Ve
.IP "\s-1MIB\s0 Variables" 4
.IX Item "MIB Variables"
\&\s-1MRTG\s0 knows a number of symbolic \s-1SNMP\s0 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:
.Sp
Example:
.Sp
.Vb 1
\& Target[myrouter]: ifInErrors.1&ifOutErrors.1:public@myrouter
.Ve
.IP "SnmpWalk" 4
.IX Item "SnmpWalk"
It may be that you want to monitor an snmp object that is only reachable by
\&'walking'. You can get mrtg to walk by prepending the \s-1OID\s0 with the string
\&\fBWaLK\fR or if you want a particular entry from the table returned by the walk
you can use \fBWaLK\fR\fIx\fR where \fIx\fR is a number starting from 0 (!).
.Sp
Example:
.Sp
.Vb 1
\&  Target[myrouter]: WaLKstrangeOid.1&WaLKstrangeOid.2:public@myrouter
\&
\&  Target[myrouter]: WaLK3strangeOid.1&WaLK4strangeOid.2:public@myrouter
.Ve
.IP "SnmpGetNext" 4
.IX Item "SnmpGetNext"
A special case of an snmp object that is only reachable by 'walking' occurs 
when a single snmpgetnext will return the correct value, but snmpwalk fails.  
This may occur with snmp V2 or V3, as the snmpgetbulk method is used in these 
versions. You can get mrtg to use getnext instead of getbulk by prepending the 
\&\s-1OID\s0 with the string \fBGeTNEXT\fR.
.Sp
Example:
.Sp
.Vb 1
\&  Target[myrouter]: GeTNEXTstrangeOid&GeTNEXTstrangeOid:public@myrouter
.Ve
.IP "Counted \s-1SNMP\s0 Walk" 4
.IX Item "Counted SNMP Walk"
In other situations, an snmpwalk is needed to count rows, but the actual data
is uninteresting.  For example, counting the number of mac-addresses in a \s-1CAM\s0 
table, or the number of simultaneous dialup sessions.  You can get \s-1MRTG\s0 to count 
the number of instances by prepending the \s-1OID\s0 with the string \fBCnTWaLK\fR.  The 
following will retrieve the number of simultaneous \s-1VOIP\s0 calls on some routers:
.Sp
Example:
.Sp
.Vb 1
\&   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
.Ve
.IP "Interface by \s-1IP\s0" 4
.IX Item "Interface by IP"
Sometimes \s-1SNMP\s0 interface index can change, like when new interfaces are
added or removed. This can cause all Target entries in your config file
to become offset, causing \s-1MRTG\s0 to graphs wrong instances etc.
\&\s-1MRTG\s0 supports \s-1IP\s0 address instead of ifindex in target definition. Then
\&\s-1MRTG\s0 will query snmp device and try to map \s-1IP\s0 address to the current ifindex.
You can use \s-1IP\s0 addresses in every type of target definition by adding
\&\s-1IP\s0 address of the numbered interface after \s-1OID\s0 and separation char '/'.
.Sp
Make sure that the given \s-1IP\s0 address is used on
your same target router, especially when graphing two different OIDs
and/or interface split by '&' delimiter.
.Sp
You can tell cfgmaker to generate such references with the option
\&\fB\-\-ifref=ip\fR.
.Sp
Example:
.Sp
.Vb 3
\& Target[myrouter]: /1.2.3.4:public@wellfleet\-fddi.domain
\& Target[ezci]: \-/1.2.3.4:public@ezci\-ether.domain
\& Target[myrouter]: ifInErrors/1.2.3.4&ifOutErrors/1.2.3.4:public@myrouter
.Ve
.IP "Interface by Description" 4
.IX Item "Interface by Description"
If you can not use \s-1IP\s0 addresses you might want to use
the interface names. This works similar to the \s-1IP\s0 address approach
except that the prefix to use is a \e instead of a /
.Sp
You can tell cfgmaker to generate such references with the option
\&\fB\-\-ifref=descr\fR.
.Sp
Example:
.Sp
.Vb 3
\& Target[myrouter]: \eMy\-Interface2:public@wellfleet\-fddi.domain
\& Target[ezci]: \-\eMy\-Interface2:public@ezci\-ether.domain
\& Target[myrouter]: ifInErrors\eMy\-If2&ifOutErrors\eMy\-If3:public@myrouter
.Ve
.Sp
If your description contains a \*(L"&\*(R", a \*(L":\*(R", a \*(L"@\*(R" or a \*(L" \*(R" you can include
them but you must escape with a backlash:
.Sp
.Vb 1
\& Target[myrouter]: \efun\e:\e ney\e&ddd:public@hello.router
.Ve
.IP "Interface by Name" 4
.IX Item "Interface by Name"
This is the only sensible way to reference the interfaces of your switches.
.Sp
You can tell cfgmaker to generate such references with the option
\&\fB\-\-ifref=name\fR.
.Sp
Example:
.Sp
.Vb 3
\& Target[myrouter]: #2/11:public@wellfleet\-fddi.domain
\& Target[ezci]: \-#2/11:public@ezci\-ether.domain
\& Target[myrouter]: ifInErrors#3/7&ifOutErrors#3/7:public@myrouter
.Ve
.Sp
If your description contains a \*(L"&\*(R", a \*(L":\*(R", a \*(L"@\*(R" or a \*(L" \*(R" you can include
them but you must escape with a backlash:
.Sp
.Vb 1
\& Target[myrouter]: #\e:\e fun:public@hello.router
.Ve
.Sp
Note that the # sign will be interpreted as a comment character if
it is the first non white-space character on the line.
.IP "Interface by Ethernet Address" 4
.IX Item "Interface by Ethernet Address"
When the \s-1SNMP\s0 interface index changes, you can key that interface by its
\&'Physical Address', sometimes called a 'hard address', which is the \s-1SNMP\s0
variable 'ifPhysAddress'.  Internally, \s-1MRTG\s0 matches the Physical Address from
the *.cfg file to its current index, and then uses that index for the rest of
the session.
.Sp
You can use the Physical Address in every type of target definition by adding
the Physical Address after the \s-1OID\s0 and the separation char '!' (analogous to the \s-1IP\s0
address option).  The Physical address is specified as '\-' delimited
octets, such as \*(L"0a\-0\-f1\-5\-23\-18\*(R" (omit the double quotes). Note that some
routers use the same Hardware Ethernet Address for all of their Interfaces which
prevents unique interface identification. Mrtg will notice such problems and alert you.
.Sp
You can tell cfgmaker to generate configuration files with hardware ethernet address references
by using the option \fB\-\-ifref=eth\fR.
.Sp
Example:
.Sp
.Vb 6
\& Target[myrouter]: !0a\-0b\-0c\-0d:public@wellfleet\-fddi.domain
\& Target[ezci]: \-!0\-f\-bb\-05\-71\-22:public@ezci\-ether.domain
\& Target[myrouter]: 1.3.6.1.2.1.2.2.1.14!0a\-00\-10\-23\-44\-51& *BREAK*
\&            1.3.6.1.2.1.2.2.1.14!0a\-00\-10\-23\-44\-51:public@myrouter
\& Target[myrouter]: ifInErrors!0a\-00\-10\-23\-44\-51& *BREAK*
\&            ifOutErrors!0a\-00\-10\-23\-44\-51:public@myrouter
.Ve
.Sp
Join the lines at *BREAK* ...
.IP "Interface by Type" 4
.IX Item "Interface by Type"
It seems that there are devices that try to defy all monitoring efforts: the interesting interfaces have
neither ifName nor a constant ifDescr not to mention a persistent ifIndex. The only way to get a constant
mapping is by looking at the interface type, because the interface you are interested in is unique in the
device you are looking at ...
.Sp
You can tell cfgmaker to generate such references with the option
\&\fB\-\-ifref=type\fR.
.Sp
Example:
.Sp
.Vb 3
\& Target[myrouter]: %13:public@wellfleet\-fddi.domain
\& Target[ezci]: \-%13:public@ezci\-ether.domain
\& Target[myrouter]: ifInErrors%13&ifOutErrors%14:public@myrouter
.Ve
.IP "Extended positioning of ifIndex" 4
.IX Item "Extended positioning of ifIndex"
There are OIDs that contain the interface index at some inner position within
the \s-1OID.\s0 To use the above mentioned Interface by IP/Description/Name/Type methods 
in the target definition the keyword 'IndexPOS' can be used to indicate the 
position of ifIndex. If 'IndexPOS' is not used the ifIndex will be appended at the
end of the \s-1OID.\s0
.Sp
Example:
.Sp
.Vb 1
\& Target[myrouter]: OID.IndexPOS.1/1.2.3.4&OID.IndexPOS.1/1.2.3.4:public@myrouter
.Ve
.Sp
Replace \s-1OID\s0 by your numeric \s-1OID.\s0
.IP "Extended Host Name Syntax" 4
.IX Item "Extended Host Name Syntax"
In all places where ``community@router'' is accepted, you can add
additional parameters for the \s-1SNMP\s0 communication using
colon-separated suffixes. You can also append a pipe symbol ( | ) and
the name of a numeric conversion subroutine as described under the global
keyword \*(L"ConversionCode\*(R" above. The full syntax is as follows:
.Sp
.Vb 1
\& community@router[:[port][:[timeout][:[retries][:[backoff][:[version]]]]][|name]
.Ve
.Sp
where the meaning of each parameter is as follows:
.RS 4
.IP "port" 4
.IX Item "port"
the \s-1UDP\s0 port under which to contact the \s-1SNMP\s0 agent (default: 161)
.Sp
The complete syntax of the port parameter is
.Sp
.Vb 1
\& remote_port[!local_address[!local_port]]
.Ve
.Sp
Some machines have additional security features that only allow \s-1SNMP\s0 queries
to come from certain \s-1IP\s0 addresses. If the host doing the query has multiple
interface, it may be necessary to specify the interface the query should
come from.
.Sp
The port parameter allows the specification of the port of the machine being
queried. In addition, the \s-1IP\s0 address (or hostname) and port of the machine
doing the query may be specified.
.Sp
Examples:
.Sp
.Vb 5
\& somehost
\& somehost:161
\& somehost:161!192.168.2.4!4000 use 192.168.2.4 and port 4000 as source
\& somehost:!192.168.2.4 use 192.168.2.4 as source
\& somehost:!!4000 use port 4000 as source
.Ve
.IP "timeout" 4
.IX Item "timeout"
initial timeout for \s-1SNMP\s0 queries, in seconds (default: 2.0)
.IP "retries" 4
.IX Item "retries"
number of times a timed-out request will be retried (default: 5)
.IP "backoff" 4
.IX Item "backoff"
factor by which the timeout is multiplied on every retry (default: 1.0).
.IP "version" 4
.IX Item "version"
for \s-1SNMP\s0 version. If you have a fast router you might want to put
a '2' here.  For authenticated or encrypted \s-1SNMP,\s0 you can try to put a
\&'3' here.  This will make mrtg try to poll the 64 bit counters and thus
prevent excessive counter wrapping. Not all routers support this though.
\&\s-1SNMP\s0 v3 requires additional setup, see SnmpOptions[] for full details.
.Sp
Example:
.Sp
.Vb 1
\& 3:public@router1:::::2
.Ve
.IP "name" 4
.IX Item "name"
the name of the subroutine that \s-1MRTG\s0 will call to convert the input and output
values to integers. See the complete example under the global keyword
\&\*(L"ConversionCode\*(R" above.
.Sp
Example:
.Sp
.Vb 1
\& 1.3.6.1.4.1.999.1&1.3.6.1.4.1.999.2:public@mydevice:161::::2|Length2Int
.Ve
.Sp
This would retrieve values from the \s-1OID 1.3.6.1.4.1.999.1\s0 for input and .2
for output on mydevice using \s-1UDP\s0 port 161 and \s-1SNMP\s0 version 2, and would
execute the user-defined numeric conversion subroutine Length2Int to convert
those values to integers.
.RE
.RS 4
.Sp
A value that equals the default value can be omitted.  Trailing colons
can be omitted, too. The pipe symbol followed by the name parameter, if
present, must come at the end. There must be no spaces around the colons or
pipe symbol.
.Sp
Example:
.Sp
.Vb 1
\&  Target[ezci]: 1:public@ezci\-ether.domain:9161::4
.Ve
.Sp
This would refer to the input/output octet counters for the interface
with \fIifIndex 1\fR on \fIezci\-ether.domain\fR, as known
by the \s-1SNMP\s0 agent listening on \s-1UDP\s0 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.
.RE
.IP "Numeric IPv6 addresses" 4
.IX Item "Numeric IPv6 addresses"
If IPv6 is enabled you may also specify a target using its IPv6 address. To
avoid ambiguity with the port number, numeric IPv6 addresses must be placed
in square brackets.
.Sp
Example:
.Sp
.Vb 1
\& Target[IPv6test]: 2:public@[2001:760:4::]:6161::4
.Ve
.IP "External Monitoring Scripts" 4
.IX Item "External Monitoring Scripts"
If you want to monitor something which does not provide
data via snmp you can use some external program to do
the data gathering.
.Sp
The external command must return 4 lines of output:
.RS 4
.IP "Line 1" 4
.IX Item "Line 1"
current state of the first variable, normally 'incoming bytes count'
.IP "Line 2" 4
.IX Item "Line 2"
current state of the second variable, normally 'outgoing bytes count'
.IP "Line 3" 4
.IX Item "Line 3"
string (in any human readable format), telling the uptime of the target.
.IP "Line 4" 4
.IX Item "Line 4"
string, telling the name of the target.
.RE
.RS 4
.Sp
Depending on the type of data your script returns you
might want to use the 'gauge' or 'absolute' arguments
for the \fIOptions\fR keyword.
.Sp
Example:
.Sp
.Vb 1
\& Target[myrouter]: \`/usr/local/bin/df2mrtg /dev/dsk/c0t2d0s0\`
.Ve
.Sp
Note the use of the backticks (`), not apostrophes (')
around the command.
.Sp
If you want to use a backtick in the command name this can be done
but you must escape it with a backslash ...
.Sp
If your script does not have any data to return but does not want mrtg to
complain about invalid data, it can return '\s-1UNKNOWN\s0' instead of a number.
Note though that only rrdtool is really equipped to handle unknown data well.
.RE
.IP "Multi Target Syntax" 4
.IX Item "Multi Target Syntax"
You can also combine several target definitions in a mathematical expression.
Any syntactically correct expression that the Perl interpreter can evaluate
to will work. An expression could be used, for example, to aggregate both B
channels in an \s-1ISDN\s0 connection or to calculate the percentage hard disk
utilization of a server from the absolute used space and total capacity.
.Sp
Examples:
.Sp
.Vb 1
\& Target[myrouter]: 2:public@wellfleetA + 1:public@wellfleetA
\&
\& Target[myrouter]: .1.3.6.1.4.1.999.1&.1.3.6.1.4.1.999.2:public@mydevice /
\&     .1.3.6.1.4.1.999.3&.1.3.6.1.4.1.999.4:public@mydevice * 100
.Ve
.Sp
Note that whitespace must surround each target definition in the expression.
Target definitions themselves must not contain whitespace, except in
interface descriptions and interface names, where each whitespace character
is escaped by a backslash.
.Sp
\&\s-1MRTG\s0 automatically rounds the result of the expression to an integer unless
RRDTool logging is in use and the gauge option is in effect for the target.
Internally \s-1MRTG\s0 uses Perl's Math::BigFloat package to calculate the result
of the expression with 40 digits of precision. Even in extreme cases, where,
for example, you take the difference of two 64\-bit integers, the result of
the expression should be accurate.
.IP "\s-1SNMP\s0 Request Optimization" 4
.IX Item "SNMP Request Optimization"
\&\s-1MRTG\s0 is designed to economize on its \s-1SNMP\s0 requests. Where a target
definition appears more than once in the configuration file, \s-1MRTG\s0 requests
the data from the device only once per round of data collection and uses
the collected data for each instance of a particular target. Recognition of
two target definitions as being identical is based on a simple string match
rather than any kind of deeper semantic analysis.
.Sp
Example:
.Sp
.Vb 4
\& Target[Targ1]: 1:public@CiscoA
\& Target[Targ2]: 2:public@CiscoA
\& Target[Targ3]: 1:public@CiscoA + 2:public@CiscoA
\& Target[Targ4]: 1:public@CISCOA
.Ve
.Sp
This results in a total of three \s-1SNMP\s0 requests. Data for 1:public@CiscoA
and 2:public@CiscoA are requested only once each, and used for Targ1, Targ2,
and Targ3. Targ4 causes another \s-1SNMP\s0 request for 1:public@CISCOA, which is not
recognized as being identical to 1:public@CiscoA.
.SS "MaxBytes"
.IX Subsection "MaxBytes"
The maximum value either of the two variables monitored
are allowed to reach. For monitoring router traffic
this is normally the bytes per second this
interface port can carry.
.PP
If a number higher than \fIMaxBytes\fR is returned, it is ignored.
Also read the section on \fIAbsMax\fR for further info.
The \fIMaxBytes\fR value is also used in calculating the Y range
for unscaled graphs (see the section on \fIUnscaled\fR).
.PP
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, 10 \s-1MB\s0 Ethernet = 1250000, 100 \s-1MB\s0
Ethernet = 12500000. The \fIMaxBytes\fR value will be used by mrtg to decide
whether it got a valid response from the router.
.PP
If you need two different MaxBytes values for the two monitored
variables, you can use MaxBytes1 and MaxBytes2 instead of MaxBytes.
.PP
Example:
.PP
.Vb 1
\& MaxBytes[myrouter]: 1250000
.Ve
.SS "Title"
.IX Subsection "Title"
Title for the \s-1HTML\s0 page which gets generated for the graph.
.PP
Example:
.PP
.Vb 1
\& Title[myrouter]: Traffic Analysis for Our Nice Company
.Ve
.SH "OPTIONAL PER TARGET KEYWORDS"
.IX Header "OPTIONAL PER TARGET KEYWORDS"
.SS "PageTop"
.IX Subsection "PageTop"
Things to add to the top of the generated \s-1HTML\s0 page.  Note
that you can have several lines of text as long as the
first column is empty.
.PP
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 '\en' sequence.
.PP
Example:
.PP
.Vb 4
\& PageTop[myrouter]: <H1>Traffic Analysis for ETZ C95.1</H1>
\&   Our Campus Backbone runs over an FDDI line\en
\&   with a maximum transfer rate of 12.5 megabytes per
\&   Second.
.Ve
.SS "RouterUptime"
.IX Subsection "RouterUptime"
In cases where you calculate the used bandwidth from
several interfaces you normally don't get the router uptime
and router name displayed on the web page.
.PP
If these interfaces are on the same router and the uptime and
name should be displayed you have to specify
its community and address again with the \fIRouterUptime\fR keyword.
.PP
If you want to use a special \s-1OID\s0 for querying the router uptime,
use prepend the oid.
.PP
Example:
.PP
.Vb 2
\& 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
\&
\& RouterUptime[kacisco.comp.edu]: hrSystemUptime.0:public@194.64.66.250
.Ve
.SS "RouterName"
.IX Subsection "RouterName"
If the default name of the router is incorrect/uninformative,
you can use RouterName to specify a different \s-1OID\s0 on either the
same or a different host.
.PP
A practical example: sysName on BayTech \s-1DS72\s0 units always display
\&\*(L"ds72\*(R", no matter what you set the Unit \s-1ID\s0 to be.  Instead, the
Unit \s-1ID\s0 is stored at 1.3.6.1.4.1.4779.1.1.3.0, so we can have
\&\s-1MRTG\s0 display this instead of sysName.
.PP
Example:
.PP
.Vb 1
\& RouterName[kacisco.comp.edu]: 1.3.6.1.4.1.4779.1.1.3.0
.Ve
.PP
A different \s-1OID\s0 on a different host can also be specified:
.PP
.Vb 1
\& RouterName[kacisco.comp.edu]: 1.3.6.1.4.1.4779.1.1.3.0:public@194.64.66.251
.Ve
.SS "MaxBytes1"
.IX Subsection "MaxBytes1"
Same as MaxBytes, for variable 1.
.SS "MaxBytes2"
.IX Subsection "MaxBytes2"
Same as MaxBytes, for variable 2.
.SS "IPv4Only"
.IX Subsection "IPv4Only"
Many IPv6 routers do not currently support \s-1SNMP\s0 over IPv6 and must
be monitored using IPv4. The IPv4Only option forces mrtg to use IPv4
when communicating with the target, even if IPv6 is enabled. This is
useful if the target is a hostname with both IPv4 and IPv6 addresses;
without the IPv4Only keyword, monitoring such a router will not work
if IPv6 is enabled.
.PP
If set to no (the default), mrtg will use IPv6 unless the target has
no IPv6 addresses, in which case it will use IPv4. If set to yes, mrtg
will only use IPv4.
.PP
Note that if this option is set to yes and the target does not have an
IPv4 address, communication with the target will fail.
.PP
This option has no effect if IPv6 is not enabled.
.PP
Example:
.PP
.Vb 2
\& Target[v4onlyrouter_1]: 1:public@v4onlyrouter
\& IPv4Only[v4onlyrouter_1]: Yes
.Ve
.SS "SnmpOptions (V3)"
.IX Subsection "SnmpOptions (V3)"
SNMPv3 requires a fairly rich set of options.  This per-target keyword
allows access to the User Security Model of SNMPv3.  Options are listed
in the same syntax as a perl hash.
.PP
\fISecurity Modes\fR
.IX Subsection "Security Modes"
.PP
SNMPv3 has three security modes, defined on the device being polled.
For example, on Cisco routers the security mode is defined by the
snmp-server group global configuration command.
.IP "NoAuthNoPriv" 4
.IX Item "NoAuthNoPriv"
Neither Authentication nor Privacy is defined.  Only the Username 
option is specified for this mode.
.Sp
Example:
.Sp
.Vb 1
\& SnmpOptions[myrouter]: username=>\*(Aquser1\*(Aq
.Ve
.IP "AuthNoPriv" 4
.IX Item "AuthNoPriv"
Uses a Username and a password.  The password can be hashed using the 
snmpkey application, or passed in plain text along with the ContextEngineID
.Sp
Example:
.Sp
.Vb 2
\& SnmpOptions[myrouter]: username=>\*(Aquser1\*(Aq,authpassword=>\*(Aqexample\*(Aq,
\&   contextengineid=>\*(Aq80000001110000004000000\*(Aq
.Ve
.IP "Priv" 4
.IX Item "Priv"
Both Authentication and Privacy is defined.  The default privacy protocol
is des.
.Sp
Example:
 SnmpOptions[myrouter]: authkey=>'0x1e93ab5a396e2af234c8920e61cfe2028072c0e2',
   authprotocol=>'sha',privprotocol=>'des',username=>'user1',
   privkey=>'0x498d74940c5872ed387201d74b9b25e2'
.PP
\fIsnmp options\fR
.IX Subsection "snmp options"
.PP
The following option keywords are recognized:
.IP "username" 4
.IX Item "username"
The user associated with the User Security Model
.IP "contextname" 4
.IX Item "contextname"
An \s-1SNMP\s0 agent can define multiple contexts.  This keyword allows them to
be polled.
.IP "contextengineid" 4
.IX Item "contextengineid"
A unique 24\-byte string identifying the snmp-agent.
.IP "authpassword" 4
.IX Item "authpassword"
The plaintext password for a user in either AuthNoPriv or Priv mode.
.IP "authkey" 4
.IX Item "authkey"
A md5 or sha hash of the plain-text password, along with the engineid.
Use the snmpkey commandline program to generate this hash, or use
Net::SNMP::Security::USM in a script.
.IP "authprotocol {sha|md5}" 4
.IX Item "authprotocol {sha|md5}"
The hashing algorithm defined on the \s-1SNMP\s0 client.  Defaults to md5.
.IP "privpassword" 4
.IX Item "privpassword"
A plaintext pre-shared key for encrypting snmp packets in Priv mode.
.IP "privkey" 4
.IX Item "privkey"
A hash of the plain-text pre-shared key, along with the engineid.
Use the snmpkey commandline program to generate this hash, or use
Net::SNMP::Security::USM in a script.
.IP "privprotocol {des|3desede|aescfb128|aescfb192|aescfb256}" 4
.IX Item "privprotocol {des|3desede|aescfb128|aescfb192|aescfb256}"
Specifies the encryption method defined on the snmp agent.  The default
is des.
.SS "PageFoot"
.IX Subsection "PageFoot"
Things to add to the bottom of the generated \s-1HTML\s0 page.  Note
that you can have several lines of text as long as the
first column is empty.
.PP
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 '\en' sequence.
.PP
The material will be added just before the </BODY> tag:
.PP
Example:
.PP
.Vb 2
\& PageFoot[myrouter]: Contact <A HREF="mailto:peter@x.yz">Peter</A>
\&  if you have questions regarding this page
.Ve
.SS "AddHead"
.IX Subsection "AddHead"
Use this tag like the \fIPageTop\fR header, but its contents
will be added between </TITLE> and </HEAD>.
.PP
Example:
.PP
.Vb 1
\& AddHead[myrouter]: <link rev="made" href="mailto:mrtg@blabla.edu">
.Ve
.SS "BodyTag"
.IX Subsection "BodyTag"
BodyTag lets you supply your very own <body ...> tag for the
generated webpages.
.PP
Example:
.PP
.Vb 2
\& BodyTag[myrouter]: <BODY LEFTMARGIN="1" TOPMARGIN="1" 
\&                      BACKGROUND="/stats/images/bg.neo2.gif">
.Ve
.SS "AbsMax"
.IX Subsection "AbsMax"
If you are monitoring a link which can handle more traffic than the
\&\fIMaxBytes\fR value. Eg, a line which uses compression or some frame relay
link, you can use the \fIAbsMax\fR 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 \fIAbsMax\fR, rateup will
ignore values higher than \fIMaxBytes\fR.
.PP
Example:
.PP
.Vb 1
\& AbsMax[myrouter]: 2500000
.Ve
.SS "Unscaled"
.IX Subsection "Unscaled"
By default each graph is scaled vertically to make the actual data visible
even when it is much lower than \fIMaxBytes\fR.  With the \fIUnscaled\fR 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.  There
is also a special case to unset the variable completely: n=none. This could
be useful in the event you need to override a global configuration. In the
example scaling for the yearly and the monthly graph are suppressed.
.PP
Example:
.PP
.Vb 1
\& Unscaled[myrouter]: ym
.Ve
.SS "WithPeak"
.IX Subsection "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.
.PP
Examples:
.PP
.Vb 1
\& WithPeak[myrouter]: ym
.Ve
.SS "Suppress"
.IX Subsection "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.
.PP
Example:
.PP
.Vb 1
\& Suppress[myrouter]: y
.Ve
.SS "Extension"
.IX Subsection "Extension"
By default, mrtg creates .html files. Use this option to tell mrtg to
use a different extension. For example you could set the extension to
php3, then you will be able to enclose \s-1PHP\s0 tags into the output (useful
for getting a router name out of a database).
.PP
Example:
.PP
.Vb 1
\& Extension[myrouter]: phtml
.Ve
.SS "Directory"
.IX Subsection "Directory"
By default, mrtg puts all the files that it generates for each
target (the GIFs, the \s-1HTML\s0 page, the log file, etc.) in \fIWorkDir\fR.
.PP
If the \fIDirectory\fR option is specified, the files are instead put
into a directory under \fIWorkDir\fR or Log\-, Image\- and HtmlDir).
(For example the \fIDirectory\fR
option below would cause all the files for a target myrouter
to be put into directory /usr/tardis/pub/www/stats/mrtg/myrouter/ .)
.PP
The directory must already exist; mrtg will not create it.
.PP
Example:
.PP
.Vb 2
\& WorkDir: /usr/tardis/pub/www/stats/mrtg
\& Directory[myrouter]: myrouter
.Ve
.PP
\&\s-1NOTE:\s0 the Directory option must always be 'relative' or bad things will happen.
.SS "Clonedirectory"
.IX Subsection "Clonedirectory"
If the \fIDirectory\fR option is specified, the \fIClonedirectory\fR option will copy
all the contents of \fIDirectory\fR to the \fIClonedirectory\fR.
.PP
Example:
.PP
.Vb 3
\& WorkDir: /usr/tardis/pub/www/stats/mrtg
\& Directory[myrouter]: myrouter
\& Clonedirectory[myrouter]: myclonedirectory
.Ve
.PP
Optionally the target name can be changed in the cloning process.
.PP
Example:
.PP
.Vb 3
\& WorkDir: /usr/tardis/pub/www/stats/mrtg
\& Directory[myrouter]: myrouter
\& Clonedirectory[myrouter]: myclonedirectory mynewtarget
.Ve
.PP
\&\s-1NOTE1:\s0 The clone directory must already exist; mrtg will not create it.
.PP
\&\s-1NOTE2:\s0 The Clonedirectory option must also always be 'relative' or bad things will happen.
.PP
\&\s-1NOTE3:\s0 This requires the File::Copy module
.SS "XSize and YSize"
.IX Subsection "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 ...
.PP
Note: XSize must be between 20 and 600; YSize must be larger than 20
.PP
Example:
.PP
.Vb 2
\& XSize[myrouter]: 300
\& YSize[myrouter]: 300
.Ve
.SS "XZoom and YZoom"
.IX Subsection "XZoom and YZoom"
If you want your graphs to have larger pixels, you can
\&\*(L"Zoom\*(R" them.
.PP
Example:
.PP
.Vb 2
\& XZoom[myrouter]: 2.0
\& YZoom[myrouter]: 2.0
.Ve
.SS "XScale and YScale"
.IX Subsection "XScale and YScale"
If you want your graphs to be actually scaled use \fIXScale\fR
and \fIYScale\fR. (Beware: while this works, the results look ugly
(to be frank) so if someone wants to fix this: patches are welcome.
.PP
Example:
.PP
.Vb 2
\& XScale[myrouter]: 1.5
\& YScale[myrouter]: 1.5
.Ve
.SS "YTics and YTicsFactor"
.IX Subsection "YTics and YTicsFactor"
If you want to show more than 4 lines per graph, use YTics.
If you want to scale the value used for the YLegend of these
tics, use YTicsFactor.
The default value for YTics is 4 and the default value for
YTicsFactor is 1.0 .
.PP
Example:
.PP
Suppose you get values ranging from 0 to 700.
You want to plot 7 lines and want to show
0, 1, 2, 3, 4, 5, 6, 7 instead of 0, 100, 200,
300, 400, 500, 600, 700.  You should write then:
.PP
.Vb 2
\&  YTics[myrouter]: 7
\&  YTicsFactor[myrouter]: 0.01
.Ve
.SS "Factor"
.IX Subsection "Factor"
If you want to multiply all numbers shown below the graph with a constant factor, use
this directive to define it ..
.PP
Example:
.PP
.Vb 1
\&  Factor[as400]: 4096
.Ve
.SS "Step"
.IX Subsection "Step"
Change the default step from 5 * 60 seconds to
something else (I have not tested this much ...)
.PP
Example:
.PP
.Vb 1
\& Step[myrouter]: 60
.Ve
.SS "PNGTitle"
.IX Subsection "PNGTitle"
When using rateup for graph generation, this will print the given title in the 
graph it generates.
.PP
Example:
.PP
.Vb 1
\& PNGTitle[myrouter]: WAN Link UK\-US
.Ve
.SS "Options"
.IX Subsection "Options"
The \fIOptions\fR Keyword allows you to set some boolean
switches:
.IP "growright" 4
.IX 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.
.IP "bits" 4
.IX 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.
.IP "perminute" 4
.IX Item "perminute"
All the monitored variable values are multiplied by 60
(i.e. shown in units per minute instead of units per second) in case
of small values more accurate graphs are displayed.
It also affects the 'factory default' labeling and units
for the given target.
.IP "perhour" 4
.IX Item "perhour"
All the monitored variable values are multiplied by 3600
(i.e. shown in units per hour instead of units per second) in case
of small values more accurate graphs are displayed.
It also affects the 'factory default' labeling and units
for the given target.
.IP "noinfo" 4
.IX Item "noinfo"
Suppress the information about uptime and
device name in the generated webpage.
.IP "nopercent" 4
.IX Item "nopercent"
Don't print usage percentages.
.IP "transparent" 4
.IX Item "transparent"
Make the background of the generated gifs transparent.
.IP "integer" 4
.IX Item "integer"
Print summary lines below graph as integers without commas.
.IP "dorelpercent" 4
.IX Item "dorelpercent"
The relative percentage of IN-traffic to OUT-traffic is calculated
and displayed in the graph as an additional line.
Note: Only a fixed scale is available (from 0 to 100%). Therefore
if IN-traffic is greater than OUT-traffic then 100% is displayed.
If you suspect that your IN-traffic is not always less than or equal
to your OUT-traffic you are urged to not use this options.
Note: If you use this option in combination with the \fIColours\fR
options, a fifth colour-name colour-value pair is required there.
.IP "avgpeak" 4
.IX Item "avgpeak"
There are some ISPs who use the average Peak values to bill their customers.
Using this option \s-1MRTG\s0 displays these values for each graph. The value is
built by averaging the max 5 minute traffic average for each 'step' shown in
the graph. For the Weekly graph this means that it builds the average of all
2 hour intervals 5 minute peak values. (Confused? Thought so!)
.IP "gauge" 4
.IX Item "gauge"
Treat the values gathered from target as 'current status' measurements
and not as ever incrementing counters.
This would be useful to monitor things like disk space,
processor load, temperature, and the like ...
.Sp
In the absence of 'gauge' or 'absolute' options,
\&\s-1MRTG\s0 treats variables as a counters 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.
.IP "absolute" 4
.IX Item "absolute"
This is for counter type data sources which reset their value when they are
read. This means that rateup does not have to build the difference between
the current and the last value read from the data source. The value obtained is
still divided by the elapsed time between the current and the last reading, which makes
it different from the 'gauge' option. Useful for external data gatherers.
.IP "derive" 4
.IX Item "derive"
If you are using rrdtool as logger/grapher you can use a third type of data
source. Derive is like counter, except that it is not required to go \s-1UP\s0 all
the time. It is useful for situations where the change of some value should be
graphed.
.IP "unknaszero" 4
.IX Item "unknaszero"
Log unknown data as zero instead of the default behaviour of repeating the
last value seen. Be careful with this, often a flat line in the graph is
much more obvious than a line at 0.
.IP "withzeroes" 4
.IX Item "withzeroes"
Normally we ignore all values which are zero when calculating the average
transfer rate on a line. If this is not desirable use this option.
.IP "noborder" 4
.IX Item "noborder"
If you are using rateup to log data, \s-1MRTG\s0 will create the graph images.
Normally these images have a shaded border around them. If you do not want the
border to be drawn, enable this option. This option has no effect if you are
not using rateup.
.IP "noarrow" 4
.IX Item "noarrow"
As with the option above, this effects rateup graph generation only. Normally
rateup will generate graphs with a small arrow showing the direction of the
data. If you do not want this arrow to be drawn, enable this option. This
option has no effect if you are not using rateup.
.IP "noi" 4
.IX Item "noi"
When using rateup for graph generation, you can use this option to stop rateup
drawing a graph for the 'I' or first variable. This also removes entries for
this variable in the \s-1HTML\s0 page \s-1MRTG\s0 generates, and will remove the peaks for
this variable if they are enabled. This allows you to hide this data, or can
be very useful if you are only graphing one line of data rather than two.
This option is not destructive \- any data received for the the variable
continued to be logged, it just isn't shown.
.IP "noo" 4
.IX Item "noo"
Same as above, except relating to the 'O' or second variable.
.IP "nobanner" 4
.IX Item "nobanner"
When using rateup for graph generation, this option disables \s-1MRTG\s0 adding the
\&\s-1MRTG\s0 banner to the \s-1HTML\s0 pages it generates.
.IP "nolegend" 4
.IX Item "nolegend"
When using rateup for graph generation, this option will stop \s-1MRTG\s0 from creating
a legend at the bottom of the \s-1HTML\s0 pages it generates.
.IP "printrouter" 4
.IX Item "printrouter"
When using rateup for graph generation, this option will print the router  
name in the graph it generates.  This option is overridden by the value of
PNGTitle if one is given
.IP "pngdate" 4
.IX Item "pngdate"
When using rateup for graph generation, this option will print a
timestamp in the graph it generates, including a timezone if one is specified
by the 'Timezone' parameter. This is equivalent to setting TimeStrPost[x]: \s-1RU\s0
.IP "logscale" 4
.IX Item "logscale"
The \fBlogscale\fR option causes rateup to display the data with the Y axis
scaled logarithmically.  Doing so allows the normal traffic to occupy
the majority of the vertical range, while still showing any spikes at
their full height.
.Sp
\&\fBlogscale\fR displays all the available data and will always produce
well-behaved graphs.  People often consider a logarithmically scaled graph
counterintuitive, however, and thus hard to interpret.
.IP "expscale" 4
.IX Item "expscale"
The \fBexpscale\fR option causes rateup to display the data with the Y axis
scaled exponentially.  Doing so emphasizes small changes at the top of
the scale; this can be useful when graphing values that fluctuate by
a small amount near the top of the scale, such as line voltage.
.Sp
\&\fBexpscale\fR is essentially the inverse of \fBlogscale\fR.
.IP "secondmean" 4
.IX Item "secondmean"
The \fBsecondmean\fR option sets the maximum value on the graph to the mean
of the data greater than the mean of all data.  This produces a graph
that focuses more on the typical data, while clipping large peaks.
.Sp
Using \fBsecondmean\fR will give a more intuitive linearly
scaled graph, but can result in a uselessly high or low scale in some
rare situations (specifically, when the data includes a large portion
of values far from the actual mean)
.Sp
If a target includes both \fBlogscale\fR and \fBsecondmean\fR in the options, the
\&\fBsecondmean\fR takes precedence.
.PP
Example:
.PP
.Vb 1
\& Options[myrouter]: growright, bits
.Ve
.SS "kilo"
.IX Subsection "kilo"
Use this option to change the multiplier value for building
prefixes. Defaultvalue is 1000. This tag is for the special
case that 1kB = 1024B, 1MB = 1024kB and so far.
.PP
Example:
.PP
.Vb 1
\& kilo[myrouter]: 1024
.Ve
.SS "kMG"
.IX Subsection "kMG"
Change the default multiplier prefixes (,k,M,G,T,P). In the tag
\&\fIShortLegend\fR define only the basic units.
Format: Comma separated list of prefixed. Two consecutive commas
or a comma at start or end of the line gives no prefix on this item.
If you do not want prefixes, just put two consecutive commas.
If you want to skip a magnitude select '\-' as value.
.PP
Example: velocity in nm/s (nanometers per second) displayed in nm/h.
.PP
.Vb 3
\& ShortLegend[myrouter]: m/h
\& kMG[myrouter]: n,u,m,,k,M,G,T,P
\& options[myrouter]: perhour
.Ve
.SS "Colours"
.IX Subsection "Colours"
The \fIColours\fR 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 \s-1RGB\s0 value is the real
colour used for the display, both on the graph and in the
html doc.
.PP
Format is: Col1#RRGGBB,Col2#RRGGBB,Col3#RRGGBB,Col4#RRGGBB
.PP
Important:
If you use the \fIdorelpercent\fR options tag a fifth colour name
colour value pair is required:
Col1#RRGGBB,Col2#RRGGBB,Col3#RRGGBB,Col4#RRGGBB,Col5#RRGGBB
.IP "Colour1" 4
.IX Item "Colour1"
First variable (normally Input) on default graph.
.IP "Colour2" 4
.IX Item "Colour2"
Second variable (normally Output) on default graph.
.IP "Colour3" 4
.IX Item "Colour3"
Max first variable (input).
.IP "Colour4" 4
.IX Item "Colour4"
Max second variable (output).
.IP "\s-1RRGGBB\s0" 4
.IX Item "RRGGBB"
2 digit hex values for Red, Green and Blue.
.PP
Example:
.PP
.Vb 1
\& Colours[myrouter]: GREEN#00eb0c,BLUE#1000ff,DARK GREEN#006600,VIOLET#ff00ff
.Ve
.SS "Background"
.IX Subsection "Background"
With the \fIBackground\fR tag you can configure the background
colour of the generated \s-1HTML\s0 page.
.PP
Example:
.PP
.Vb 1
\& Background[myrouter]: #a0a0a0a
.Ve
.SS "TextColor"
.IX Subsection "TextColor"
With the \fITextColor\fR tag you can configure the text
colour of the generated \s-1HTML\s0 page.
.PP
Example:
.PP
.Vb 1
\& TextColor[myrouter]: #a0a0a0a
.Ve
.SS "YLegend, ShortLegend, Legend[1234]"
.IX Subsection "YLegend, ShortLegend, Legend[1234]"
The following keywords allow you to override the text
displayed for the various legends of the graph and in the
\&\s-1HTML\s0 document:
.IP "YLegend" 4
.IX 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.
.IP "ShortLegend" 4
.IX Item "ShortLegend"
The units string (default 'b/s') used for Max, Average and Current
.IP "Legend[1234IO]" 4
.IX Item "Legend[1234IO]"
The strings for the colour legend.
.PP
Example:
.PP
.Vb 8
\&  YLegend[myrouter]: Bits per Second
\&  ShortLegend[myrouter]: b/s
\&  Legend1[myrouter]: Incoming Traffic in Bits per Second
\&  Legend2[myrouter]: Outgoing Traffic in Bits per Second
\&  Legend3[myrouter]: Maximal 5 Minute Incoming Traffic
\&  Legend4[myrouter]: Maximal 5 Minute Outgoing Traffic
\&  LegendI[myrouter]: &nbsp;In:
\&  LegendO[myrouter]: &nbsp;Out:
.Ve
.PP
Note, if \fILegendI\fR or \fILegendO\fR are set to an empty string with
.PP
.Vb 1
\& LegendO[myrouter]:
.Ve
.PP
The corresponding line below the graph will not be printed at all.
.SS "Timezone"
.IX Subsection "Timezone"
If you live in an international world, you might want to
generate the graphs in different timezones. This is set in the
\&\s-1TZ\s0 variable. Under certain operating systems like Solaris,
this will provoke the localtime call to give the time in
the selected timezone.
.PP
Example:
.PP
.Vb 1
\& Timezone[myrouter]: Japan
.Ve
.PP
The Timezone is the standard timezone of your system, ie Japan, Hongkong,
\&\s-1GMT, GMT+1\s0 etc etc.
.SS "Weekformat"
.IX Subsection "Weekformat"
By default, mrtg (actually rateup) uses the \fBstrftime\fR\|(3) '%V' 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 \fBstrftime\fR\|(3) routine supports it, you can try
another format option.  The \s-1POSIX\s0 '%V' option correspond to the widely used
\&\s-1ISO 8601\s0 week numbering standard.  The week format character should be
specified as a single letter; either W, V, or U.
.PP
The \s-1UNIX\s0 version of rateup uses the libc implementation of strftime.
On Windows, the native strftime implementation does not know about
\&\f(CW%V\fR. So there we use a different implementation of strftime that does
support \f(CW%V\fR.
.PP
Example:
.PP
.Vb 1
\& Weekformat[myrouter]: W
.Ve
.SS "RRDRowCount"
.IX Subsection "RRDRowCount"
This affects the creation of new rrd files. By default rrds are created to
hold about 1 day's worth of high resolution data. (plus 1 week of 30 minute
data, 2 months of 2 hour data and 2 years of 1 day data).  With this Keyword
you can change the number of base interval entries configured for new rrds
as they get created. Note that you must take the interval time into account.
.PP
Example:
.PP
.Vb 1
\& RRDRowCount[myrouter]: 1600
.Ve
.SS "RRDRowCount30m"
.IX Subsection "RRDRowCount30m"
As per RRDRowCount, but for the \s-1RRA\s0's \-typically\- used for 30 minute data.
Even so, you must still take the base interval into account.  Leaving out
this keyword will force the old default of 800 rows.
.PP
Example:
.PP
.Vb 1
\& RRDRowCount30m[myrouter]: 800
.Ve
.SS "RRDRowCount2h"
.IX Subsection "RRDRowCount2h"
As per RRDRowCount, but for the \s-1RRA\s0's \-typically\- used for 2 hour data.
Even so, you must still take the base interval into account.  Leaving out
this keyword will force the old default of 800 rows.
.PP
Example:
.PP
.Vb 1
\& RRDRowCount2h[myrouter]: 400
.Ve
.SS "RRDRowCount1d"
.IX Subsection "RRDRowCount1d"
As per RRDRowCount, but for the \s-1RRA\s0's \-typically\- used for 1 day data.
Even so, you must still take the base interval into account.  Leaving out
this keyword will force the old default of 800 rows.
.PP
Example:
.PP
.Vb 1
\& RRDRowCount1d[myrouter]: 200
.Ve
.SS "RRDHWRRAs"
.IX Subsection "RRDHWRRAs"
Normally the RRDs created by \s-1MRTG\s0 will just contain the information gathered
directly from the respective target. With this option you can tap into
rrdtools advanced aberrant behaviour detection module based on Holt-Winters
forecasting. The RRDHWRRAs property specifies the Holt-Winters RRAs as
described in the rrdcreate manual page.
.PP
Note, this setting will only affect newly created RRDs (targets).
.PP
Example:
.PP
.Vb 1
\& RRDHWRRAs[myrouter]: RRA:HWPREDICT:1440:0.1:0.0035:288
.Ve
.SS "TimeStrPos"
.IX Subsection "TimeStrPos"
This defines placement of the timestamp string on the image. Possible
values are \s-1RU, LU, RL, LL\s0 (which stand, respectively, for RightUpper,
LeftUpper, RightLower and LeftLower corner) and \s-1NO\s0 (for no timestamp).
By default, no timestamp is placed on the image.
.PP
Example:
.PP
.Vb 1
\& TimeStrPos[myrouter]: RU
.Ve
.SS "TimeStrFmt"
.IX Subsection "TimeStrFmt"
Using this keyword you may specify format of the timestamp to be placed
on the image (if enabled by the TimeStrPos keyword). Specified string
will be used by the \fBstrftime()\fR function \- see \fBstrftime\fR\|(3) documentation
for conversion specifiers available on your system.
Default format: \f(CW%Y\fR\-%m\-%d \f(CW%H:\fR%M
.PP
Example:
.PP
.Vb 1
\& TimeStrFmt[myrouter]: %H:%M:%S
.Ve
.SH "THRESHOLD CHECKING"
.IX Header "THRESHOLD CHECKING"
Through its threshold checking functionality mrtg is able to detect
threshold problems for the various targets and can call external
scripts to handle those problems (e.g. send email or a page to an administrator).
.PP
Threshold checking is configured through the following parameters:
.SS "ThreshDir (\s-1GLOBAL\s0)"
.IX Subsection "ThreshDir (GLOBAL)"
By defining ThreshDir to point to a writable directory, \s-1MRTG\s0 will only alert
you when a threshold boundary has been crossed.
.PP
Example:
.PP
.Vb 1
\& ThreshDir: /var/mrtg/thresh
.Ve
.SS "ThreshHyst (\s-1GLOBAL\s0)"
.IX Subsection "ThreshHyst (GLOBAL)"
If a threshold is broken, and you have a threshdir defined, then mrtg will
send mail once the threshold becomes 'unborken' to avoid situations where
broken and unbroken messages get sent in close succession, we only send an
unbroken message once the current value is 0.1 (10%) away from the threshold.
using the ThreshHyst config variable you can customize this value.
.PP
Example for 5%:
.PP
.Vb 1
\& ThreshHyst: 0.05
.Ve
.SS "ThreshMailServer (\s-1GLOBAL\s0)"
.IX Subsection "ThreshMailServer (GLOBAL)"
Address of an \s-1SMTP\s0 server which is going to accept mail about Thresholds being broken and unbroken.
.SS "ThreshMailSender (\s-1GLOBAL\s0)"
.IX Subsection "ThreshMailSender (GLOBAL)"
What is the sender address of the threshold mail.
.PP
Example:
.PP
.Vb 1
\& ThreshMailSender: mrtg@example.com
.Ve
.SS "ThreshMailAddress (\s-1PER TARGET\s0)"
.IX Subsection "ThreshMailAddress (PER TARGET)"
Email address for Threshold related Mails. This will only work if a mailserver has been configured.
.PP
Example:
.PP
.Vb 2
\& ThreshMailAddress[_]: admin@example.com
\& ThreshMailAddress[router]:
.Ve
.PP
This would bring threshold released mail to all but the target called 'router'.
.SS "ThreshMinI  (\s-1PER TARGET\s0)"
.IX Subsection "ThreshMinI (PER TARGET)"
This is the minimum acceptable value for the Input (first) parameter.  If
the parameter falls below this value, the program specified in ThreshProgI
will be run and a mail will be sent to the ThreshMailAddress if specified.
If the value ends in '%' then the threshold is defined relative to MaxBytes.
.SS "ThreshMaxI (\s-1PER TARGET\s0)"
.IX Subsection "ThreshMaxI (PER TARGET)"
Works the same as TheshMinI but it acts when the value is higher than ThreshMaxI.
.SS "ThreshDesc (\s-1PER TARGET\s0)"
.IX Subsection "ThreshDesc (PER TARGET)"
Its value will be assigned to the environment variable \s-1THRESH_DESC\s0 before
any of the programs mentioned below are called. The programs can use the value
of this variable to produce more user-friendly output.
.SS "ThreshProgI  (\s-1PER TARGET\s0)"
.IX Subsection "ThreshProgI (PER TARGET)"
This defines a program to be run if ThreshMinI or ThreshMaxI is broken. 
\&\s-1MRTG\s0 passes 3 arguments: the \f(CW$router\fR variable, the threshold value
broken, and the current parameter value.
.SS "ThreshProgOKI  (\s-1PER TARGET\s0)"
.IX Subsection "ThreshProgOKI (PER TARGET)"
This defines a program to be run if the parameter is currently \s-1OK\s0 (based on
ThreshMinI and ThreshMaxI), but wasn't \s-1OK\s0 on the previous running \*(-- based
on the files found in ThreshDir. \s-1MRTG\s0 passes 3 arguments: the \f(CW$router\fR
variable the unbroken threshold value, and the current parameter value.
.SS "ThreshMinO, ThreshMaxO, ThreshProgO, and ThreshProgOKO"
.IX Subsection "ThreshMinO, ThreshMaxO, ThreshProgO, and ThreshProgOKO"
These work the same as their *I counterparts, except on the Output (second)
parameter.
.SS "SetEnv"
.IX Subsection "SetEnv"
When calling threshold scripts from within your cfg file you might want to
pass some data on to the script. This can be done with the SetEnv
configuration option which takes a series of environment variable
assignments. Note that the quotes are mandatory. This does not
work for external scripts. It is not
possible to set environment variables per target.
.PP
Example:
.PP
.Vb 2
\& SetEnv[myrouter]:  EMAIL="contact_email@someplace.net"
\&                    HOST="www.some_server.net"
.Ve
.SS "\s-1HW\s0 Failure Based Threshold Checking"
.IX Subsection "HW Failure Based Threshold Checking"
When using rrd based logging with \s-1HW\s0 RRAs defined. You can use the
confidence bounds violations stored in the \s-1FAILURES RRA\s0 for threshold based
alerts.
.PP
There the all target specific threshold variables have a Hold-Winters counterpart:
.PP
.Vb 3
\& ThreshMailAddress \-> HWThreshMailAddress
\& ThreshMinI        \-> HWThreshMinI
\& ...
.Ve
.PP
The global variables for threshold checking are shared except for the
.PP
.Vb 1
\& ThreshHyst        \-> HWThreshHyst
.Ve
.PP
And HWThreshDesc sets the \s-1HWTHRESH_DESC\s0 variable.
.SH "PER TARGET DEFAULT VALUES"
.IX Header "PER TARGET DEFAULT VALUES"
.SS "Pre\- and Postfix"
.IX Subsection "Pre- and Postfix"
To save yourself some typing you can define a target
called '^'. The text of every Keyword you define for this
target will be \s-1PREPENDED\s0 to the corresponding Keyword of
all the targets defined below this line. The same goes for
a Target called '$' but its text will be \s-1APPENDED.\s0
.PP
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 \*(L"default\*(R"
target description below.
.PP
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.
.PP
Example:
.PP
.Vb 2
\& PageTop[^]: <H1>NoWhere Unis Traffic Stats</H1><HR>
\& PageTop[$]: Contact Peter Norton if you have any questions<HR>
.Ve
.PP
To remove the prepend/append value, specify an empty value, e.g.:
.PP
.Vb 2
\& PageTop[^]:
\& PageTop[$]:
.Ve
.SS "NoSpaceChar"
.IX Subsection "NoSpaceChar"
With \s-1PREPEND\s0 and \s-1APPEND\s0 (see below) there is normally a space inserted
between the local value and the \s-1PRE\-\s0 or \s-1APPEND\s0 value. Sometimes this is not
desirable. You can use the global option \fINoSpaceChar\fR to
define a character which can be mentioned at the end of a $ or ^ definition
in order to suppress the space.
.PP
Example:
.PP
.Vb 6
\&  NoSpaceChar: ~
\&  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@~
\&  Target[a]: a.tolna.net
\&  Target[b]: b.tolna.net
\&  Target[c]: c.tolna.net
\&  Target[d]: d.tolna.net
.Ve
.SS "Default Values"
.IX Subsection "Default Values"
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.
.PP
Example:
.PP
.Vb 5
\& YSize[_]: 150
\& Options[_]: growright,bits,nopercent
\& WithPeak[_]: ymw
\& Suppress[_]: y
\& MaxBytes[_]: 1250000
.Ve
.PP
To remove the default value and return to the 'factory default',
specify an empty value, e.g.:
.PP
.Vb 1
\& YLegend[_]:
.Ve
.PP
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.
.PP
Example:
.PP
.Vb 4
\& 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
.Ve
.PP
The default \fIMaxBytes\fR for the target myrouter.someplace.edu.2
in the above example will be 1250000, which was in effect
where the target name myrouter.someplace.edu.2 first appeared
in the config file.
.SH "COMMAND LINE OPTIONS"
.IX Header "COMMAND LINE OPTIONS"
.IP "\fB\-\-user\fR \fIusername\fR  and \fB\-\-group\fR \fIgroupname\fR" 4
.IX Item "--user username and --group groupname"
Run as the given user and/or group. (Unix Only)
.IP "\fB\-\-lock\-file\fR \fIfilename\fR" 4
.IX Item "--lock-file filename"
Use an alternate lock-file (the default is to use the configuration-file
appended with \f(CW\*(C`_l\*(C'\fR).
.IP "\fB\-\-confcache\-file\fR \fIfilename\fR" 4
.IX Item "--confcache-file filename"
Use an alternate confcache-file (the default is to use the
configuration-file appended with \f(CW\*(C`.ok\*(C'\fR)
.IP "\fB\-\-logging\fR \fIfilename\fR|\fBeventlog\fR" 4
.IX Item "--logging filename|eventlog"
If this is set to writable filename, all output from mrtg (warnings, debug
messages, errors) will go to \fIfilename\fR. If you are running on Win32 you
can specify \fBeventlog\fR instead of a filename which will send all error to
the windows event log.
.Sp
\&\fB\s-1NOTE:\s0\fR Note, there is no Message \s-1DLL\s0 for mrtg included with mrtg. This has
the side effect that the windows event logger will display a nice message
with every entry in the event log, complaining about the fact that mrtg has no
message dll. If you go to the mrtg contrib download area (on the website)
you will find the mrtg\-message\-dll.zip which does contain such a thing.
.IP "\fB\-\-daemon\fR" 4
.IX Item "--daemon"
Put \s-1MRTG\s0 into the background, running as a daemon. This works the same way as
the config file option, but the switch is required for proper \s-1FHS\s0 operation
(because /var/run is writable only by root)
.IP "\fB\-\-fhs\fR" 4
.IX Item "--fhs"
Configure all mrtg paths to conform to the \s-1FHS\s0 specification;
http://www.pathname.com/fhs/
.IP "\fB\-\-check\fR" 4
.IX Item "--check"
Only check the cfg file for errors. Do not do anything.
.IP "\fB\-\-pid\-file=s\fR" 4
.IX Item "--pid-file=s"
Define the name and path of the pid file for mrtg running as a daemon
.IP "\fB\-\-debug=s\fR" 4
.IX Item "--debug=s"
Enable debug options. The argument of the debug option is a comma separated
list of debug values:
.Sp
.Vb 11
\& cfg  \- watch the config file reading
\& dir  \- directory mangeling
\& base \- basic program flow 
\& tarp \- target parser
\& snpo \- snmp polling 
\& coca \- confcache operations
\& fork \- forking view 
\& time \- some timing info
\& log  \- logging of data via rateup or rrdtool
\& eval \- print eval strings before evaluating them
\& prof \- add hires timing info the rrd calls
.Ve
.Sp
Example:
.Sp
.Vb 1
\& \-\-debug="cfg,snpo"
.Ve
.SH "EXIT CODES"
.IX Header "EXIT CODES"
An exit code of 0 indicates that all targets were successful.  Generally
speaking, most codes greater than 0 indicate that there was an unrecoverable
problem.  One exception to this is code 91, which indicates that at least
one of the targets was successful.  A partial listing of the codes follows:
.PP
.Vb 1
\&  0: All targets successful
\&
\&  2: Config error (can\*(Aqt read, fatal error in config, etc)
\& 17: Another MRTG process is processing config
\&
\& 91: At least one target successful
\& 92: No targets were successful
.Ve
.SH "EXAMPLES"
.IX Header "EXAMPLES"
.SS "Minimal mrtg.cfg"
.IX Subsection "Minimal mrtg.cfg"
.Vb 5
\& WorkDir: /usr/tardis/pub/www/stats/mrtg
\& Target[r1]: 2:public@myrouter.somplace.edu
\& MaxBytes[r1]: 8000
\& Title[r1]: Traffic Analysis ISDN
\& PageTop[r1]: <H1>Stats for our ISDN Line</H1>
.Ve
.SS "Cfg for several Routers."
.IX Subsection "Cfg for several Routers."
.Vb 6
\& 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[_]: 8000
\& 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
.Ve
.SH "AUTHOR"
.IX Header "AUTHOR"
Tobias Oetiker <tobi@oetiker.ch> and many contributors