File: cfgmaker.txt

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



NNNNAAAAMMMMEEEE
       cfgmaker - Creates mrtg.cfg files (for mrtg-2.9.17)

SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
       cfgmaker [options] [community@]router [[options] [commu-
       nity@]router ...]

OOOOPPPPTTTTIIIIOOOONNNNSSSS
        --ifref=nr        interface references by Interface Number (default)
        --ifref=ip                         ... by Ip Address
        --ifref=eth                        ... by Ethernet Number
        --ifref=descr                      ... by Interface Description
        --ifref=name                       ... by Interface Name
        --ifref=type                       ... by Interface Type

        --ifdesc=nr       interface description uses Interface Number (default)
        --ifdesc=ip                        ... uses Ip Address
        --ifdesc=eth                       ... uses Ethernet Number
        --ifdesc=descr                     ... uses Interface Description
        --ifdesc=name                      ... uses Interface Name
        --ifdesc=alias                     ... uses Interface Alias
        --ifdesc=type                      ... uses Interface Type

        --if-filter=f     Test every interface against filter f to decide wether
                          or not to include that interface into the collection.
                          Currently f is being evaluated as a Perl expression
                          and it's truth value is used to reject or accept the
                          interface.
                          (Experimental, under development, might change)

        --if-template=templatefile
                          Replace the normal target entries for the interfaces
                          with an entry as specified by the contents in the file
                          templatefile.  The file is supposed to contain Perl
                          code to be executed to generate the lines for the
                          target in the configuration file.
                          (Experimental, under development, might change)

        --host-template=templatefile
                          In addition to creating targets for a host's interfaces
                          do also create targets for the host itself as specified
                          by the contents in the file templatefile.  The file is
                          supposed to contain Perl code to be executed to generate
                          the lines for the host related targets (such as CPU,
                          ping response time measurements etc.) in the config-
                          uration file.
                          (Experimental, under development, might change)

        --global "x: a"   add global config entries

        --no-down         do not look at admin or opr status of interfaces

        --show-op-down    show interfaces which are operatively down

        --descint         describe interface instead of just 'Traffic Analysis for'

        --subdirs=format  give each router its own subdirectory, naming each per
                          "format", in which HOSTNAME and SNMPNAME will be
                          replaced by the values of those items -- for instance,
                          --subdirs=HOSTNAME or --subdirs="HOSTNAME (SNMPNAME)"

        --noreversedns    do not reverse lookup ip numbers

        --community=cmty  Set the default community string to "cmty" instead of
                          "public".

        --snmp-options=:[<port>][:[<tmout>][:[<retr>][:[<backoff>][:<ver>]]]]

                          Specify default SNMP options to be appended to all
                          routers following.  Individual fields can be empty.
                          Routers following might override some or all of the
                          options given to --snmp-options.

        --dns-domain=domain
                          Specifies a domain to append to the name of all
                          routers following.

        --nointerfaces    Don't do generate any configuration lines for interfaces,
                          skip the step of gathering interface information and
                          don't run any interface template code.

        --interfaces      Generate configuration lines for interfaces (this is the
                          default).  The main purpose of this option is to negate
                          an --nointerfaces appearing earlier on the command line.

        --help            brief help message
        --man             full documentation
        --version         print the version of cfgmaker

        --output=file     output filename default is STDOUT


DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
       CCCCffffggggmmmmaaaakkkkeeeerrrr creates MRTG configuration files based on infor-
       mation pulled from a router or another SNMP manageable
       device.

       [_c_o_m_m_u_n_i_t_y@@@@]_r_o_u_t_e_r

       _C_o_m_m_u_n_i_t_y is the community name of the device you want to
       create a configuration for. If not specified, it defaults
       to 'ppppuuuubbbblllliiiicccc'; you might want to try this first if you do
       not know the community name of a device. If you are using
       the wrong comunity name you will get no response from the
       device.

       _R_o_u_t_e_r is the DNS name or the IP number of an SNMP-man-
       agable device.  Following the name you can specify 6 fur-
       ther options separated by colons.  The full syntax looks
       like this:

       rrrroooouuuutttteeeerrrr[:[pppprrrrtttt][:[ttttmmmmoooouuuutttt][:[rrrreeeettttrrrr][:[bbbbaaaacccckkkkooooffffffff][:vvvveeeerrrrssss]]]]]

       Of special interest may be the last parameter, vvvveeeerrrrssss.  If
       you set this to '2' then your device will be queried with
       SNMP version 2 requests. This allows to poll the 64 bit
       traffic counters in the device and will thus work much
       better with fast interfaces (no more counter overrun).
       Note that the order in which the routers are specified on
       the command line do matter as the same order is used when
       the configuration file is generated.  The first specified
       router has it's configuration lines genrated first, fol-
       lowed by the lines belonging to the next router and so on.

       CCCCoooonnnnffffiiiigggguuuurrrraaaattttiiiioooonnnn

       Except for the --------oooouuuuttttppppuuuutttt and --------gggglllloooobbbbaaaallll options, all options
       affect only the routers following them on the command
       line.  If an option specified earlier on the command line
       reappears later on the command line with another value,
       the new value overrides the old value as far as remaining
       routers are concerned.  This way options might be tailored
       for groups of routers or for individual routers.

       See --------oooouuuuttttppppuuuutttt and --------gggglllloooobbbbaaaallll for how their behaviour is
       affected by where or how many times they appear on the
       command line.

       See the EEEExxxxaaaammmmpppplllleeeessss below on how to set an option differently
       for multiple routers.

       --------hhhheeeellllpppp
           Print a brief help message and exit.

       --------mmmmaaaannnn
           Prints the manual page and exits.

       --------vvvveeeerrrrssssiiiioooonnnn
           Print the version of cfgmaker.  This should match the
           version of MRTG for which config files are being cre-
           ated.

       --------iiiiffffrrrreeeeffff nnnnrrrr|iiiipppp|eeeetttthhhh|ddddeeeessssccccrrrr|nnnnaaaammmmeeee
           Select the interface identification method.  Default
           is nnnnrrrr which identifies the router interfaces by their
           number.  Unfortunately the interface numbering scheme
           in an SNMP tree can change. Some routers change their
           numbering when new interfaces are added, others change
           thier numbering every full moon just for fun.

           To work around this sad problem MRTG can identify
           interfaces by 4 other properties. None of these works
           for all interfaces, but you should be able to find one
           which does fine for you. Note that especially ethernet
           addrsses can be problematic as some routers have the
           same ethernet address on most of their interface
           cards.

           Select iiiipppp to identify the interface by its IP number.
           Use eeeetttthhhh to use the ethernet address for identifica-
           tion. Use ddddeeeessssccccrrrr to use the Interface description. Or
           use nnnnaaaammmmeeee to use the Interface name.

           If your chosen method does not allow unique interface
           identification on the device you are querying, ccccffffgggg----
           mmmmaaaakkkkeeeerrrr will tell you about it.

       --------iiiiffffddddeeeesssscccc nnnnrrrr|iiiipppp|eeeetttthhhh|ddddeeeessssccccrrrr|nnnnaaaammmmeeee|ttttyyyyppppeeee|aaaalllliiiiaaaassss
           Select what to use as the description of the inter-
           face.  The description appears in the "Title[]" prop-
           erty for the target as well as the text header in the
           HTML code defined in the target's "PageTop[]".
           Default is to use nnnnrrrr which is just the interface num-
           ber which isn't always useful to the viewer of the
           graphs.

           There are 6 other properties which could be used.  Use
           iiiipppp if you want to use the interface's IP-address.  Use
           eeeetttthhhh if you want to use the interface's ethernet
           address.  If you want a better description, you can
           use either ddddeeeessssccccrrrr, nnnnaaaammmmeeee or aaaalllliiiiaaaassss.  Exactly what each of
           these do varies between different equipment so you
           might need to experiment.  For instance, for a serial
           interface on a Cisco router running IOS using nnnnaaaammmmeeee
           might result in ""S0"" being the interface description
           , ddddeeeessssccccrrrr might result in ""Serial0"" and aaaalllliiiiaaaassss might
           result in ""Link to HQ"" (provided that is what is
           used as the interface's "description" in the router's
           configuration).

           Finally, if you want to describe the interface by it's
           Btype (i.e ""ethernetCSMA"", ""propPointtoPoint"" etc)
           you can use ttttyyyyppppeeee.  This is roughly equivalent to the
           --------ddddeeeesssscccciiiinnnntttt option above.

       --------iiiiffff----ffffiiiilllltttteeeerrrr 'ffffiiiilllltttteeeerrrr----eeeexxxxpppprrrreeeessssssssiiiioooonnnn'
           First of all, this is under some developement and is
           experimental.

           Use this if you want to have better control over what
           interfaces gets included into the configuration.  The
           ffffiiiilllltttteeeerrrr----eeeexxxxpppprrrreeeessssssssiiiioooonnnn is evaluated as a piece of Perl code
           and is expected to return a truth value.  If true,
           include the interface and if false, exclude the inter-
           face.

           For a further discussion on how these filters work,
           see the section the DETAILS ON FILTERS entry elsewhere
           in this document below.

       --------iiiiffff----tttteeeemmmmppppllllaaaatttteeee tttteeeemmmmppppllllaaaatttteeee----ffffiiiilllleeee
           First of all, this is under some development and is
           experimental.

           Use this if you want to control what the line for each
           target should look like in the configuration file.
           The contents of the file tttteeeemmmmppppllllaaaatttteeee----ffffiiiilllleeee will be evalu-
           ated as a Perl program which generates the lines using
           certain variables for input and output.

           For a further discussion on how these templates work,
           see the section the DETAILS ON TEMPLATES entry else-
           where in this document below.

       --------hhhhoooosssstttt----tttteeeemmmmppppllllaaaatttteeee tttteeeemmmmppppllllaaaatttteeee----ffffiiiilllleeee
           First of all, this is under some development and is
           experimental.

           Use this if you want to have some extra targets
           related to the host itself such as CPU utilization,
           ping response time to the host, number of busy modems
           etc.  The contents of the file tttteeeemmmmppppllllaaaatttteeee----ffffiiiilllleeee will be
           evaluated once per host as a Perl program which gener-
           ates the lines using certain variables for input and
           output.

           For a further discussion on how these templates work,
           see the section the DETAILS ON TEMPLATES entry else-
           where in this document below.

       --------ccccoooommmmmmmmuuuunnnniiiittttyyyy ccccoooommmmmmmmuuuunnnniiiittttyyyy----ssssttttrrrriiiinnnngggg
           Use this to set the community for the routers follow-
           ing on the command line to ccccoooommmmmmmmuuuunnnniiiittttyyyy----ssssttttrrrriiiinnnngggg.  Individ-
           ual routers might overrride this community string by
           using the syntax ccccoooommmmmmmmuuuunnnniiiittttyyyy@@@@rrrroooouuuutttteeeerrrr.

       --------ssssnnnnmmmmpppp----ooooppppttttiiiioooonnnnssss  :[ppppoooorrrrtttt][:[ttttiiiimmmmeeeeoooouuuutttt][:[rrrreeeettttrrrriiiieeeessss][:[bbbbaaaacccckkkk----
       ooooffffffff][:vvvveeeerrrrssssiiiioooonnnn]]]]
           Use this to set the default SNMP options for all
           routers following on the command line.  Individual
           values might be omitted as well as trailing colons.
           Note that routers might override individual (or all)
           values specified by --------ssssnnnnmmmmpppp----ooooppppttttiiiioooonnnnssss by using the syntax

           rrrroooouuuutttteeeerrrr[:[ppppoooorrrrtttt][:[ttttiiiimmmmeeeeoooouuuutttt][:[rrrreeeettttrrrriiiieeeessss][:[bbbbaaaacccckkkkooooffffffff][:vvvveeeerrrr----
           ssssiiiioooonnnn]]]]]

       --------gggglllloooobbbbaaaallll """"""""_b_l_a_: _a_b_c""""""""
           Use this to add global options to the generated config
           file.  You can call --------gggglllloooobbbbaaaallll several times to add mul-
           tiple options.  The line will appear in the configura-
           tion just before the config for the next router
           appearing on the command line.

            --global "workdir: /home/mrtg"

           If you want some default Options you might want to put

            --global "options[_]: growright,bits"

           Specifying --------gggglllloooobbbbaaaallll after the last router on the com-
           mand line will create a line in the configuration file
           which will appear after all the routers.

       --------nnnnoooorrrreeeevvvveeeerrrrsssseeeeddddnnnnssss
           Do not try to reverse lookup IP numbers ... a must for
           DNS free environments.

       --------nnnnoooo----ddddoooowwwwnnnn
           Normally cfgmaker will not include interfaces which
           are marked anything but administratively and opera-
           tionally UP. With this switch you get them all.

       --------sssshhhhoooowwww----oooopppp----ddddoooowwwwnnnn
           Include interfaces which are operatively down.

       --------ssssuuuubbbbddddiiiirrrrssss _f_o_r_m_a_t
           Give each router its own subdirectory for the HTML and
           graphics (or .rrd) files.  The directory name is the
           given _f_o_r_m_a_t string with a couple of pattern replace-
           ments.  The string "HOSTNAME" will be replaced by the
           hostname of the router (however you specified it on
           the ccccffffggggmmmmaaaakkkkeeeerrrr commandline -- it may be an actual host-
           name or just an IP address), and "SNMPNAME" will be
           replaced with the device's idea of its own name (the
           same name that appears on the right side of the
           "Title" lines).  For instance, a call like:

            cfgmaker --subdirs=HOSTNAME__SNMPNAME public@10.10.0.18

           would result in the generation of lines looking some-
           thing like:

            Directory[10.10.0.18_1]: 10.10.0.18__fp2200-bothrip-1.3


       --------oooouuuuttttppppuuuutttt _f_i_l_e
           Write the output from ccccffffggggmmmmaaaakkkkeeeerrrr into the file _f_i_l_e. The
           default is to use "STDOUT". --------oooouuuuttttppppuuuutttt is expected to
           appear only once on the command line. If used multiple
           times, the file specified by the last --------oooouuuuttttppppuuuutttt will be
           used.

       --------nnnnooooiiiinnnntttteeeerrrrffffaaaacccceeeessss
           Don't generate configuration lines for interfaces.

           This makes cfgmaker skip all steps related to inter-
           faces which means it will not do any polling of the
           router to retrieve interface information which speeds
           up the execution of cfgmaker and it will neither run
           any interface templates.

       --------iiiinnnntttteeeerrrrffffaaaacccceeeessss
           This makes cfgmaker generate configuration lines for
           interfaces (the default behaviour).

           The main usage of this option is to negate an --noint-
           erfaces appearing earlier on the command line.

DDDDEEEETTTTAAAAIIIILLLLSSSS OOOONNNN FFFFIIIILLLLTTTTEEEERRRRSSSS
       The purpose of the filters is to decide which interfaces
       to accept and which interfaces to reject.  This decision
       is done for each interface by evaluating the filter
       expression as a piece of Perl code and investigating the
       result of the evaluation.  If true, accept the interface
       otherwise reject it.

       When working with filters, remember that Perl has it's own
       idea of what truth and false is.  The empty string "" and
       the string "0" are false, all other strings are true.
       This further imples that any integer value of 0 is false
       as well as any undef value.  It also implies that all ref-
       erences are considered true.

       As the filter is evaluated as a Perl expression, several
       useful constructs in Perl are worth mentioning:

       Expressions might be grouped by using parentheses "()".
       Expressions might be combined using boolean operators such
       as the following:

       ""aaaannnndddd"" (equivalent with ""&&&&&&&&"")
           Boolean "and" of the two expressions, is only true if
           both expressions are true.  Example: _e_x_p_r_e_s_s_i_o_n_1 aaaannnndddd
           _e_x_p_r_e_s_s_i_o_n_2

       ""oooorrrr"" (equivalent with ""||||||||"")
           Boolean "or" of the two expressions, is true if either
           or both expressions are true.  Example: _e_x_p_r_e_s_s_i_o_n_1 oooorrrr
           _e_x_p_r_e_s_s_i_o_n_2

       ""nnnnooootttt"" (equivalent with ""!!!!"")
           Boolean negation of a single expression.  Example:
           nnnnooootttt _e_x_p_r_e_s_s_i_o_n .  Yet another example: !!!!_e_x_p_r_e_s_s_i_o_n

       (For more details on this I recommend a book on Perl)

       PPPPrrrreeeeddddeeeeffffiiiinnnneeeedddd FFFFiiiilllltttteeeerrrr VVVVaaaarrrriiiiaaaabbbblllleeeessss

       To facilitate, there are a number of predefined values
       available to use in the filter.  Note that these variables
       are also available when templates interfaces are evaluated
       (but not host templates).

       Caveat:  All these variables' names begin with a dollar
       sign  ($), which is a syntactic requirement for scalar
       variables in Perl.  The danger here is that the dollar
       sign in many shells is an active character (often used for
       shell variables exactly as in Perl variables) so it is
       important to ensure that the Perl expression isn't evalu-
       ated by the command line shell as shell code before being
       passed to cfgmaker as command line arguments.  In shells
       like Bourne shell, ksh shell or bash shell, placing the
       entire expression within single qoutes will avoid such
       accidental evaluation:

        '--if-filter=($default_iftype && $if_admin)'


       $$$$iiiiffff____ttttyyyyppppeeee
           This is an integer specifying the interface type as
           per the SNMP standards and as reported by the polled
           device.  A complete list of interface types would be
           impractical for this document , but there are a number
           predefined varables below.  Normally, cfgmaker puts in
           the target's PageTop this iftype value within paran-
           thesis after the name of the interface type. (e.g
           "propPointToPointSerial (22)").

           Here's a list of some of the most common interface
           types by number:

              6 ethernetCsmacd
              7 iso88023Csmacd
              9 iso88025TokenRing
             15 fddi
             19 E1
             20 basicISDN
             21 primaryISDN
             22 propPointToPointSerial
             23 ppp
             24 softwareLoopback
             30 ds3
             32 frame-relay
             33 rs232
             37 atm
             39 sonet
             44 frameRelayService
             46 hssi
             49 aal5
             53 propVirtual
             62 Fast Ethernet (100BaseT)
             63 ISDN & X.25
             69 Full Duplex Fast Ethernet (100BaseFX)
             94 Asymetric Digital Subscriber Loop (ADSL)
            117 Gigabit Ethernet
            134 ATM Sub Interface


       $$$$ddddeeeeffffaaaauuuulllltttt
           True if and only if cfgmaker normally should accepted
           the interface based on the interfaces administrative
           and operational state (taking the flags --------nnnnoooo----ddddoooowwwwnnnn and
           --------sssshhhhoooowwww----oooopppp----ddddoooowwwwnnnn into account) and it's type (and a few
           other things).

       $$$$ddddeeeeffffaaaauuuulllltttt____iiiiffffssssttttaaaatttteeee
           True if and only if cfgmaker would have accepted the
           interface based on it's operational and administrative
           states (also taking into account the presence of the
           flags --------nnnnoooo----ddddoooowwwwnnnn and --------sssshhhhoooowwww----oooopppp----ddddoooowwwwnnnn).

       $$$$ddddeeeeffffaaaauuuulllltttt____iiiiffffttttyyyyppppeeee
           True if and only if cfgmaker would have accepted the
           interface based on it's type (and a few type specific
           details in addition).



       $$$$iiiiffff____aaaaddddmmmmiiiinnnn
           True if and only if the interface is in an adminstra-
           tive up state.

       $$$$iiiiffff____ooooppppeeeerrrr
           True if and only if the interface is in an operational
           up state.

       A number of variables are also predefined to easily decide
       if an interface belong to a certain cathegory or not.
       Below is all those variables listed together with which
       if_type numbers each variable will be true for.  Note that
       some variables refer to other variables as well.

       $$$$iiiiffff____iiiissss____eeeetttthhhheeeerrrrnnnneeeetttt
           True for ethernet interfaces (nr 6, 7, 26, 62, 69 and
           117).

       $$$$iiiiffff____iiiissss____iiiissssddddnnnn
           True for various ISDN interface types (nr 20, 21, 63,
           75, 76 and 77)

       $$$$iiiiffff____iiiissss____ddddiiiiaaaalllluuuupppp
           True for dial-up interfaces such as PPP as well as
           ISDN.  (nr 23, 81, 82 and 108 in addition to the num-
           bers of $$$$iiiiffff____iiiissss____iiiissssddddnnnn).

       $$$$iiiiffff____iiiissss____aaaattttmmmm
           True for miscellaneous ATM related interface types (nr
           37, 49, 107, 105, 106, 114 and 134).

       $$$$iiiiffff____iiiissss____llllaaaannnn
           True for LAN interfaces (8, 9, 11, 15, 26, 55, 59, 60
           and 115 in addition to the numbers of $$$$iiiiffff____iiiissss____eeeetttthhhheeeerrrr----
           nnnneeeetttt).

       $$$$iiiiffff____iiiissss____ddddssssllll
           True for ADSL, RDSL, HDSL and SDSL (nr 94, 95, 96, 97)

       $$$$iiiiffff____iiiissss____llllooooooooppppbbbbaaaacccckkkk
           True for software loopback interfaces (nr 24)

       $$$$iiiiffff____iiiissss____cccciiiissssccccoooovvvvllllaaaannnn
           True for Cisco VLAN interfaces (interfaces with the
           word Vlan or VLAN in their ifdescs)

       Besides of that, all the variables available in cfgmaker
       is at the scripts disposal even if the use of such fea-
       tures is discouraged.  More "shortcuts" in the form of
       variables and functions will be made avaiable in the
       future instead.

       EEEExxxxaaaammmmpppplllleeeessss oooonnnn FFFFiiiilllltttteeeerrrrssss

       The following filter will not affect which interfaces
       get's included or excluded, it will make cfgmaker behave
       as normally.

        '--if-filter=$default'

       The following filter will make cfgmaker exclude PPP (23)
       interfaces:

        '--if-filter=$default && $if_type!=23'

       The following filter will make cfgmaker behave as usual
       except that it will consider the operational state of an
       interface irrelevant but still reject all interfaces which
       are administratively down.

        '--if-filter=$if_admin && $default_iftype'


DDDDEEEETTTTAAAAIIIILLLLSSSS OOOONNNN TTTTEEEEMMMMPPPPLLLLAAAATTTTEEEESSSS
       The contents of the template files are evaluated as a Perl
       program.  A number or Perl variables are available for the
       program to read and others are used to be written to.

       As quite a few of the predefined variables has values
       which are are supposed to be used in HTML code some of
       them have an "HTML-escaped" variant, e.g $html_syslocation
       is the HTML escaped variant of $syslocation.  The HTML
       escaping means that the chars "<", ">" and "&" are
       replaced by "&lt;", "&gt;" and "&amp;" and that newlines
       embedded in the string are prepended with "<BR>" and
       appended with a space character (if a newline is last in
       the string it is not touched).

       WWWWrrrriiiittttaaaabbbblllleeee TTTTeeeemmmmppppllllaaaatttteeee VVVVaaaarrrriiiiaaaabbbblllleeeessss

       These are the variables available to store the configura-
       tion lines in.  Some of them are initialized prior to the
       evaluation of the template but such content normally is
       comments for inclusion in the final configuration file so
       those variables might be reset to the empty string in the
       template code to eliminate the comments.  The other way
       around is also possible, the contents of these variables
       might be extended with further information for various
       reasons such as debugging etc.

       Once the template has been evaluated, the following hap-
       pens:  if the template is a interface template and the
       actual interface for some reason is rejected and thus
       needs to be commented out, all the lines in the variable
       $$$$ttttaaaarrrrggggeeeetttt____lllliiiinnnneeeessss are turned into comments by adding a hash
       mark ("#") at their beginning.  Then all the variables
       $$$$hhhheeeeaaaadddd____lllliiiinnnneeeessss, $$$$pppprrrroooobbbblllleeeemmmm____lllliiiinnnneeeessss , $$$$ttttaaaarrrrggggeeeetttt____lllliiiinnnneeeessss and $$$$sssseeeeppppaaaarrrraaaa----
       ttttoooorrrr____lllliiiinnnneeeessss are concatenated together to form the lines to
       add to the configuration file.

       $$$$ttttaaaarrrrggggeeeetttt____lllliiiinnnneeeessss
           This variable is the placeholder for the configuration
           lines created by the template.  $$$$ttttaaaarrrrggggeeeetttt____lllliiiinnnneeeessss is pre-
           defined to be empty when the template code is evalu-
           ated.

       $$$$hhhheeeeaaaadddd____lllliiiinnnneeeessss
           This variable is intended to be the placeholder for
           the comment line appearing just before the target in
           the configuration file.  It is initialized with that
           comment line before the evaluation of the template
           code and if the template doesn't modify $$$$hhhheeeeaaaadddd____lllliiiinnnneeeessss
           during evaluation, the comment will look like usual in
           the config file.

       $$$$pppprrrroooobbbblllleeeemmmm____lllliiiinnnneeeessss
           This variable is intended to be the placholder for the
           comment lines describing any problems which might have
           been encountered when trying to add the target into
           the configuration.  For host templates it's normally
           not used and for those it's predefined as the empty
           string.  For interface templates $$$$pppprrrroooobbbblllleeeemmmm____lllliiiinnnneeeessss is
           predefined with the error description comments which
           cfgmaker normally would use for rejected interfaces or
           as the empty string for accepted interfaces.

           It is possible to test against $$$$pppprrrroooobbbblllleeeemmmm____lllliiiinnnneeeessss to find
           out if an interface will be included or rejected but
           this is not recommended.  Test against $$$$iiiiffff____ooookkkk instead.

       $$$$sssseeeeppppaaaarrrraaaattttoooorrrr____lllliiiinnnneeeessss
           This variable is the placeholder for the string to use
           as the separator between the code for individual tar-
           gets.  The contents of this variable is put after each
           target (so the lines will appear after the end of the
           last target in the config as well).

       PPPPrrrreeeeddddeeeeffffiiiinnnneeeedddd TTTTeeeemmmmppppllllaaaatttteeee VVVVaaaarrrriiiiaaaabbbblllleeeessss

       All the variables below are available for interface tem-
       plates to use.  For host templates, only those listed
       under the Host and System Variables entry elsewhere in
       this document are available.

       For interface templates the variables listed under the
       Predefined Filter Variables entry elsewhere in this docu-
       ment are also available.

       _H_o_s_t _a_n_d _S_y_s_t_e_m _V_a_r_i_a_b_l_e_s

       $$$$rrrroooouuuutttteeeerrrr____nnnnaaaammmmeeee
           This is the fully qualified name for the router.  It
           is affected by the following items on the command
           line:  the router name itself and --------ddddnnnnssss----ddddoooommmmaaaaiiiinnnn.

       $$$$rrrroooouuuutttteeeerrrr____ccccoooonnnnnnnneeeecccctttt
           This is the reference string for the router being
           polled.  It is on the form community@router possibly
           followed by some snmp options.  It is affected by the
           following items on the command line:  the router name
           itself, --------ccccoooommmmmmmmuuuunnnniiiittttyyyy, --------ssssnnnnmmmmpppp----ooooppppttttiiiioooonnnnssss and --------ddddnnnnssss----ddddoooommmmaaaaiiiinnnn.
           (There's no HTML escaped variant available)

       $$$$ddddiiiirrrreeeeccccttttoooorrrryyyy____nnnnaaaammmmeeee
           This variable should contain the directory name as
           cfgmaker normally would use as the value for the
           "Directory[]" directive.  The value is determined by
           the --------ssssuuuubbbbddddiiiirrrrssss command line option.  If --------ssssuuuubbbbddddiiiirrrrssss isn't
           specified $$$$ddddiiiirrrreeeeccccttttoooorrrryyyy____nnnnaaaammmmeeee will be the empty string.
           (There's no HTML escaped variant available)

       $$$$ssssyyyyssssccccoooonnnnttttaaaacccctttt
           This variable is the router's SNMP sysContact value.
           (HTML escaped variant: $$$$hhhhttttmmmmllll____ssssyyyyssssccccoooonnnnttttaaaacccctttt)

       $$$$ssssyyyyssssnnnnaaaammmmeeee
           This variable is the router's SNMP sysName value.  (No
           HTML escaped variant available)

       $$$$ssssyyyyssssllllooooccccaaaattttiiiioooonnnn
           This variable is the router's SNMP sysLocation value.
           (HTML escaped variant: $$$$hhhhttttmmmmllll____ssssyyyyssssllllooooccccaaaattttiiiioooonnnn)

       $$$$ssssyyyyssssddddeeeessssccccrrrr
           This variable is the router's SNMP sysDescr value.  It
           is normally not used by cfgmaker but might be useful
           in a template.  (HTML escaped variant: $$$$hhhhttttmmmmllll____ssssyyyyssssddddeeeessssccccrrrr)

       _I_n_t_e_r_f_a_c_e _T_a_r_g_e_t _R_e_l_a_t_e_d _V_a_r_i_a_b_l_e_s

       $$$$ttttaaaarrrrggggeeeetttt____nnnnaaaammmmeeee
           This is what cfgmaker normally would use as the the
           name of the target.  The target name is what is found
           within the square brackets, "[]", for target direc-
           tives.  (There's no HTML escaped variant available)

       $$$$iiiiffff____rrrreeeeffff
           This the reference string for the interface.  It is
           expected to be used in the "Target[xyz]" directive to
           distinguish what interface to use.  The value of this
           variable is affected by the --------iiiiffffrrrreeeeffff command line
           option.  It is normally used together with
           $$$$rrrroooouuuutttteeeerrrr____ccccoooonnnnnnnneeeecccctttt.  (There's no HTML escaped variant
           available)

       $$$$iiiiffff____ooookkkk
           This variable is true if the interface is going to be
           included into the configuration file, otherwise false.
           Don't test against other variables such as $$$$pppprrrroooobbbb----
           lllleeeemmmm____lllliiiinnnneeeessss to find out if an interface will be rejected
           or not, use this $$$$iiiiffff____ooookkkk instead.

       $$$$ddddeeeeffffaaaauuuulllltttt____ttttaaaarrrrggggeeeetttt____lllliiiinnnneeeessss
           This variable contains all the target lines which cfg-
           maker by default outputs for this interface.  It's
           useful if you want to have the "standard target" but
           want to add some extra lines to it by using a tem-
           plate.

       By default cfgmaker uses the following directives for each
       target it generates: Target[], SetEnv[], MaxBytes[],
       Title[], PageTop[] and if there is any directory specified
       also the Directory[] directive.

       To facilitate the creation of templates which generates
       target configs which are similar to the default one, each
       of the above mentioned directive lines have a correspond-
       ing variable containing the line as cfgmaker would have
       output it by default.

       Note that none of these have a HTML escaped variant, text
       in them is HTML escaped where needed.  Also note that they
       do not have any newline at the end.

       $$$$ddddeeeeffffaaaauuuulllltttt____ttttaaaarrrrggggeeeetttt____ddddiiiirrrreeeeccccttttiiiivvvveeee
           This variable contains the default string for the Tar-
           get[] directive line.

       $$$$ddddeeeeffffaaaauuuulllltttt____sssseeeetttteeeennnnvvvv____ddddiiiirrrreeeeccccttttiiiivvvveeee
           This variable contains the default string for the
           SetEnv[] directive line.

       $$$$ddddeeeeffffaaaauuuulllltttt____ddddiiiirrrreeeeccccttttoooorrrryyyy____ddddiiiirrrreeeeccccttttiiiivvvveeee
           This variable contains the default string for the
           Directory[] directive line which means it is an empty
           string (with no newline) if there's no directory.

       $$$$ddddeeeeffffaaaauuuulllltttt____mmmmaaaaxxxxbbbbyyyytttteeeessss____ddddiiiirrrreeeeccccttttiiiivvvveeee
           This variable contains the default string for the
           MaxBytes[] directive line.

       $$$$ddddeeeeffffaaaauuuulllltttt____ttttiiiittttlllleeee____ddddiiiirrrreeeeccccttttiiiivvvveeee
           This variable contains the default string for the
           Title[] directive line.

       $$$$ddddeeeeffffaaaauuuulllltttt____ppppaaaaggggeeeettttoooopppp____ddddiiiirrrreeeeccccttttiiiivvvveeee
           This variable contains the default string for the
           PageTop[] directive lines.

       _I_n_t_e_r_f_a_c_e _N_e_t_w_o_r_k _C_o_n_f_i_g_u_r_a_t_i_o_n _V_a_r_i_a_b_l_e_s

       $$$$iiiiffff____iiiipppp
           This variable should contain the IP-address of the
           interface, if any has been assigned to it.  (There's
           no HTML escaped variant available)

       $$$$iiiiffffiiiinnnnddddeeeexxxx
           This variable is the SNMP ifIndex for the interface
           which per definition always is an integer.  (There's
           no HTML escaped variant available)

       $$$$iiiiffff____iiiinnnnddddeeeexxxx
           Equivalent with $$$$iiiiffffiiiinnnnddddeeeexxxx.

       $$$$iiiiffff____eeeetttthhhh
           Contains the ethernet address of the interface, if
           any.  (There's no HTML escaped variant available)

       $$$$iiiiffff____ssssppppeeeeeeeedddd
           This variable is the speed in bytes/second (with pre-
           fixes).  (There's no HTML escaped variant available)

       $$$$iiiiffff____ssssppppeeeeeeeedddd____ssssttttrrrr
           This variable is a cooked speed description which is
           either in bits or bytes depending on wether or not the
           bits option is active and also with the proper prefix
           for the speed (k, M, G etc).  (No HTML escaped variant
           available)

       $$$$iiiiffff____ttttyyyyppppeeee____ddddeeeesssscccc
           This variable is a textual description of the inter-
           face type.  (HTML escaped variant: $$$$hhhhttttmmmmllll____iiiiffff____ttttyyyyppppeeee____ddddeeeesssscccc)

       $$$$iiiiffff____ttttyyyyppppeeee____nnnnuuuummmm
           This variable the integer value corresponding to the
           interface type (for a listing for the value for the
           more common interface types, see the section DETAILS
           ON FILTERS above).  (No HTML escaped variant avail-
           able)

       $$$$iiiiffff____ddddnnnnssss____nnnnaaaammmmeeee
           This is the DNS name for the interface.  (No HTML
           escaped variant available)

       _I_n_t_e_r_f_a_c_e _N_a_m_e_, _D_e_s_c_r_i_p_t_i_o_n _a_n_d _A_l_i_a_s _V_a_r_i_a_b_l_e_s

       It might seem confusing with both _N_a_m_e, _D_e_s_c_r_i_p_t_i_o_n and
       _A_l_i_a_s in this context and to some extent it is.  _N_a_m_e and
       _D_e_s_c_r_i_p_t_i_o_n are usually supported on most equipment but
       how they are used varies, both between manufacturers as
       well as between different cathegories of equipment from
       the same manufacturer.  The _A_l_i_a_s is at least supported by
       Cisco IOS, and that variable contains whatever is used in
       the IOS statement called "description" for the interface
       (not to be confused with the SNMP variables for _D_e_s_c_r_i_p_-
       _t_i_o_n).

       For better control from the command line consider
       $$$$iiiiffff____ttttiiiittttlllleeee____ddddeeeesssscccc which contents are controlled by the --------iiiiffff----
       ddddeeeessssccccrrrr command line option.

       $$$$iiiiffff____ssssnnnnmmmmpppp____ddddeeeessssccccrrrr
           This variable should contain the "raw" description of
           the interface as determined by the SNMP polling of the
           router.  (HTML escaped variant: $$$$hhhhttttmmmmllll____iiiiffff____ssssnnnnmmmmpppp____ddddeeeessssccccrrrr)

       $$$$iiiiffff____ssssnnnnmmmmpppp____nnnnaaaammmmeeee
           The "raw" name for the interface as provided by SNMP
           polling.  (HTML escaped variant: $$$$hhhhttttmmmmllll____iiiiffff____ssssnnnnmmmmpppp____nnnnaaaammmmeeee)

       $$$$iiiiffff____ssssnnnnmmmmpppp____aaaalllliiiiaaaassss
           The "raw" ifAlias for the interface as provided by
           SNMP polling. (HTML escaped variant:
           $$$$hhhhttttmmmmllll____iiiiffff____ssssnnnnmmmmpppp____aaaalllliiiiaaaassss)

       $$$$iiiiffff____cccciiiissssccccoooo____ddddeeeessssccccrrrr
           The "raw" CiscolocIfDescr for the interface as pro-
           vided by SNMP polling.  (HTML escaped variant:
           $$$$hhhhttttmmmmllll____iiiiffff____cccciiiissssccccoooo____ddddeeeessssccccrrrr)

       $$$$iiiiffff____ddddeeeessssccccrrrriiiippppttttiiiioooonnnn
           This is the "cooked" description string for the inter-
           face, taking into account the SNMP values found for
           the interface's RDescr, ifAlias and CiscolocIfDescr.
           (HTML escaped variant: $$$$hhhhttttmmmmllll____iiiiffff____ddddeeeessssccccrrrriiiippppttttiiiioooonnnn)

       $$$$iiiiffff____ttttiiiittttlllleeee
           The full string cfgmaker by default would have used
           for the Title[] directive in the configuration as well
           as the content of the topmost H1 tag in the PageTop[].
           Is composed by the contents of $$$$ddddeeeesssscccc____pppprrrreeeeffffiiiixxxx,
           $$$$iiiiffff____ttttiiiittttlllleeee____ddddeeeesssscccc and $$$$ssssyyyyssssnnnnaaaammmmeeee.

           As $$$$iiiiffff____ttttiiiittttlllleeee depends on $$$$iiiiffff____ttttiiiittttlllleeee____ddddeeeesssscccc, it is possible
           to indirectly control $$$$iiiiffff____ttttiiiittttlllleeee by using the command
           line option --------iiiiffff----ddddeeeessssccccrrrr.

           (HTML escaped variant: $$$$hhhhttttmmmmllll____iiiiffff____ttttiiiittttlllleeee)

       $$$$iiiiffff____ppppoooorrrrtttt____nnnnaaaammmmeeee
           If the host is a Cisco Catalyst LAN switch, this vari-
           able is the name of that port.  (No HTML escaped vari-
           ant available)

       $$$$ddddeeeesssscccc____pppprrrreeeeffffiiiixxxx
           This variable is a prefix of the description of what
           the target is to use in the "Title[]" directive and in
           the H1 section of the "PageTop[]".  Default is "Traf-
           fic analysis for ".  (HTML escaped variant:
           $$$$hhhhttttmmmmllll____ddddeeeesssscccc____pppprrrreeeeffffiiiixxxx)

       $$$$iiiiffff____ttttiiiittttlllleeee____ddddeeeesssscccc
           This is the description of the interface normally used
           by cfgmaker as part of the variable $$$$iiiiffff____ttttiiiittttlllleeee.  The
           latter is used as the full string in the "Title[]"
           directove and the H1 section in the PageTop[].

           $$$$iiiiffff____ttttiiiittttlllleeee____ddddeeeesssscccc is controlled by the command line
           option --------iiiiffff----ddddeeeessssccccrrrr which indirectly controls the con-
           tents of $$$$iiiiffff____ttttiiiittttlllleeee

           (HTML escaped variant: $$$$hhhhttttmmmmllll____iiiiffff____ttttiiiittttlllleeee____ddddeeeesssscccc)




       HHHHeeeellllpppp FFFFuuuunnnnccccttttiiiioooonnnnssss ffffoooorrrr TTTTeeeemmmmppppllllaaaatttteeeessss

       The following functions exists to facilitate the writing
       of host and interface templates.

       hhhhttttmmmmllll____eeeessssccccaaaappppeeee((((_ss_tt_rr_ii_nn_gg))))
           _hh_tt_mm_ll____ee_ss_cc_aa_pp_ee_((_)) takes a string as an argument and
           returns a new string where the following substitutions
           has been done:  the chars "<", ">" and "&" are
           replaced by "&lt;", "&gt;" and "&amp;" and that new-
           lines embedded in the string are prepended with "<BR>"
           and appended with a space character (newlines at the
           end of the string are not touched).

       EEEExxxxaaaammmmpppplllleeee TTTTeeeemmmmppppllllaaaatttteeee FFFFiiiilllleeeessss

       _T_e_m_p_l_a_t_e _E_x_a_m_p_l_e _1_: _E_l_i_m_i_n_a_t_i_n_g _R_e_j_e_c_t_e_d _T_a_r_g_e_t_s _F_r_o_m
       _A_p_p_e_a_r_i_n_g

       This template file generates exactly the same configura-
       tion code per interface as cfgmaker does by default, with
       the exception that it eliminates all lines (comments as
       well as config code) for an interface if the interface
       happens to be rejected.

        if(not $problem_lines)
        {
          $target_lines .= <<ECHO;

        Target[$target_name]: $if_ref:$router_connect
        SetEnv[$target_name]: MRTG_INT_IP="$if_ip" MRTG_INT_DESCR="$if_snmp_descr"
        ECHO

          if ($directory_name) {
              $target_lines .= "Directory[$target_name]: $directory_name\n";
          }

          $target_lines .= <<ECHO;
        MaxBytes[$target_name]: $if_speed
        Title[$target_name]: $html_desc_prefix$html_if_title_desc -- $sysname
        PageTop[$target_name]: <H1>$html_desc_prefix$html_if_title_desc -- $sysname</H1>
         <TABLE>
           <TR><TD>System:</TD>     <TD>$sysname in $html_syslocation</TD></TR>
           <TR><TD>Maintainer:</TD> <TD>$html_syscontact</TD></TR>
           <TR><TD>Description:</TD><TD>$html_if_description</TD></TR>
           <TR><TD>ifType:</TD>     <TD>$html_if_type_desc ($if_type_num)</TD></TR>
           <TR><TD>ifName:</TD>     <TD>$html_if_snmp_name</TD></TR>
        ECHO

          $target_lines .= <<ECHO if defined $if_port_name;
           <TR><TD>Port Name:</TD>  <TD>$if_port_name</TD></TR>
        ECHO

          $target_lines .= <<ECHO;
           <TR><TD>Max Speed:</TD>  <TD>$if_speed_str</TD></TR>
        ECHO

          $target_lines .= <<ECHO if $if_ip;
           <TR><TD>Ip:</TD>         <TD>$if_ip ($if_dns_name)</TD></TR>
        ECHO





          $target_lines .= <<ECHO;
         </TABLE>
        ECHO
        } else {
          $head_lines="";
          $problem_lines="";
          $target_lines="";
          $separator_lines="";
        }

       _T_e_m_p_l_a_t_e _E_x_a_m_p_l_e _2_: _S_i_m_p_l_i_e_r _V_e_r_s_i_o_n _o_f _E_x_a_m_p_l_e _1

       Example 1 was partly intended to demonstrate how to cus-
       tomize the generation of interface targets but also to
       provide a hint of how the variables are used in the
       "default" template which one could consider that cfgmaker
       normally uses.

       If you're only intrested in the easiest way of entirely
       eliminating those reject interfaces, the template below
       would do the job as well by using $$$$ddddeeeeffffaaaauuuulllltttt____ttttaaaarrrrggggeeeetttt____lllliiiinnnneeeessss.

        if($if_ok) {
         $target_lines = $default_target_lines;
        } else {
          $head_lines="";
          $problem_lines="";
          $target_lines="";
          $separator_lines="";
        }

       _T_e_m_p_l_a_t_e _E_x_a_m_p_l_e _3_: _C_r_e_a_t_i_n_g _C_P_U _T_a_r_g_e_t_s _f_o_r _H_o_s_t_s

       Below is an example of a host template.

        $head_lines .= <<ECHO;
        #---------------------------------------------------------------------
        ECHO

        my $target_name = $router_name . ".cpu";

        $target_lines .= <<ECHO;

        YLegend[$target_name]: Percentage CPU load
        ShortLegend[$target_name]: %
        Legend1[$target_name]: CPU load in %
        Legend2[$target_name]:
        Legend3[$target_name]: Max Observed CPU load
        Legend4[$target_name]:
        LegendI[$target_name]: &nbsp;CPU Load:
        LegendO[$target_name]:
        WithPeak[$target_name]: ywm
        MaxBytes[$target_name]: 100
        Options[$target_name]: growright, gauge, nopercent
        Title[$target_name]: $router_name CPU load
        Target[$target_name]: 1.3.6.1.4.1.9.2.1.58.0&1.3.6.1.4.1.9.2.1.58.0:$router_connect
        PageTop[$target_name]: <H1>$router_name CPU load</H1>
          <TABLE>
            <TR><TD>System:</TD><TD>$router_name in $html_syslocation</TD></TR>
            <TR><TD>Maintainer:</TD><TD>$html_syscontact</TD></TR>
            <TR><TD VALIGN="top">Description:</TD><TD>$html_sysdescr</TD></TR>
            <TR><TD>Resource:</TD><TD>CPU.</TD></TR>
          </TABLE>
        ECHO


EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
       The first example creates a config file for
       _r_o_u_t_e_r_._p_l_a_c_e_._x_y_z:  the router has the community name _p_u_b_-
       _l_i_c.  Interfaces get identified by their IP number.  Two
       global options get added to the config file.  The config
       file gets redirected to _m_r_t_g_._c_o_n_f.  The '\' signs at the
       end of the line mean that this command should be written
       on a single line.

        cfgmaker --global "WorkDir: /home/tobi"           \
                 --global "Options[_]: growright,bits"    \
                 --ifref=ip                               \
                 public@router.place.xyz > mrtg.cfg

       The next example creates a config file for four devices:
       _r_o_u_t_e_r_1_._p_l_a_c_e_._x_y_z, _r_o_u_t_e_r_2_._p_l_a_c_e_._x_y_z, _s_w_i_t_c_h_1_._p_l_a_c_e_._x_y_z
       and _s_w_i_t_c_h_2_._p_l_a_c_e_._x_y_z all with the community _p_u_b_l_i_c.

       The two routers will have --------iiiiffffrrrreeeeffff set to ddddeeeessssccccrrrr whilst the
       two switches will use --------iiiiffffrrrreeeeffff set to nnnnaaaammmmeeee.  Further the
       routers will use --------iiiiffffddddeeeesssscccc set to aaaalllliiiiaaaassss and
       _s_w_i_t_c_h_1_._p_l_a_c_e_._x_y_z will use --------iiiiffffddddeeeesssscccc set to ddddeeeessssccccrrrr whilst
       _s_w_i_t_c_h_2_._p_l_a_c_e_._x_y_z use nnnnaaaammmmeeee instead.

       Finally, there will be two Options lines inserted in the
       configuration: One will be in the beginning, whilst the
       other will be inserted after the lines related to the two
       routers but before those lines related to the switches.

        cfgmaker --global "WorkDir: /home/tobi"           \
                 --global "Options[_]: growright,bits"    \
                 --ifref=descr                            \
                 --ifdesc=alias                           \
                 public@router1.place.xyz                 \
                 public@router2.place.xyz                 \
                 --global "Options[_]: growright"         \
                 --ifref=name                             \
                 --ifdesc=descr                           \
                 public@switch1.place.xyz                 \
                 --ifdesc=name                            \
                 public@switch2.place.xyz > mrtg.cfg

       The next example demonstrates how to use the --------ccccoooommmmmmmmuuuunnnniiiittttyyyy,
       --------ssssnnnnmmmmpppp----ooooppppttttiiiioooonnnnssss and --------ddddnnnnssss----ddddoooommmmaaaaiiiinnnn to make the command line
       simpler.  All the equipment will use the community _h_i_d_d_e_n,
       except for the ppp-server which use community _a_c_c_e_s_s.  All
       equipment uses these SNMP options: 1111ssss ttttiiiimmmmeeeeoooouuuutttt, 1111 rrrreeeettttrrrryyyy and
       SSSSNNNNMMMMPPPP vvvveeeerrrrssssiiiioooonnnn 2222 (bbbbaaaacccckkkkooooffffffff and ppppoooorrrrtttt is unspecified which
       means they use the default values).  The exception again
       is the ppp-server which uses SSSSNNNNMMMMPPPP vvvveeeerrrrssssiiiioooonnnn 1111.  Finally, all
       the equipment is part of the domain _p_l_a_c_e_._x_y_z, except for
       the ppp-server which is part of the domain
       _r_e_m_o_t_e_._p_l_a_c_e_._x_y_z.  Note that the latter is achieved simply
       by specifying the name of the ppp-server to be _p_p_p_-
       _s_e_r_v_e_r_._rr_ee_mm_oo_tt_ee .











        cfgmaker --global "WorkDir: /home/tobi"           \
                 --global "Options[_]: growright,bits"    \
                 --dns-domain=place.xyz                   \
                 --community=hidden                       \
                 --snmp-options=::1:1::2                  \
                 router1                                  \
                 router2                                  \
                 router3                                  \
                 router4                                  \
                 router5                                  \
                 switch1                                  \
                 switch2                                  \
                 switch3                                  \
                 switch4                                  \
                 switch5                                  \
                 switch6                                  \
                 switch7                                  \
                 access@ppp-server.remote:::::1 > mrtg.cfg


SSSSEEEEEEEE AAAALLLLSSSSOOOO
       the reference manpage

AAAAUUUUTTTTHHHHOOOORRRR
       Tobias Oetiker <tobi@oetiker.ch> and Jakob Ilves
       <jakob.ilves@oracle.com>

LLLLIIIICCCCEEEENNNNSSSSEEEE
       GNU General Public License

CCCCOOOOPPPPYYYYRRRRIIIIGGGGHHHHTTTT
       Cfgmaker is Copyright 2000 by Tobias Oetiker
       <tobi@oetiker.ch>



2001-06-05                    2.9.17                  CFGMAKER(1)