|
Packit |
667938 |
.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29)
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" Standard preamble:
|
|
Packit |
667938 |
.\" ========================================================================
|
|
Packit |
667938 |
.de Sp \" Vertical space (when we can't use .PP)
|
|
Packit |
667938 |
.if t .sp .5v
|
|
Packit |
667938 |
.if n .sp
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
.de Vb \" Begin verbatim text
|
|
Packit |
667938 |
.ft CW
|
|
Packit |
667938 |
.nf
|
|
Packit |
667938 |
.ne \\$1
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
.de Ve \" End verbatim text
|
|
Packit |
667938 |
.ft R
|
|
Packit |
667938 |
.fi
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
.\" Set up some character translations and predefined strings. \*(-- will
|
|
Packit |
667938 |
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
|
Packit |
667938 |
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
|
|
Packit |
667938 |
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
|
|
Packit |
667938 |
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
|
|
Packit |
667938 |
.\" nothing in troff, for use with C<>.
|
|
Packit |
667938 |
.tr \(*W-
|
|
Packit |
667938 |
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
|
Packit |
667938 |
.ie n \{\
|
|
Packit |
667938 |
. ds -- \(*W-
|
|
Packit |
667938 |
. ds PI pi
|
|
Packit |
667938 |
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
|
Packit |
667938 |
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
|
Packit |
667938 |
. ds L" ""
|
|
Packit |
667938 |
. ds R" ""
|
|
Packit |
667938 |
. ds C` ""
|
|
Packit |
667938 |
. ds C' ""
|
|
Packit |
667938 |
'br\}
|
|
Packit |
667938 |
.el\{\
|
|
Packit |
667938 |
. ds -- \|\(em\|
|
|
Packit |
667938 |
. ds PI \(*p
|
|
Packit |
667938 |
. ds L" ``
|
|
Packit |
667938 |
. ds R" ''
|
|
Packit |
667938 |
. ds C`
|
|
Packit |
667938 |
. ds C'
|
|
Packit |
667938 |
'br\}
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" Escape single quotes in literal strings from groff's Unicode transform.
|
|
Packit |
667938 |
.ie \n(.g .ds Aq \(aq
|
|
Packit |
667938 |
.el .ds Aq '
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" If the F register is turned on, we'll generate index entries on stderr for
|
|
Packit |
667938 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
|
|
Packit |
667938 |
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
|
Packit |
667938 |
.\" output yourself in some meaningful fashion.
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" Avoid warning from groff about undefined register 'F'.
|
|
Packit |
667938 |
.de IX
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
.nr rF 0
|
|
Packit |
667938 |
.if \n(.g .if rF .nr rF 1
|
|
Packit |
667938 |
.if (\n(rF:(\n(.g==0)) \{
|
|
Packit |
667938 |
. if \nF \{
|
|
Packit |
667938 |
. de IX
|
|
Packit |
667938 |
. tm Index:\\$1\t\\n%\t"\\$2"
|
|
Packit |
667938 |
..
|
|
Packit |
667938 |
. if !\nF==2 \{
|
|
Packit |
667938 |
. nr % 0
|
|
Packit |
667938 |
. nr F 2
|
|
Packit |
667938 |
. \}
|
|
Packit |
667938 |
. \}
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
.rr rF
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
|
Packit |
667938 |
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
|
Packit |
667938 |
. \" fudge factors for nroff and troff
|
|
Packit |
667938 |
.if n \{\
|
|
Packit |
667938 |
. ds #H 0
|
|
Packit |
667938 |
. ds #V .8m
|
|
Packit |
667938 |
. ds #F .3m
|
|
Packit |
667938 |
. ds #[ \f1
|
|
Packit |
667938 |
. ds #] \fP
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
.if t \{\
|
|
Packit |
667938 |
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
|
Packit |
667938 |
. ds #V .6m
|
|
Packit |
667938 |
. ds #F 0
|
|
Packit |
667938 |
. ds #[ \&
|
|
Packit |
667938 |
. ds #] \&
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
. \" simple accents for nroff and troff
|
|
Packit |
667938 |
.if n \{\
|
|
Packit |
667938 |
. ds ' \&
|
|
Packit |
667938 |
. ds ` \&
|
|
Packit |
667938 |
. ds ^ \&
|
|
Packit |
667938 |
. ds , \&
|
|
Packit |
667938 |
. ds ~ ~
|
|
Packit |
667938 |
. ds /
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
.if t \{\
|
|
Packit |
667938 |
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
|
Packit |
667938 |
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
|
Packit |
667938 |
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
|
Packit |
667938 |
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
|
Packit |
667938 |
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
|
Packit |
667938 |
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
. \" troff and (daisy-wheel) nroff accents
|
|
Packit |
667938 |
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
|
Packit |
667938 |
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
|
Packit |
667938 |
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
|
Packit |
667938 |
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
|
Packit |
667938 |
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
|
Packit |
667938 |
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
|
Packit |
667938 |
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
|
Packit |
667938 |
.ds ae a\h'-(\w'a'u*4/10)'e
|
|
Packit |
667938 |
.ds Ae A\h'-(\w'A'u*4/10)'E
|
|
Packit |
667938 |
. \" corrections for vroff
|
|
Packit |
667938 |
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
|
Packit |
667938 |
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
|
Packit |
667938 |
. \" for low resolution devices (crt and lpr)
|
|
Packit |
667938 |
.if \n(.H>23 .if \n(.V>19 \
|
|
Packit |
667938 |
\{\
|
|
Packit |
667938 |
. ds : e
|
|
Packit |
667938 |
. ds 8 ss
|
|
Packit |
667938 |
. ds o a
|
|
Packit |
667938 |
. ds d- d\h'-1'\(ga
|
|
Packit |
667938 |
. ds D- D\h'-1'\(hy
|
|
Packit |
667938 |
. ds th \o'bp'
|
|
Packit |
667938 |
. ds Th \o'LP'
|
|
Packit |
667938 |
. ds ae ae
|
|
Packit |
667938 |
. ds Ae AE
|
|
Packit |
667938 |
.\}
|
|
Packit |
667938 |
.rm #[ #] #H #V #F C
|
|
Packit |
667938 |
.\" ========================================================================
|
|
Packit |
667938 |
.\"
|
|
Packit |
667938 |
.IX Title "CFGMAKER 1"
|
|
Packit |
667938 |
.TH CFGMAKER 1 "2018-07-13" "2.17.7" "mrtg"
|
|
Packit |
667938 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
|
Packit |
667938 |
.\" way too many mistakes in technical documents.
|
|
Packit |
667938 |
.if n .ad l
|
|
Packit |
667938 |
.nh
|
|
Packit |
667938 |
.SH "NAME"
|
|
Packit |
667938 |
cfgmaker \- Creates mrtg.cfg files (for mrtg\-2.17.7)
|
|
Packit |
667938 |
.SH "SYNOPSIS"
|
|
Packit |
667938 |
.IX Header "SYNOPSIS"
|
|
Packit |
667938 |
cfgmaker [options] [community@]router [[options] [community@]router ...]
|
|
Packit |
667938 |
.SH "OPTIONS"
|
|
Packit |
667938 |
.IX Header "OPTIONS"
|
|
Packit |
667938 |
.Vb 9
|
|
Packit |
667938 |
\& \-\-ifref=nr interface references by Interface Number (default)
|
|
Packit |
667938 |
\& \-\-ifref=ip ... by Ip Address
|
|
Packit |
667938 |
\& \-\-ifref=eth ... by Ethernet Number
|
|
Packit |
667938 |
\& \-\-ifref=descr ... by Interface Description
|
|
Packit |
667938 |
\& \-\-ifref=name ... by Interface Name
|
|
Packit |
667938 |
\& \-\-ifref=type ... by Interface Type
|
|
Packit |
667938 |
\& You may also use multiple options separated by commas,
|
|
Packit |
667938 |
\& in which case the first available one is used:
|
|
Packit |
667938 |
\& e.g. \-\-ifref=ip,name,nr
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-ifdesc=nr interface description uses Interface Number (default)
|
|
Packit |
667938 |
\& \-\-ifdesc=ip ... uses Ip Address
|
|
Packit |
667938 |
\& \-\-ifdesc=eth ... uses Ethernet Number
|
|
Packit |
667938 |
\& \-\-ifdesc=descr ... uses Interface Description
|
|
Packit |
667938 |
\& \-\-ifdesc=name ... uses Interface Name
|
|
Packit |
667938 |
\& \-\-ifdesc=catname ... uses CatOS Interface Name
|
|
Packit |
667938 |
\& \-\-ifdesc=ppname ... uses Passport Port Name
|
|
Packit |
667938 |
\& \-\-ifdesc=alias ... uses Interface Alias
|
|
Packit |
667938 |
\& \-\-ifdesc=type ... uses Interface Type
|
|
Packit |
667938 |
\& You may also use multiple options separated by commas,
|
|
Packit |
667938 |
\& in which case the first available one is used:
|
|
Packit |
667938 |
\& e.g. \-\-ifdesc=catname,ppname,descr,alias,ip,name,nr
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-if\-filter=f Test every interface against filter f to decide wether
|
|
Packit |
667938 |
\& or not to include that interface into the collection.
|
|
Packit |
667938 |
\& Currently f is being evaluated as a Perl expression
|
|
Packit |
667938 |
\& and it\*(Aqs truth value is used to reject or accept the
|
|
Packit |
667938 |
\& interface.
|
|
Packit |
667938 |
\& (Experimental, under development, might change)
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-if\-template=templatefile
|
|
Packit |
667938 |
\& Replace the normal target entries for the interfaces
|
|
Packit |
667938 |
\& with an entry as specified by the contents in the file
|
|
Packit |
667938 |
\& templatefile. The file is supposed to contain Perl
|
|
Packit |
667938 |
\& code to be executed to generate the lines for the
|
|
Packit |
667938 |
\& target in the configuration file.
|
|
Packit |
667938 |
\& (Experimental, under development, might change)
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-host\-template=templatefile
|
|
Packit |
667938 |
\& In addition to creating targets for a host\*(Aqs interfaces
|
|
Packit |
667938 |
\& do also create targets for the host itself as specified
|
|
Packit |
667938 |
\& by the contents in the file templatefile. The file is
|
|
Packit |
667938 |
\& supposed to contain Perl code to be executed to generate
|
|
Packit |
667938 |
\& the lines for the host related targets (such as CPU,
|
|
Packit |
667938 |
\& ping response time measurements etc.) in the config\-
|
|
Packit |
667938 |
\& uration file.
|
|
Packit |
667938 |
\& (Experimental, under development, might change)
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-global "x: a" add global config entries
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-no\-down do not look at admin or opr status of interfaces
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-show\-op\-down show interfaces which are operatively down
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-zero\-speed=spd use this speed in bits\-per\-second as the interface
|
|
Packit |
667938 |
\& speed for all interfaces that return a speed of 0
|
|
Packit |
667938 |
\& via ifSpeed/ifHighSpeed. 100Mbps = 100000000
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-subdirs=format give each router its own subdirectory, naming each per
|
|
Packit |
667938 |
\& "format", in which HOSTNAME and SNMPNAME will be
|
|
Packit |
667938 |
\& replaced by the values of those items \-\- for instance,
|
|
Packit |
667938 |
\& \-\-subdirs=HOSTNAME or \-\-subdirs="HOSTNAME (SNMPNAME)"
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-noreversedns do not reverse lookup ip numbers
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-community=cmty Set the default community string to "cmty" instead of
|
|
Packit |
667938 |
\& "public".
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-enable\-ipv6 Enable IPv6 support, if the required libraries are
|
|
Packit |
667938 |
\& present. Numeric IPv6 addresses must be enclosed
|
|
Packit |
667938 |
\& in square brackets, e.g. public@[2001:760:4::1]:161
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-use\-16bit Use 16bit SNMP request IDs to query all routers.
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-snmp\-options=:[<port>][:[<tmout>][:[<retr>][:[<backoff>][:<ver>]]]]
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& Specify default SNMP options to be appended to all
|
|
Packit |
667938 |
\& routers following. Individual fields can be empty.
|
|
Packit |
667938 |
\& Routers following might override some or all of the
|
|
Packit |
667938 |
\& options given to \-\-snmp\-options.
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-dns\-domain=domain
|
|
Packit |
667938 |
\& Specifies a domain to append to the name of all
|
|
Packit |
667938 |
\& routers following.
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-nointerfaces Don\*(Aqt do generate any configuration lines for interfaces,
|
|
Packit |
667938 |
\& skip the step of gathering interface information and
|
|
Packit |
667938 |
\& don\*(Aqt run any interface template code.
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-interfaces Generate configuration lines for interfaces (this is the
|
|
Packit |
667938 |
\& default). The main purpose of this option is to negate
|
|
Packit |
667938 |
\& an \-\-nointerfaces appearing earlier on the command line.
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-help brief help message
|
|
Packit |
667938 |
\& \-\-man full documentation
|
|
Packit |
667938 |
\& \-\-version print the version of cfgmaker
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& \-\-output=file output filename default is STDOUT
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.SH "DESCRIPTION"
|
|
Packit |
667938 |
.IX Header "DESCRIPTION"
|
|
Packit |
667938 |
\&\fBCfgmaker\fR creates \s-1MRTG\s0 configuration files based on information
|
|
Packit |
667938 |
pulled from a router or another \s-1SNMP\s0 manageable device.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
[\fIcommunity\fR\fB@\fR]\fIrouter\fR
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\&\fICommunity\fR is the community name of the device you want to create a
|
|
Packit |
667938 |
configuration for. If not specified, it defaults to '\fBpublic\fR'; you might
|
|
Packit |
667938 |
want to try this first if you do not know the community name of a
|
|
Packit |
667938 |
device. If you are using the wrong community name you will get no
|
|
Packit |
667938 |
response from the device.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\&\fIRouter\fR is the \s-1DNS\s0 name or the \s-1IP\s0 number of an SNMP-managable device.
|
|
Packit |
667938 |
Following the name you can specify 6 further options separated by
|
|
Packit |
667938 |
colons. The full syntax looks like this:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\&\fBrouter\fR[:[\fBprt\fR][:[\fBtmout\fR][:[\fBretr\fR][:[\fBbackoff\fR][:\fBvers\fR]]]]]
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Of special interest may be the last parameter, \fBvers\fR. If you set this to
|
|
Packit |
667938 |
\&'2' then your device will be queried with \s-1SNMP\s0 version 2 requests. This
|
|
Packit |
667938 |
allows you to poll the 64 bit traffic counters in the device and will thus work
|
|
Packit |
667938 |
much better with fast interfaces (no more counter overrun). Note that the
|
|
Packit |
667938 |
order in which the routers are specified on the command line do matter as
|
|
Packit |
667938 |
the same order is used when the configuration file is generated. The first
|
|
Packit |
667938 |
specified router has it's configuration lines genrated first, followed by
|
|
Packit |
667938 |
the lines belonging to the next router and so on.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Note that the first line of the generated cfg file will contain all the
|
|
Packit |
667938 |
commandline options you used for generating it. This is to allow for the
|
|
Packit |
667938 |
easy 'regeneration' in case you want to add newhosts or make some other
|
|
Packit |
667938 |
global change.
|
|
Packit |
667938 |
.SS "Configuration"
|
|
Packit |
667938 |
.IX Subsection "Configuration"
|
|
Packit |
667938 |
Except for the \fB\-\-output\fR and \fB\-\-global\fR options, all options affect
|
|
Packit |
667938 |
only the routers following them on the command line. If an option
|
|
Packit |
667938 |
specified earlier on the command line reappears later on the command
|
|
Packit |
667938 |
line with another value, the new value overrides the old value as far as
|
|
Packit |
667938 |
remaining routers are concerned. This way options might be tailored for
|
|
Packit |
667938 |
groups of routers or for individual routers.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
See \fB\-\-output\fR and \fB\-\-global\fR for how their behaviour is affected by
|
|
Packit |
667938 |
where or how many times they appear on the command line.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
See the \fBExamples\fR below on how to set an option differently for
|
|
Packit |
667938 |
multiple routers.
|
|
Packit |
667938 |
.IP "\fB\-\-help\fR" 4
|
|
Packit |
667938 |
.IX Item "--help"
|
|
Packit |
667938 |
Print a brief help message and exit.
|
|
Packit |
667938 |
.IP "\fB\-\-man\fR" 4
|
|
Packit |
667938 |
.IX Item "--man"
|
|
Packit |
667938 |
Prints the manual page and exits.
|
|
Packit |
667938 |
.IP "\fB\-\-version\fR" 4
|
|
Packit |
667938 |
.IX Item "--version"
|
|
Packit |
667938 |
Print the version of cfgmaker. This should match the version of \s-1MRTG\s0
|
|
Packit |
667938 |
for which config files are being created.
|
|
Packit |
667938 |
.IP "\fB\-\-ifref\fR \fBnr\fR|\fBip\fR|\fBeth\fR|\fBdescr\fR|\fBname\fR" 4
|
|
Packit |
667938 |
.IX Item "--ifref nr|ip|eth|descr|name"
|
|
Packit |
667938 |
Select the interface identification method. Default is \fBnr\fR which
|
|
Packit |
667938 |
identifies the router interfaces by their number. Unfortunately the
|
|
Packit |
667938 |
interface numbering scheme in an \s-1SNMP\s0 tree can change. Some routers
|
|
Packit |
667938 |
change their numbering when new interfaces are added, others change
|
|
Packit |
667938 |
thier numbering every full moon just for fun.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
To work around this sad problem \s-1MRTG\s0 can identify interfaces by 4
|
|
Packit |
667938 |
other properties. None of these works for all interfaces, but you
|
|
Packit |
667938 |
should be able to find one which does fine for you. Note that
|
|
Packit |
667938 |
especially ethernet addrsses can be problematic as some routers have
|
|
Packit |
667938 |
the same ethernet address on most of their interface cards.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Select \fBip\fR to identify the interface by its \s-1IP\s0 number. Use \fBeth\fR to
|
|
Packit |
667938 |
use the ethernet address for identification. Use \fBdescr\fR to use
|
|
Packit |
667938 |
the Interface description. Or use \fBname\fR to use the Interface name.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
You can specify multiple properties if you wish, separated by commas.
|
|
Packit |
667938 |
In this case, cfgmaker will use the first item in the list which
|
|
Packit |
667938 |
can provide unique identification. This allows you to specify, for
|
|
Packit |
667938 |
example, to use \s-1IP\s0 address and to use ifName if this is not defined:
|
|
Packit |
667938 |
\-\-ifref ip,name
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
If your chosen method does not allow unique interface identification on
|
|
Packit |
667938 |
the device you are querying, \fBcfgmaker\fR will tell you about it.
|
|
Packit |
667938 |
.IP "\fB\-\-ifdesc\fR \fBnr\fR|\fBip\fR|\fBeth\fR|\fBdescr\fR|\fBname\fR|\fBtype\fR|\fBalias\fR" 4
|
|
Packit |
667938 |
.IX Item "--ifdesc nr|ip|eth|descr|name|type|alias"
|
|
Packit |
667938 |
Select what to use as the description of the interface. The description
|
|
Packit |
667938 |
appears in the \f(CW\*(C`Title[]\*(C'\fR property for the target as well as the text header
|
|
Packit |
667938 |
in the \s-1HTML\s0 code defined in the target's \f(CW\*(C`PageTop[]\*(C'\fR. Default is to use
|
|
Packit |
667938 |
\&\fBnr\fR which is just the interface number which isn't always useful
|
|
Packit |
667938 |
to the viewer of the graphs.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
There are 6 other properties which could be used. Use \fBip\fR if you want
|
|
Packit |
667938 |
to use the interface's IP-address. Use \fBeth\fR if you want to use the
|
|
Packit |
667938 |
interface's ethernet address. If you want a better description, you can
|
|
Packit |
667938 |
use either \fBdescr\fR, \fBname\fR or \fBalias\fR. Exactly what each of these do
|
|
Packit |
667938 |
varies between different equipment so you might need to experiment. For
|
|
Packit |
667938 |
instance, for a serial interface on a Cisco router running \s-1IOS\s0 using \fBname\fR
|
|
Packit |
667938 |
might result in \f(CW"S0"\fR being the interface description , \fBdescr\fR might result
|
|
Packit |
667938 |
in \f(CW"Serial0"\fR and \fBalias\fR might result in \f(CW"Link to HQ"\fR (provided that is
|
|
Packit |
667938 |
what is used as the interface's \f(CW\*(C`description\*(C'\fR in the router's configuration).
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Finally, if you want to describe the interface by it's Btype
|
|
Packit |
667938 |
(i.e \f(CW"ethernetCSMA"\fR, \f(CW"propPointtoPoint"\fR etc) you can use \fBtype\fR.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
You can specify multiple properties if you wish, separated by commas.
|
|
Packit |
667938 |
In this case, cfgmaker will use the first item in the list which
|
|
Packit |
667938 |
is available for this interface. This allows you to specify, for
|
|
Packit |
667938 |
example, to use any of the different aliases in order of preference.
|
|
Packit |
667938 |
.IP "\fB\-\-if\-filter\fR '\fBfilter-expression\fR'" 4
|
|
Packit |
667938 |
.IX Item "--if-filter 'filter-expression'"
|
|
Packit |
667938 |
First of all, this is under some development and is experimental.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Use this if you want to have better control over what interfaces gets
|
|
Packit |
667938 |
included into the configuration. The \fBfilter-expression\fR is evaluated
|
|
Packit |
667938 |
as a piece of Perl code and is expected
|
|
Packit |
667938 |
to return a truth value. If true, include the interface and if false,
|
|
Packit |
667938 |
exclude the interface.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
For a further discussion on how these filters work, see the section
|
|
Packit |
667938 |
\&\*(L"Details on Filters\*(R" below.
|
|
Packit |
667938 |
.IP "\fB\-\-if\-template\fR \fBtemplate-file\fR" 4
|
|
Packit |
667938 |
.IX Item "--if-template template-file"
|
|
Packit |
667938 |
First of all, this is under some development and is experimental.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Use this if you want to control what the line for each target should look
|
|
Packit |
667938 |
like in the configuration file. The contents of the file \fBtemplate-file\fR
|
|
Packit |
667938 |
will be evaluated as a Perl program which generates the lines using certain
|
|
Packit |
667938 |
variables for input and output.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
For a further discussion on how these templates work, see the section
|
|
Packit |
667938 |
\&\*(L"Details on Temaplates\*(R" below.
|
|
Packit |
667938 |
.IP "\fB\-\-host\-template\fR \fBtemplate-file\fR" 4
|
|
Packit |
667938 |
.IX Item "--host-template template-file"
|
|
Packit |
667938 |
First of all, this is under some development and is experimental.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Use this if you want to have some extra targets related to the host itself
|
|
Packit |
667938 |
such as \s-1CPU\s0 utilization, ping response time to the host, number of busy
|
|
Packit |
667938 |
modems etc. The contents of the file \fBtemplate-file\fR will be evaluated
|
|
Packit |
667938 |
once per host as a Perl program which generates the lines using certain
|
|
Packit |
667938 |
variables for input and output.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
For a further discussion on how these templates work, see the section
|
|
Packit |
667938 |
\&\*(L"Details on Templates\*(R" below.
|
|
Packit |
667938 |
.IP "\fB\-\-community\fR \fBcommunity-string\fR" 4
|
|
Packit |
667938 |
.IX Item "--community community-string"
|
|
Packit |
667938 |
Use this to set the community for the routers following on the command
|
|
Packit |
667938 |
line to \fBcommunity-string\fR. Individual routers might overrride this
|
|
Packit |
667938 |
community string by using the syntax \fBcommunity\fR\fB@\fR\fBrouter\fR.
|
|
Packit |
667938 |
.IP "\fB\-\-enable\-ipv6\fR" 4
|
|
Packit |
667938 |
.IX Item "--enable-ipv6"
|
|
Packit |
667938 |
This option enables IPv6 support. It requires the appropriate perl
|
|
Packit |
667938 |
modules; if they are not found then IPv6 is disabled (see the ipv6
|
|
Packit |
667938 |
documentation).
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
cfgmaker will use IPv6 or IPv4 depending on the target. If the target
|
|
Packit |
667938 |
is a numeric address, the protocol depends on the type of address. If the
|
|
Packit |
667938 |
target is a hostname, cfgmaker will try to resolve the name first to an
|
|
Packit |
667938 |
IPv6 address then to an IPv4 address.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
IPv6 numeric addresses must be specified between square braces.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
For example:
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& cfgmaker \-\-enable\-ipv6 [2001:760:4::1]:165:::2
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
If the target has both an IPv6 address and an IPv4 address with the same
|
|
Packit |
667938 |
hostname, cfgmaker first queries the target using IPv6 and falls back to
|
|
Packit |
667938 |
IPv4 if it fails. This is useful for targets which don't support \s-1SNMP\s0
|
|
Packit |
667938 |
over IPv6.
|
|
Packit |
667938 |
.IP "\fB\-\-use\-16bit\fR" 4
|
|
Packit |
667938 |
.IX Item "--use-16bit"
|
|
Packit |
667938 |
This option forces the use of 16bit \s-1SNMP\s0 request IDs. Some broken \s-1SNMP\s0
|
|
Packit |
667938 |
agents do not accept 32bit request IDs. Try to avoid this option as much
|
|
Packit |
667938 |
as possible, complain to your agent vendor instead.
|
|
Packit |
667938 |
.IP "\fB\-\-snmp\-options\fR :[\fBport\fR][:[\fBtimeout\fR][:[\fBretries\fR][:[\fBbackoff\fR][:\fBversion\fR]]]]" 4
|
|
Packit |
667938 |
.IX Item "--snmp-options :[port][:[timeout][:[retries][:[backoff][:version]]]]"
|
|
Packit |
667938 |
Use this to set the default \s-1SNMP\s0 options for all routers following on the
|
|
Packit |
667938 |
command line. Individual values might be omitted as well as trailing
|
|
Packit |
667938 |
colons. Note that routers might override individual (or all) values
|
|
Packit |
667938 |
specified by \fB\-\-snmp\-options\fR by using the syntax
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
\&\fBrouter\fR[:[\fBport\fR][:[\fBtimeout\fR][:[\fBretries\fR][:[\fBbackoff\fR][:\fBversion\fR]]]]]
|
|
Packit |
667938 |
.ie n .IP "\fB\-\-global\fR \fB""\fR\fIbla: abc\fR\fB""\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\-\-global\fR \fB``\fR\fIbla: abc\fR\fB''\fR" 4
|
|
Packit |
667938 |
.IX Item "--global ""bla: abc"""
|
|
Packit |
667938 |
Use this to add global options to the generated config file.
|
|
Packit |
667938 |
You can call \fB\-\-global\fR several times to add multiple options.
|
|
Packit |
667938 |
The line will appear in the configuration just before the config for
|
|
Packit |
667938 |
the next router appearing on the command line.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& \-\-global "workdir: /home/mrtg"
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
If you want some default Options you might want to put
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& \-\-global "options[_]: growright,bits"
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Specifying \fB\-\-global\fR after the last router on the command line will
|
|
Packit |
667938 |
create a line in the configuration file which will appear after all the
|
|
Packit |
667938 |
routers.
|
|
Packit |
667938 |
.IP "\fB\-\-noreversedns\fR" 4
|
|
Packit |
667938 |
.IX Item "--noreversedns"
|
|
Packit |
667938 |
Do not try to reverse lookup \s-1IP\s0 numbers ... a must for \s-1DNS\s0 free environments.
|
|
Packit |
667938 |
.IP "\fB\-\-no\-down\fR" 4
|
|
Packit |
667938 |
.IX Item "--no-down"
|
|
Packit |
667938 |
Normally cfgmaker will not include interfaces which are marked
|
|
Packit |
667938 |
anything but administratively and operationally \s-1UP.\s0 With this
|
|
Packit |
667938 |
switch you get them all.
|
|
Packit |
667938 |
.IP "\fB\-\-show\-op\-down\fR" 4
|
|
Packit |
667938 |
.IX Item "--show-op-down"
|
|
Packit |
667938 |
Include interfaces which are operatively down.
|
|
Packit |
667938 |
.IP "\fB\-\-zero\-speed\fR \fIspeed\fR" 4
|
|
Packit |
667938 |
.IX Item "--zero-speed speed"
|
|
Packit |
667938 |
Assign this speed in bits-per-second to all interfaces which return 0
|
|
Packit |
667938 |
for ifSpeed and ifHighSpeed. Some switches, notably Foundry equipment,
|
|
Packit |
667938 |
return a speed of zero for some interfaces. For example, to have
|
|
Packit |
667938 |
all interfaces reporting zero set to 100Mbps, use
|
|
Packit |
667938 |
\&\-\-zero\-speed=100000000.
|
|
Packit |
667938 |
.IP "\fB\-\-subdirs\fR \fIformat\fR" 4
|
|
Packit |
667938 |
.IX Item "--subdirs format"
|
|
Packit |
667938 |
Give each router its own subdirectory for the \s-1HTML\s0 and graphics (or
|
|
Packit |
667938 |
\&.rrd) files. The directory name is the given \fIformat\fR string with a
|
|
Packit |
667938 |
couple of pattern replacements. The string \*(L"\s-1HOSTNAME\*(R"\s0 will be
|
|
Packit |
667938 |
replaced by the hostname of the router (however you specified it on
|
|
Packit |
667938 |
the \fBcfgmaker\fR commandline \*(-- it may be an actual hostname or just an
|
|
Packit |
667938 |
\&\s-1IP\s0 address), and \*(L"\s-1SNMPNAME\*(R"\s0 will be replaced with the device's idea of
|
|
Packit |
667938 |
its own name (the same name that appears on the right side of the
|
|
Packit |
667938 |
\&\*(L"Title\*(R" lines). For instance, a call like:
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& cfgmaker \-\-subdirs=HOSTNAME_\|_SNMPNAME public@10.10.0.18
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
would result in the generation of lines looking something like:
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& Directory[10.10.0.18_1]: 10.10.0.18_\|_fp2200\-bothrip\-1.3
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.IP "\fB\-\-output\fR \fIfile\fR" 4
|
|
Packit |
667938 |
.IX Item "--output file"
|
|
Packit |
667938 |
Write the output from \fBcfgmaker\fR into the file \fIfile\fR. The default
|
|
Packit |
667938 |
is to use \f(CW\*(C`STDOUT\*(C'\fR. \fB\-\-output\fR is expected to appear only once on the
|
|
Packit |
667938 |
command line. If used multiple times, the file specified by the last
|
|
Packit |
667938 |
\&\fB\-\-output\fR will be used.
|
|
Packit |
667938 |
.IP "\fB\-\-nointerfaces\fR" 4
|
|
Packit |
667938 |
.IX Item "--nointerfaces"
|
|
Packit |
667938 |
Don't generate configuration lines for interfaces.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
This makes cfgmaker skip all steps related to interfaces which means
|
|
Packit |
667938 |
it will not do any polling of the router to retrieve interface
|
|
Packit |
667938 |
information which speeds up the execution of cfgmaker and it will
|
|
Packit |
667938 |
neither run any interface templates.
|
|
Packit |
667938 |
.IP "\fB\-\-interfaces\fR" 4
|
|
Packit |
667938 |
.IX Item "--interfaces"
|
|
Packit |
667938 |
This makes cfgmaker generate configuration lines for interfaces (the
|
|
Packit |
667938 |
default behaviour).
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
The main usage of this option is to negate an \-\-nointerfaces appearing
|
|
Packit |
667938 |
earlier on the command line.
|
|
Packit |
667938 |
.SS "\s-1SNMP V3\s0 Options"
|
|
Packit |
667938 |
.IX Subsection "SNMP V3 Options"
|
|
Packit |
667938 |
\&\fBCfgmaker\fR supports \s-1SNMP V3\s0 using the \fBNet:SNMP\fR perl module. There are optional
|
|
Packit |
667938 |
parameters affecting \s-1SNMP\s0 operation.
|
|
Packit |
667938 |
.IP "\-\-enablesnmpv3 {yes|no}" 4
|
|
Packit |
667938 |
.IX Item "--enablesnmpv3 {yes|no}"
|
|
Packit |
667938 |
The \fB\-\-enablesnmpv3\fR option is an optional flag to check for the presence of
|
|
Packit |
667938 |
the \fBNet::SNMP\fR libraries. \fBCfgmaker\fR will try to determine whether this flag is
|
|
Packit |
667938 |
required and will set the values automatically.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fISNMPv3 Arguments\fR
|
|
Packit |
667938 |
.IX Subsection "SNMPv3 Arguments"
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
A \s-1SNMP\s0 context is a collection of management information accessible by a \s-1SNMP\s0
|
|
Packit |
667938 |
entity. An item of management information may exist in more than one context
|
|
Packit |
667938 |
and a \s-1SNMP\s0 entity potentially has access to many contexts. The combination of
|
|
Packit |
667938 |
a contextEngineID and a contextName unambiguously identifies a context within
|
|
Packit |
667938 |
an administrative domain. In a SNMPv3 message, the contextEngineID and
|
|
Packit |
667938 |
contextName are included as part of the scopedPDU. All methods that generate
|
|
Packit |
667938 |
a \s-1SNMP\s0 message optionally take a \fB\-\-contextengineid\fR and \fB\-\-contextname\fR
|
|
Packit |
667938 |
argument to configure these fields.
|
|
Packit |
667938 |
.IP "Context Engine \s-1ID\s0" 4
|
|
Packit |
667938 |
.IX Item "Context Engine ID"
|
|
Packit |
667938 |
The \fB\-\-contextengineid\fR argument expects a hexadecimal string representing
|
|
Packit |
667938 |
the desired contextEngineID. The string must be 10 to 64 characters (5 to
|
|
Packit |
667938 |
32 octets) long and can be prefixed with an optional \*(L"0x\*(R". Once the
|
|
Packit |
667938 |
\&\fB\-\-contextengineid\fR is specified it stays with the object until it is changed
|
|
Packit |
667938 |
again or reset to default by passing in the undefined value. By default, the
|
|
Packit |
667938 |
contextEngineID is set to match the authoritativeEngineID of the authoritative
|
|
Packit |
667938 |
\&\s-1SNMP\s0 engine.
|
|
Packit |
667938 |
.IP "Context Name" 4
|
|
Packit |
667938 |
.IX Item "Context Name"
|
|
Packit |
667938 |
The contextName is passed as a string which must be 0 to 32 octets in length
|
|
Packit |
667938 |
using the \fB\-\-contextname\fR argument. The contextName stays with the object
|
|
Packit |
667938 |
until it is changed. The contextName defaults to an empty string which
|
|
Packit |
667938 |
represents the \*(L"default\*(R" context.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fIUser-based Security Model Arguments\fR
|
|
Packit |
667938 |
.IX Subsection "User-based Security Model Arguments"
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
The User-based Security Model (\s-1USM\s0) used by SNMPv3 requires that a securityName
|
|
Packit |
667938 |
be specified using the \fB\-\-username\fR argument. The creation of a Net::SNMP
|
|
Packit |
667938 |
object with the version set to SNMPv3 will fail if the \fB\-\-username\fR argument
|
|
Packit |
667938 |
is not present. The \fB\-\-username\fR argument expects a string 1 to 32 octets
|
|
Packit |
667938 |
in length.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Different levels of security are allowed by the User-based Security Model which
|
|
Packit |
667938 |
address authentication and privacy concerns. A SNMPv3 target will
|
|
Packit |
667938 |
derive the security level (securityLevel) based on which of the following
|
|
Packit |
667938 |
arguments are specified.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
By default a securityLevel of 'noAuthNoPriv' is assumed. If the \fB\-\-authkey\fR
|
|
Packit |
667938 |
or \fB\-\-authpassword\fR arguments are specified, the securityLevel becomes
|
|
Packit |
667938 |
\&'authNoPriv'. The \fB\-\-authpassword\fR argument expects a string which is at
|
|
Packit |
667938 |
least 1 octet in length. Optionally, the \fB\-\-authkey\fR argument can be used so
|
|
Packit |
667938 |
that a plain text password does not have to be specified in a script. The
|
|
Packit |
667938 |
\&\fB\-\-authkey\fR argument expects a hexadecimal string produced by localizing the
|
|
Packit |
667938 |
password with the authoritativeEngineID for the specific destination device.
|
|
Packit |
667938 |
The \f(CW\*(C`snmpkey\*(C'\fR utility included with the Net::SNMP distribution can be used to create
|
|
Packit |
667938 |
the hexadecimal string (see snmpkey).
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Two different hash algorithms are defined by SNMPv3 which can be used by the
|
|
Packit |
667938 |
Security Model for authentication. These algorithms are \s-1HMAC\-MD5\-96 \*(L"MD5\*(R"
|
|
Packit |
667938 |
\&\s0(\s-1RFC 1321\s0) and \s-1HMAC\-SHA\-96 \*(L"SHA\-1\*(R" \s0(\s-1NIST FIPS PUB 180\-1\s0). The default
|
|
Packit |
667938 |
algorithm used by the module is \s-1HMAC\-MD5\-96. \s0 This behavior can be changed by
|
|
Packit |
667938 |
using the \fB\-\-authprotocol\fR argument. This argument expects either the string
|
|
Packit |
667938 |
\&'md5' or 'sha' to be passed to modify the hash algorithm.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
By specifying the arguments \fB\-\-privkey\fR or \fB\-\-privpassword\fR the securityLevel
|
|
Packit |
667938 |
associated with the object becomes 'authPriv'. According to SNMPv3, privacy
|
|
Packit |
667938 |
requires the use of authentication. Therefore, if either of these two
|
|
Packit |
667938 |
arguments are present and the \fB\-\-authkey\fR or \fB\-\-authpassword\fR arguments are
|
|
Packit |
667938 |
missing, the creation of the object fails. The \fB\-\-privkey\fR and
|
|
Packit |
667938 |
\&\fB\-\-privpassword\fR arguments expect the same input as the \fB\-\-authkey\fR and
|
|
Packit |
667938 |
\&\fB\-\-authpassword\fR arguments respectively.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
The User-based Security Model described in \s-1RFC 3414\s0 defines a single encryption
|
|
Packit |
667938 |
protocol to be used for privacy. This protocol, CBC-DES \*(L"\s-1DES\*(R" \s0(\s-1NIST FIPS PUB
|
|
Packit |
667938 |
46\-1\s0), is used by default or if the string 'des' is passed to the
|
|
Packit |
667938 |
\&\fB\-\-privprotocol\fR argument. By working with the Extended Security Options
|
|
Packit |
667938 |
Consortium http://www.snmp.com/eso/, the module also supports additional
|
|
Packit |
667938 |
protocols which have been defined in draft specifications. The draft
|
|
Packit |
667938 |
http://www.snmp.com/eso/draft\-reeder\-snmpv3\-usm\-3desede\-00.txt
|
|
Packit |
667938 |
defines the support of \s-1CBC\-3DES\-EDE \s0\*(L"Triple-DES\*(R" (\s-1NIST FIPS 46\-3\s0) in the
|
|
Packit |
667938 |
User-based Security Model. This protocol can be selected using the
|
|
Packit |
667938 |
\&\fB\-\-privprotocol\fR argument with the string '3desede'. The draft
|
|
Packit |
667938 |
http://www.snmp.com/eso/draft\-blumenthal\-aes\-usm\-04.txt
|
|
Packit |
667938 |
describes the use of \s-1CFB128\-AES\-128/192/256 \*(L"AES\*(R" \s0(\s-1NIST FIPS PUB 197\s0) in the
|
|
Packit |
667938 |
\&\s-1USM.\s0 The three \s-1AES\s0 encryption protocols, differentiated by their key sizes,
|
|
Packit |
667938 |
can be selected by passing 'aescfb128', 'aescfb192', or 'aescfb256' to the
|
|
Packit |
667938 |
\&\fB\-privprotocol\fR argument.
|
|
Packit |
667938 |
.SS "Details on Filters"
|
|
Packit |
667938 |
.IX Subsection "Details on Filters"
|
|
Packit |
667938 |
The purpose of the filters is to decide which interfaces to accept and
|
|
Packit |
667938 |
which interfaces to reject. This decision is done for each interface by
|
|
Packit |
667938 |
evaluating the filter expression as a piece of Perl code and investigating
|
|
Packit |
667938 |
the result of the evaluation. If true, accept the interface otherwise
|
|
Packit |
667938 |
reject it.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
When working with filters, remember that Perl has it's own idea of what truth
|
|
Packit |
667938 |
and false is. The empty string "\*(L" and the string \*(R"0" are false, all other
|
|
Packit |
667938 |
strings are true. This further imples that any integer value of 0 is
|
|
Packit |
667938 |
false as well as any undef value. It also implies that all references
|
|
Packit |
667938 |
are considered true.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
As the filter is evaluated as a Perl expression, several useful constructs
|
|
Packit |
667938 |
in Perl are worth mentioning:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Expressions might be grouped by using parentheses \*(L"()\*(R". Expressions might
|
|
Packit |
667938 |
be combined using boolean operators such as the following:
|
|
Packit |
667938 |
.ie n .IP """\fBand\fR"" (equivalent with ""\fB&&\fR"")" 4
|
|
Packit |
667938 |
.el .IP "``\fBand\fR'' (equivalent with ``\fB&&\fR'')" 4
|
|
Packit |
667938 |
.IX Item """and (equivalent with &&"")"
|
|
Packit |
667938 |
Boolean \*(L"and\*(R" of the two expressions, is only true if both expressions are
|
|
Packit |
667938 |
true. Example: \fIexpression1\fR \fBand\fR \fIexpression2\fR
|
|
Packit |
667938 |
.ie n .IP """\fBor\fR"" (equivalent with ""\fB||\fR"")" 4
|
|
Packit |
667938 |
.el .IP "``\fBor\fR'' (equivalent with ``\fB||\fR'')" 4
|
|
Packit |
667938 |
.IX Item """or (equivalent with ||"")"
|
|
Packit |
667938 |
Boolean \*(L"or\*(R" of the two expressions, is true if either or both expressions
|
|
Packit |
667938 |
are true. Example: \fIexpression1\fR \fBor\fR \fIexpression2\fR
|
|
Packit |
667938 |
.ie n .IP """\fBnot\fR"" (equivalent with ""\fB!\fR"")" 4
|
|
Packit |
667938 |
.el .IP "``\fBnot\fR'' (equivalent with ``\fB!\fR'')" 4
|
|
Packit |
667938 |
.IX Item """not (equivalent with !"")"
|
|
Packit |
667938 |
Boolean negation of a single expression. Example: \fBnot\fR \fIexpression\fR .
|
|
Packit |
667938 |
Yet another example: \fB!\fR\fIexpression\fR
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
(For more details on this I recommend a book on Perl)
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fIPredefined Filter Variables\fR
|
|
Packit |
667938 |
.IX Subsection "Predefined Filter Variables"
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
To facilitate, there are a number of predefined values available to use
|
|
Packit |
667938 |
in the filter. Note that these variables are also available when templates
|
|
Packit |
667938 |
interfaces are evaluated (but not host templates).
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Caveat: All these variables' names begin with a dollar sign ($), which
|
|
Packit |
667938 |
is a syntactic requirement for scalar variables in Perl. The danger here
|
|
Packit |
667938 |
is that the dollar sign in many shells is an active character (often
|
|
Packit |
667938 |
used for shell variables exactly as in Perl variables) so it is important
|
|
Packit |
667938 |
to ensure that the Perl expression isn't evaluated by the command line
|
|
Packit |
667938 |
shell as shell code before being passed to cfgmaker as command line
|
|
Packit |
667938 |
arguments. In shells like Bourne shell, ksh shell or bash shell, placing
|
|
Packit |
667938 |
the entire expression within single qoutes will avoid such accidental
|
|
Packit |
667938 |
evaluation:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& \*(Aq\-\-if\-filter=($default_iftype && $if_admin)\*(Aq
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_type\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_type\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_type"
|
|
Packit |
667938 |
This is an integer specifying the interface type as
|
|
Packit |
667938 |
per the \s-1SNMP\s0 standards and as reported by the polled device. A complete list
|
|
Packit |
667938 |
of interface types would be impractical for this document , but there are
|
|
Packit |
667938 |
a number predefined varables below. Normally, cfgmaker puts in the target's
|
|
Packit |
667938 |
PageTop this iftype value within paranthesis after the name of the interface
|
|
Packit |
667938 |
type. (e.g \*(L"propPointToPointSerial (22)\*(R").
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
Here's a list of some of the most common interface types by number:
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
.Vb 10
|
|
Packit |
667938 |
\& 6 ethernetCsmacd
|
|
Packit |
667938 |
\& 7 iso88023Csmacd
|
|
Packit |
667938 |
\& 9 iso88025TokenRing
|
|
Packit |
667938 |
\& 15 fddi
|
|
Packit |
667938 |
\& 19 E1
|
|
Packit |
667938 |
\& 20 basicISDN
|
|
Packit |
667938 |
\& 21 primaryISDN
|
|
Packit |
667938 |
\& 22 propPointToPointSerial
|
|
Packit |
667938 |
\& 23 ppp
|
|
Packit |
667938 |
\& 24 softwareLoopback
|
|
Packit |
667938 |
\& 30 ds3
|
|
Packit |
667938 |
\& 32 frame\-relay
|
|
Packit |
667938 |
\& 33 rs232
|
|
Packit |
667938 |
\& 37 atm
|
|
Packit |
667938 |
\& 39 sonet
|
|
Packit |
667938 |
\& 44 frameRelayService
|
|
Packit |
667938 |
\& 46 hssi
|
|
Packit |
667938 |
\& 49 aal5
|
|
Packit |
667938 |
\& 53 propVirtual
|
|
Packit |
667938 |
\& 62 Fast Ethernet (100BaseT)
|
|
Packit |
667938 |
\& 63 ISDN & X.25
|
|
Packit |
667938 |
\& 69 Full Duplex Fast Ethernet (100BaseFX)
|
|
Packit |
667938 |
\& 94 Asymetric Digital Subscriber Loop (ADSL)
|
|
Packit |
667938 |
\& 117 Gigabit Ethernet
|
|
Packit |
667938 |
\& 134 ATM Sub Interface
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$default\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$default\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$default"
|
|
Packit |
667938 |
True if and only if cfgmaker normally should
|
|
Packit |
667938 |
accepted the interface based on the interfaces administrative and
|
|
Packit |
667938 |
operational state (taking the flags \fB\-\-no\-down\fR and \fB\-\-show\-op\-down\fR into
|
|
Packit |
667938 |
account) and it's type (and a few other things).
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$default_ifstate\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$default_ifstate\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$default_ifstate"
|
|
Packit |
667938 |
True if and only if cfgmaker would have accepted the
|
|
Packit |
667938 |
interface based on it's operational and administrative states (also taking
|
|
Packit |
667938 |
into account the presence of the flags \fB\-\-no\-down\fR and \fB\-\-show\-op\-down\fR).
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$default_iftype\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$default_iftype\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$default_iftype"
|
|
Packit |
667938 |
True if and only if cfgmaker would have accepted the
|
|
Packit |
667938 |
interface based on it's type (and a few type specific details in addition).
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_admin\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_admin\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_admin"
|
|
Packit |
667938 |
True if and only if the interface is in an adminstrative up
|
|
Packit |
667938 |
state.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_oper\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_oper\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_oper"
|
|
Packit |
667938 |
True if and only if the interface is in an operational up
|
|
Packit |
667938 |
state.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
A number of variables are also predefined to easily decide if an interface
|
|
Packit |
667938 |
belong to a certain cathegory or not. Below is all those variables listed
|
|
Packit |
667938 |
together with which if_type numbers each variable will be true for. Note
|
|
Packit |
667938 |
that some variables refer to other variables as well.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_is_ethernet\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_is_ethernet\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_is_ethernet"
|
|
Packit |
667938 |
True for ethernet interfaces (nr 6, 7, 26, 62, 69 and 117).
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_is_isdn\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_is_isdn\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_is_isdn"
|
|
Packit |
667938 |
True for various \s-1ISDN\s0 interface types (nr 20, 21, 63, 75, 76 and 77)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_is_dialup\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_is_dialup\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_is_dialup"
|
|
Packit |
667938 |
True for dial-up interfaces such as \s-1PPP\s0 as well
|
|
Packit |
667938 |
as \s-1ISDN. \s0(nr 23, 81, 82 and 108 in addition to the numbers of
|
|
Packit |
667938 |
\&\fB\f(CB$if_is_isdn\fB\fR).
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_is_atm\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_is_atm\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_is_atm"
|
|
Packit |
667938 |
True for miscellaneous \s-1ATM\s0 related interface types (nr 37, 49, 107, 105,
|
|
Packit |
667938 |
106, 114 and 134).
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_is_wan\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_is_wan\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_is_wan"
|
|
Packit |
667938 |
True for \s-1WAN\s0 interfaces point to point, Frame Relay and High Speed Serial ( 22,32,44,46)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_is_lan\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_is_lan\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_is_lan"
|
|
Packit |
667938 |
True for \s-1LAN\s0 interfaces (8, 9, 11, 15, 26, 55, 59, 60 and 115 in addition
|
|
Packit |
667938 |
to the numbers of \fB\f(CB$if_is_ethernet\fB\fR).
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_is_dsl\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_is_dsl\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_is_dsl"
|
|
Packit |
667938 |
True for \s-1ADSL, RDSL, HDSL\s0 and \s-1SDSL \s0(nr 94, 95, 96, 97)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_is_loopback\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_is_loopback\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_is_loopback"
|
|
Packit |
667938 |
True for software loopback interfaces (nr 24)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_is_ciscovlan\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_is_ciscovlan\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_is_ciscovlan"
|
|
Packit |
667938 |
True for Cisco \s-1VLAN\s0 interfaces (interfaces with the
|
|
Packit |
667938 |
word Vlan or \s-1VLAN\s0 in their ifdescs)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_vlan_id\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_vlan_id\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_vlan_id"
|
|
Packit |
667938 |
Returns the vlan id associated with a specific port
|
|
Packit |
667938 |
on Cisco Catalyst switches under both Catalyst \s-1OS\s0
|
|
Packit |
667938 |
and \s-1IOS,\s0 and 3Com switches. If it is not a vlan interface, will return undef.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_cisco_trunk\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_cisco_trunk\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_cisco_trunk"
|
|
Packit |
667938 |
Returns the trunking state of a specific port
|
|
Packit |
667938 |
on Cisco Catalyst switches under both Catalyst \s-1OS\s0
|
|
Packit |
667938 |
and \s-1IOS. \s0 Returns \*(L"1\*(R" if the interface is a trunk, undef otherwise.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_MTU\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_MTU\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_MTU"
|
|
Packit |
667938 |
Returns the Maximum Transfer Unit associated with a specific port.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Besides that, you can also use the variables defined for templates below.
|
|
Packit |
667938 |
Further, all the variables available in cfgmaker is at the scripts disposal
|
|
Packit |
667938 |
even if the use of such features is discouraged. More \*(L"shortcuts\*(R" in the
|
|
Packit |
667938 |
form of variables and functions will be made available in the future instead.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fIExamples on Filters\fR
|
|
Packit |
667938 |
.IX Subsection "Examples on Filters"
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
The following filter will not affect which interfaces get's included or
|
|
Packit |
667938 |
excluded, it will make cfgmaker behave as normally.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& \*(Aq\-\-if\-filter=$default\*(Aq
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
The following filter will make cfgmaker exclude \s-1PPP \s0(23) interfaces:
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& \*(Aq\-\-if\-filter=$default && $if_type!=23\*(Aq
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
The following filter will make cfgmaker behave as usual except that it will
|
|
Packit |
667938 |
consider the operational state of an interface irrelevant but still reject
|
|
Packit |
667938 |
all interfaces which are administratively down.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 1
|
|
Packit |
667938 |
\& \*(Aq\-\-if\-filter=$if_admin && $default_iftype\*(Aq
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.SS "Details on Templates"
|
|
Packit |
667938 |
.IX Subsection "Details on Templates"
|
|
Packit |
667938 |
The contents of the template files are evaluated as a Perl program. A
|
|
Packit |
667938 |
number or Perl variables are available for the program to read and others
|
|
Packit |
667938 |
are used to be written to.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
As quite a few of the predefined variables has values which are are supposed
|
|
Packit |
667938 |
to be used in \s-1HTML\s0 code some of them have an \*(L"HTML-escaped\*(R" variant, e.g
|
|
Packit |
667938 |
\&\f(CW$html_syslocation\fR is the \s-1HTML\s0 escaped variant of \f(CW$syslocation\fR. The \s-1HTML\s0
|
|
Packit |
667938 |
escaping means that the chars \*(L"<\*(R", \*(L">\*(R" and \*(L"&\*(R" are replaced by \*(L"<\*(R",
|
|
Packit |
667938 |
\&\*(L">\*(R" and \*(L"&\*(R" and that newlines embedded in the string are prepended
|
|
Packit |
667938 |
with \*(L"<\s-1BR\s0>\*(R" and appended with a space character (if a newline is last in the
|
|
Packit |
667938 |
string it is not touched).
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fIWritable Template Variables\fR
|
|
Packit |
667938 |
.IX Subsection "Writable Template Variables"
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
These are the variables available to store the configuration lines in.
|
|
Packit |
667938 |
Some of them are initialized prior to the evaluation of the template but
|
|
Packit |
667938 |
such content normally is comments for inclusion in the final configuration
|
|
Packit |
667938 |
file so those variables might be reset to the empty string in the template
|
|
Packit |
667938 |
code to eliminate the comments. The other way around is also possible, the
|
|
Packit |
667938 |
contents of these variables might be extended with further information
|
|
Packit |
667938 |
for various reasons such as debugging etc.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Once the template has been evaluated, the following happens: if the
|
|
Packit |
667938 |
template is a interface template and the actual interface for some reason
|
|
Packit |
667938 |
is rejected and thus needs to be commented out, all the lines in the
|
|
Packit |
667938 |
variable \fB\f(CB$target_lines\fB\fR are turned into comments by adding a hash mark
|
|
Packit |
667938 |
(\*(L"#\*(R") at their beginning. Then all the variables \fB\f(CB$head_lines\fB\fR,
|
|
Packit |
667938 |
\&\fB\f(CB$problem_lines\fB\fR , \fB\f(CB$target_lines\fB\fR and \fB\f(CB$separator_lines\fB\fR
|
|
Packit |
667938 |
are concatenated together to form the lines to add to the configuration file.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$target_lines\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$target_lines\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$target_lines"
|
|
Packit |
667938 |
This variable is the placeholder for the configuration lines created
|
|
Packit |
667938 |
by the template. \fB\f(CB$target_lines\fB\fR is predefined to be empty when
|
|
Packit |
667938 |
the template code is evaluated.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$head_lines\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$head_lines\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$head_lines"
|
|
Packit |
667938 |
This variable is intended to be the placeholder for the comment line
|
|
Packit |
667938 |
appearing just before the target in the configuration file. It is
|
|
Packit |
667938 |
initialized with that comment line before the evaluation of the template
|
|
Packit |
667938 |
code and if the template doesn't modify \fB\f(CB$head_lines\fB\fR during evaluation,
|
|
Packit |
667938 |
the comment will look like usual in the config file.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$problem_lines\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$problem_lines\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$problem_lines"
|
|
Packit |
667938 |
This variable is intended to be the placholder for the comment lines
|
|
Packit |
667938 |
describing any problems which might have been encountered when trying
|
|
Packit |
667938 |
to add the target into the configuration. For host templates it's
|
|
Packit |
667938 |
normally not used and for those it's predefined as the empty string.
|
|
Packit |
667938 |
For interface templates \fB\f(CB$problem_lines\fB\fR is predefined with
|
|
Packit |
667938 |
the error description comments which cfgmaker normally would use for
|
|
Packit |
667938 |
rejected interfaces or as the empty string for accepted interfaces.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
It is possible to test against \fB\f(CB$problem_lines\fB\fR to find out if
|
|
Packit |
667938 |
an interface will be included or rejected but this is not recommended.
|
|
Packit |
667938 |
Test against \fB\f(CB$if_ok\fB\fR instead.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$separator_lines\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$separator_lines\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$separator_lines"
|
|
Packit |
667938 |
This variable is the placeholder for the string to use as the separator
|
|
Packit |
667938 |
between the code for individual targets. The contents of this variable
|
|
Packit |
667938 |
is put after each target (so the lines will appear after the end of the
|
|
Packit |
667938 |
last target in the config as well).
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fIPredefined Template Variables\fR
|
|
Packit |
667938 |
.IX Subsection "Predefined Template Variables"
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
All the variables below are available for interface templates to use.
|
|
Packit |
667938 |
For host templates, only those listed under \*(L"Host and System Variables\*(R"
|
|
Packit |
667938 |
are available.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
For interface templates the variables listed under
|
|
Packit |
667938 |
\&\*(L"Predefined Filter Variables\*(R" are also available.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fIHost and System Variables\fR
|
|
Packit |
667938 |
.IX Subsection "Host and System Variables"
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$router_name\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$router_name\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$router_name"
|
|
Packit |
667938 |
This is the fully qualified name for the router. It is affected by the
|
|
Packit |
667938 |
following items on the command line: the router name itself and
|
|
Packit |
667938 |
\&\fB\-\-dns\-domain\fR.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$router_connect\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$router_connect\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$router_connect"
|
|
Packit |
667938 |
This is the reference string for the router being polled. It is on the
|
|
Packit |
667938 |
form community@router possibly followed by some snmp options. It is
|
|
Packit |
667938 |
affected by the following items on the command line: the router name
|
|
Packit |
667938 |
itself, \fB\-\-community\fR, \fB\-\-snmp\-options\fR and \fB\-\-dns\-domain\fR.
|
|
Packit |
667938 |
(There's no \s-1HTML\s0 escaped variant available)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$directory_name\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$directory_name\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$directory_name"
|
|
Packit |
667938 |
This variable should contain the directory name as cfgmaker normally would
|
|
Packit |
667938 |
use as the value for the \*(L"Directory[]\*(R" directive. The value is determined
|
|
Packit |
667938 |
by the \fB\-\-subdirs\fR command line option. If \fB\-\-subdirs\fR isn't specified
|
|
Packit |
667938 |
\&\fB\f(CB$directory_name\fB\fR will be the empty string. (There's no \s-1HTML\s0 escaped
|
|
Packit |
667938 |
variant available)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$syscontact\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$syscontact\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$syscontact"
|
|
Packit |
667938 |
This variable is the router's \s-1SNMP\s0 sysContact value. (\s-1HTML\s0 escaped
|
|
Packit |
667938 |
variant: \fB\f(CB$html_syscontact\fB\fR)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$sysname\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$sysname\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$sysname"
|
|
Packit |
667938 |
This variable is the router's \s-1SNMP\s0 sysName value. (No \s-1HTML\s0 escaped
|
|
Packit |
667938 |
variant available)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$syslocation\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$syslocation\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$syslocation"
|
|
Packit |
667938 |
This variable is the router's \s-1SNMP\s0 sysLocation value. (\s-1HTML\s0 escaped
|
|
Packit |
667938 |
variant: \fB\f(CB$html_syslocation\fB\fR)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$sysdescr\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$sysdescr\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$sysdescr"
|
|
Packit |
667938 |
This variable is the router's \s-1SNMP\s0 sysDescr value. It is normally not used
|
|
Packit |
667938 |
by cfgmaker but might be useful in a template. (\s-1HTML\s0 escaped variant:
|
|
Packit |
667938 |
\&\fB\f(CB$html_sysdescr\fB\fR)
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fIInterface Target Related Variables\fR
|
|
Packit |
667938 |
.IX Subsection "Interface Target Related Variables"
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$target_name\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$target_name\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$target_name"
|
|
Packit |
667938 |
This is what cfgmaker normally would use as the the name of the target.
|
|
Packit |
667938 |
The target name is what is found within the square brackets, \*(L"[]\*(R", for target
|
|
Packit |
667938 |
directives. (There's no \s-1HTML\s0 escaped variant available)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_ref\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_ref\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_ref"
|
|
Packit |
667938 |
This the reference string for the interface. It is expected to be used
|
|
Packit |
667938 |
in the \*(L"Target[xyz]\*(R" directive to distinguish what interface to use. The
|
|
Packit |
667938 |
value of this variable is affected by the \fB\-\-ifref\fR command line option.
|
|
Packit |
667938 |
It is normally used together with \fB\f(CB$router_connect\fB\fR.
|
|
Packit |
667938 |
(There's no \s-1HTML\s0 escaped variant available)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_ok\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_ok\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_ok"
|
|
Packit |
667938 |
This variable is true if the interface is going to be included into the
|
|
Packit |
667938 |
configuration file, otherwise false. Don't test against other variables
|
|
Packit |
667938 |
such as \fB\f(CB$problem_lines\fB\fR to find out if an interface will be rejected
|
|
Packit |
667938 |
or not, use this \fB\f(CB$if_ok\fB\fR instead.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$default_target_lines\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$default_target_lines\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$default_target_lines"
|
|
Packit |
667938 |
This variable contains all the target lines which cfgmaker by default outputs
|
|
Packit |
667938 |
for this interface. It's useful if you want to have the \*(L"standard target\*(R"
|
|
Packit |
667938 |
but want to add some extra lines to it by using a template.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
By default cfgmaker uses the following directives for each target it
|
|
Packit |
667938 |
generates: Target[], SetEnv[], MaxBytes[], Title[], PageTop[] and if
|
|
Packit |
667938 |
there is any directory specified also the Directory[] directive.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
To facilitate the creation of templates which generates target configs
|
|
Packit |
667938 |
which are similar to the default one, each of the above mentioned
|
|
Packit |
667938 |
directive lines have a corresponding variable containing the line as
|
|
Packit |
667938 |
cfgmaker would have output it by default.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Note that none of these have a \s-1HTML\s0 escaped variant, text in them is
|
|
Packit |
667938 |
\&\s-1HTML\s0 escaped where needed. Also note that they do not have any newline
|
|
Packit |
667938 |
at the end.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$default_target_directive\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$default_target_directive\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$default_target_directive"
|
|
Packit |
667938 |
This variable contains the default string for the Target[] directive line.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$default_setenv_directive\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$default_setenv_directive\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$default_setenv_directive"
|
|
Packit |
667938 |
This variable contains the default string for the SetEnv[] directive line.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$default_directory_directive\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$default_directory_directive\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$default_directory_directive"
|
|
Packit |
667938 |
This variable contains the default string for the Directory[] directive line
|
|
Packit |
667938 |
which means it is an empty string (with no newline) if there's no directory.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$default_maxbytes_directive\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$default_maxbytes_directive\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$default_maxbytes_directive"
|
|
Packit |
667938 |
This variable contains the default string for the MaxBytes[] directive line.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$default_title_directive\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$default_title_directive\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$default_title_directive"
|
|
Packit |
667938 |
This variable contains the default string for the Title[] directive line.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$default_pagetop_directive\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$default_pagetop_directive\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$default_pagetop_directive"
|
|
Packit |
667938 |
This variable contains the default string for the PageTop[] directive lines.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fIInterface Network Configuration Variables\fR
|
|
Packit |
667938 |
.IX Subsection "Interface Network Configuration Variables"
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_ip\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_ip\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_ip"
|
|
Packit |
667938 |
This variable should contain the IP-address of the interface, if any has
|
|
Packit |
667938 |
been assigned to it. (There's no \s-1HTML\s0 escaped variant available)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$ifindex\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$ifindex\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$ifindex"
|
|
Packit |
667938 |
This variable is the \s-1SNMP\s0 ifIndex for the interface which per definition
|
|
Packit |
667938 |
always is an integer. (There's no \s-1HTML\s0 escaped variant available)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_index\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_index\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_index"
|
|
Packit |
667938 |
Equivalent with \fB\f(CB$ifindex\fB\fR.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_eth\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_eth\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_eth"
|
|
Packit |
667938 |
Contains the ethernet address of the interface, if any. (There's no \s-1HTML\s0
|
|
Packit |
667938 |
escaped variant available)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_speed\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_speed\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_speed"
|
|
Packit |
667938 |
This variable is the speed in bytes/second (with prefixes). (There's no
|
|
Packit |
667938 |
\&\s-1HTML\s0 escaped variant available)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_speed_str\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_speed_str\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_speed_str"
|
|
Packit |
667938 |
This variable is a cooked speed description which is either in bits or
|
|
Packit |
667938 |
bytes depending on wether or not the bits option is active and also with
|
|
Packit |
667938 |
the proper prefix for the speed (k, M, G etc). (No \s-1HTML\s0 escaped variant
|
|
Packit |
667938 |
available)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_type_desc\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_type_desc\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_type_desc"
|
|
Packit |
667938 |
This variable is a textual description of the interface type. (\s-1HTML\s0
|
|
Packit |
667938 |
escaped variant: \fB\f(CB$html_if_type_desc\fB\fR)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_type_num\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_type_num\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_type_num"
|
|
Packit |
667938 |
This variable the integer value corresponding to the interface type (for a
|
|
Packit |
667938 |
listing for the value for the more common interface types, see the section
|
|
Packit |
667938 |
\&\s-1DETAILS ON FILTERS\s0 above). (No \s-1HTML\s0 escaped variant available)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_dns_name\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_dns_name\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_dns_name"
|
|
Packit |
667938 |
This is the \s-1DNS\s0 name for the interface. (No \s-1HTML\s0 escaped variant available)
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fIInterface Name, Description and Alias Variables\fR
|
|
Packit |
667938 |
.IX Subsection "Interface Name, Description and Alias Variables"
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
It might seem confusing with both \fIName\fR, \fIDescription\fR and \fIAlias\fR in
|
|
Packit |
667938 |
this context and to some extent it is. \fIName\fR and \fIDescription\fR are
|
|
Packit |
667938 |
usually supported on most equipment but how they are used varies, both
|
|
Packit |
667938 |
between manufacturers as well as between different cathegories of equipment
|
|
Packit |
667938 |
from the same manufacturer. The \fIAlias\fR is at least supported by Cisco
|
|
Packit |
667938 |
\&\s-1IOS,\s0 and that variable contains whatever is used in the \s-1IOS\s0 statement
|
|
Packit |
667938 |
called \*(L"description\*(R" for the interface (not to be confused with the \s-1SNMP\s0
|
|
Packit |
667938 |
variables for \fIDescription\fR).
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
For better control from the command line consider \fB\f(CB$if_title_desc\fB\fR which contents
|
|
Packit |
667938 |
are controlled by the \fB\-\-if\-descr\fR command line option.
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_snmp_descr\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_snmp_descr\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_snmp_descr"
|
|
Packit |
667938 |
This variable should contain the \*(L"raw\*(R" description of the interface as
|
|
Packit |
667938 |
determined by the \s-1SNMP\s0 polling of the router. (\s-1HTML\s0 escaped variant:
|
|
Packit |
667938 |
\&\fB\f(CB$html_if_snmp_descr\fB\fR)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_snmp_name\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_snmp_name\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_snmp_name"
|
|
Packit |
667938 |
The \*(L"raw\*(R" name for the interface as provided by \s-1SNMP\s0 polling. (\s-1HTML\s0 escaped
|
|
Packit |
667938 |
variant: \fB\f(CB$html_if_snmp_name\fB\fR)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_snmp_alias\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_snmp_alias\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_snmp_alias"
|
|
Packit |
667938 |
The \*(L"raw\*(R" ifAlias for the interface as provided by \s-1SNMP\s0 polling. (\s-1HTML\s0
|
|
Packit |
667938 |
escaped variant: \fB\f(CB$html_if_snmp_alias\fB\fR)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_cisco_descr\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_cisco_descr\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_cisco_descr"
|
|
Packit |
667938 |
The \*(L"raw\*(R" CiscolocIfDescr for the interface as provided by \s-1SNMP\s0 polling.
|
|
Packit |
667938 |
(\s-1HTML\s0 escaped variant: \fB\f(CB$html_if_cisco_descr\fB\fR)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_description\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_description\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_description"
|
|
Packit |
667938 |
This is the \*(L"cooked\*(R" description string for the interface, taking into account
|
|
Packit |
667938 |
the \s-1SNMP\s0 values found for the interface's RDescr, ifAlias and
|
|
Packit |
667938 |
CiscolocIfDescr. (\s-1HTML\s0 escaped variant: \fB\f(CB$html_if_description\fB\fR)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_title\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_title\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_title"
|
|
Packit |
667938 |
The full string cfgmaker by default would have used for the Title[] directive
|
|
Packit |
667938 |
in the configuration as well as the content of the topmost H1 tag in the
|
|
Packit |
667938 |
PageTop[]. Is composed by the contents of \fB\f(CB$desc_prefix\fB\fR,
|
|
Packit |
667938 |
\&\fB\f(CB$if_title_desc\fB\fR and \fB\f(CB$sysname\fB\fR.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
As \fB\f(CB$if_title\fB\fR depends on \fB\f(CB$if_title_desc\fB\fR, it is possible to indirectly
|
|
Packit |
667938 |
control \fB\f(CB$if_title\fB\fR by using the command line option \fB\-\-if\-descr\fR.
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
(\s-1HTML\s0 escaped variant: \fB\f(CB$html_if_title\fB\fR)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_port_name\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_port_name\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_port_name"
|
|
Packit |
667938 |
If the host is a Cisco Catalyst \s-1LAN\s0 switch, this variable is the name of
|
|
Packit |
667938 |
that port. (No \s-1HTML\s0 escaped variant available)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_pp_port_name\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_pp_port_name\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_pp_port_name"
|
|
Packit |
667938 |
If the host is a Nortel Passport \s-1LAN\s0 switch, this variable is the name of
|
|
Packit |
667938 |
that port. (No \s-1HTML\s0 escaped variant available)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$desc_prefix\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$desc_prefix\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$desc_prefix"
|
|
Packit |
667938 |
This variable is a prefix of the description of what the target is to use in
|
|
Packit |
667938 |
the \*(L"Title[]\*(R" directive and in the H1 section of the \*(L"PageTop[]\*(R". Default is
|
|
Packit |
667938 |
\&\*(L"Traffic analysis for \*(R". (\s-1HTML\s0 escaped variant: \fB\f(CB$html_desc_prefix\fB\fR)
|
|
Packit |
667938 |
.ie n .IP "\fB\fB$if_title_desc\fB\fR" 4
|
|
Packit |
667938 |
.el .IP "\fB\f(CB$if_title_desc\fB\fR" 4
|
|
Packit |
667938 |
.IX Item "$if_title_desc"
|
|
Packit |
667938 |
This is the description of the interface normally used by cfgmaker as part
|
|
Packit |
667938 |
of the variable \fB\f(CB$if_title\fB\fR. The latter is used as the full string in the
|
|
Packit |
667938 |
\&\*(L"Title[]\*(R" directove and the H1 section in the PageTop[].
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
\&\fB\f(CB$if_title_desc\fB\fR is controlled by the command line option \fB\-\-if\-descr\fR
|
|
Packit |
667938 |
which indirectly controls the contents of \fB\f(CB$if_title\fB\fR
|
|
Packit |
667938 |
.Sp
|
|
Packit |
667938 |
(\s-1HTML\s0 escaped variant: \fB\f(CB$html_if_title_desc\fB\fR)
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fIHelp Functions for Templates\fR
|
|
Packit |
667938 |
.IX Subsection "Help Functions for Templates"
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
The following functions exists to facilitate the writing of host and
|
|
Packit |
667938 |
interface templates.
|
|
Packit |
667938 |
.IP "\fBhtml_escape(\f(BIstring\fB)\fR" 4
|
|
Packit |
667938 |
.IX Item "html_escape(string)"
|
|
Packit |
667938 |
\&\fB\f(BIhtml_escape()\fB\fR takes a string as an argument and returns a new string
|
|
Packit |
667938 |
where the following substitutions has been done: the chars \*(L"<\*(R", \*(L">\*(R" and
|
|
Packit |
667938 |
\&\*(L"&\*(R" are replaced by \*(L"<\*(R", \*(L">\*(R" and \*(L"&\*(R" and that newlines embedded
|
|
Packit |
667938 |
in the string are prepended with \*(L"<\s-1BR\s0>\*(R" and appended with a space character
|
|
Packit |
667938 |
(newlines at the end of the string are not touched).
|
|
Packit |
667938 |
.ie n .IP "\fBoid_pick($router_connect,$v3opt,""oid1"",""oid2""...)\fR" 4
|
|
Packit |
667938 |
.el .IP "\fBoid_pick($router_connect,$v3opt,``oid1'',``oid2''...)\fR" 4
|
|
Packit |
667938 |
.IX Item "oid_pick($router_connect,$v3opt,oid1,oid2...)"
|
|
Packit |
667938 |
This function will try to poll each of the oids specified until
|
|
Packit |
667938 |
it is successful or has run out of oids. It will return the name of the
|
|
Packit |
667938 |
first oid that worked or undef if it is not successful
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fIExample Template Files\fR
|
|
Packit |
667938 |
.IX Subsection "Example Template Files"
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Template Example 1: Eliminating Rejected Targets From Appearing
|
|
Packit |
667938 |
.IX Subsection "Template Example 1: Eliminating Rejected Targets From Appearing"
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
This template file generates exactly the same configuration code per
|
|
Packit |
667938 |
interface as cfgmaker does by default, with the exception that it eliminates
|
|
Packit |
667938 |
all lines (comments as well as config code) for an interface if the
|
|
Packit |
667938 |
interface happens to be rejected.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 3
|
|
Packit |
667938 |
\& if(not $problem_lines)
|
|
Packit |
667938 |
\& {
|
|
Packit |
667938 |
\& $target_lines .= <
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& Target[$target_name]: $if_ref:$router_connect
|
|
Packit |
667938 |
\& SetEnv[$target_name]: MRTG_INT_IP="$if_ip" MRTG_INT_DESCR="$if_snmp_descr"
|
|
Packit |
667938 |
\& ECHO
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& if ($directory_name) {
|
|
Packit |
667938 |
\& $target_lines .= "Directory[$target_name]: $directory_name\en";
|
|
Packit |
667938 |
\& }
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& $target_lines .= <
|
|
Packit |
667938 |
\& MaxBytes[$target_name]: $if_speed
|
|
Packit |
667938 |
\& Title[$target_name]: $html_desc_prefix$html_if_title_desc \-\- $sysname
|
|
Packit |
667938 |
\& PageTop[$target_name]: $html_desc_prefix$html_if_title_desc \-\- $sysname
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& System:
|
|
Packit |
667938 |
\& $sysname in $html_syslocation
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& Maintainer:
|
|
Packit |
667938 |
\& $html_syscontact
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& Description:
|
|
Packit |
667938 |
\& $html_if_description
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& ifType:
|
|
Packit |
667938 |
\& $html_if_type_desc ($if_type_num)
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& ifName:
|
|
Packit |
667938 |
\& $html_if_snmp_name
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& ECHO
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& $target_lines .= <
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& Port Name:
|
|
Packit |
667938 |
\& $if_port_name
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& ECHO
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& $target_lines .= <
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& Port Name:
|
|
Packit |
667938 |
\& $if_pp_port_name
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& ECHO
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& $target_lines .= <
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& Max Speed:
|
|
Packit |
667938 |
\& $if_speed_str
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& ECHO
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& $target_lines .= <
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& Ip:
|
|
Packit |
667938 |
\& $if_ip ($if_dns_name)
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& ECHO
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& $target_lines .= <
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& ECHO
|
|
Packit |
667938 |
\& } else {
|
|
Packit |
667938 |
\& $head_lines="";
|
|
Packit |
667938 |
\& $problem_lines="";
|
|
Packit |
667938 |
\& $target_lines="";
|
|
Packit |
667938 |
\& $separator_lines="";
|
|
Packit |
667938 |
\& }
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fITemplate Example 2: Simplier Version of Example 1\fR
|
|
Packit |
667938 |
.IX Subsection "Template Example 2: Simplier Version of Example 1"
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Example 1 was partly intended to demonstrate how to customize the generation
|
|
Packit |
667938 |
of interface targets but also to provide a hint of how the variables are
|
|
Packit |
667938 |
used in the \*(L"default\*(R" template which one could consider that cfgmaker
|
|
Packit |
667938 |
normally uses.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
If you're only intrested in the easiest way of entirely eliminating those
|
|
Packit |
667938 |
reject interfaces, the template below would do the job as well by using
|
|
Packit |
667938 |
\&\fB\f(CB$default_target_lines\fB\fR.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 8
|
|
Packit |
667938 |
\& if($if_ok) {
|
|
Packit |
667938 |
\& $target_lines = $default_target_lines;
|
|
Packit |
667938 |
\& } else {
|
|
Packit |
667938 |
\& $head_lines="";
|
|
Packit |
667938 |
\& $problem_lines="";
|
|
Packit |
667938 |
\& $target_lines="";
|
|
Packit |
667938 |
\& $separator_lines="";
|
|
Packit |
667938 |
\& }
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
\fITemplate Example 3: Creating \s-1CPU\s0 Targets for Hosts\fR
|
|
Packit |
667938 |
.IX Subsection "Template Example 3: Creating CPU Targets for Hosts"
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Below is an example of a host template.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 3
|
|
Packit |
667938 |
\& $head_lines .= <
|
|
Packit |
667938 |
\& #\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
|
|
Packit |
667938 |
\& ECHO
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& my $target_name = $router_name . ".cpu";
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& $target_lines .= <
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& YLegend[$target_name]: Percentage CPU load
|
|
Packit |
667938 |
\& ShortLegend[$target_name]: %
|
|
Packit |
667938 |
\& Legend1[$target_name]: CPU load in %
|
|
Packit |
667938 |
\& Legend2[$target_name]:
|
|
Packit |
667938 |
\& Legend3[$target_name]: Max Observed CPU load
|
|
Packit |
667938 |
\& Legend4[$target_name]:
|
|
Packit |
667938 |
\& LegendI[$target_name]: CPU Load:
|
|
Packit |
667938 |
\& LegendO[$target_name]:
|
|
Packit |
667938 |
\& WithPeak[$target_name]: ywm
|
|
Packit |
667938 |
\& MaxBytes[$target_name]: 100
|
|
Packit |
667938 |
\& Options[$target_name]: growright, gauge, nopercent
|
|
Packit |
667938 |
\& Title[$target_name]: $router_name CPU load
|
|
Packit |
667938 |
\& 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
|
|
Packit |
667938 |
\& PageTop[$target_name]: $router_name CPU load
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& System:
|
|
Packit |
667938 |
\& $router_name in $html_syslocation
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& Maintainer:
|
|
Packit |
667938 |
\& $html_syscontact
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& Description:
|
|
Packit |
667938 |
\& $html_sysdescr
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& Resource:
|
|
Packit |
667938 |
\& CPU.
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\&
|
|
Packit |
667938 |
\& ECHO
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.SH "EXAMPLES"
|
|
Packit |
667938 |
.IX Header "EXAMPLES"
|
|
Packit |
667938 |
The first example creates a config file for \fIrouter.place.xyz\fR: the router
|
|
Packit |
667938 |
has the community name \fIpublic\fR. Interfaces get identified by their
|
|
Packit |
667938 |
\&\s-1IP\s0 number. Two global options get added to the config file. The
|
|
Packit |
667938 |
config file gets redirected to \fImrtg.conf\fR. The '\e' signs at the end
|
|
Packit |
667938 |
of the line mean that this command should be written on a single line.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 4
|
|
Packit |
667938 |
\& cfgmaker \-\-global "WorkDir: /home/tobi" \e
|
|
Packit |
667938 |
\& \-\-global "Options[_]: growright,bits" \e
|
|
Packit |
667938 |
\& \-\-ifref=ip \e
|
|
Packit |
667938 |
\& public@router.place.xyz > mrtg.cfg
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Note: if cfgmaker is not in your path, but you are in the directory where
|
|
Packit |
667938 |
cfgmaker is stored, you can start it with ./cfgmaker
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
The next example creates a config file for four devices:
|
|
Packit |
667938 |
\&\fIrouter1.place.xyz\fR, \fIrouter2.place.xyz\fR, \fIswitch1.place.xyz\fR and
|
|
Packit |
667938 |
\&\fIswitch2.place.xyz\fR all with the community \fIpublic\fR.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
The two routers will have \fB\-\-ifref\fR set to \fBdescr\fR whilst the two
|
|
Packit |
667938 |
switches will use \fB\-\-ifref\fR set to \fBname\fR. Further the routers will
|
|
Packit |
667938 |
use \fB\-\-ifdesc\fR set to \fBalias\fR and \fIswitch1.place.xyz\fR will use
|
|
Packit |
667938 |
\&\fB\-\-ifdesc\fR set to \fBdescr\fR whilst \fIswitch2.place.xyz\fR use \fBname\fR instead.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
Finally, there will be two Options lines inserted in the configuration:
|
|
Packit |
667938 |
One will be in the beginning, whilst the other will be inserted after
|
|
Packit |
667938 |
the lines related to the two routers but before those lines related
|
|
Packit |
667938 |
to the switches.
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 12
|
|
Packit |
667938 |
\& cfgmaker \-\-global "WorkDir: /home/tobi" \e
|
|
Packit |
667938 |
\& \-\-global "Options[_]: growright,bits" \e
|
|
Packit |
667938 |
\& \-\-ifref=descr \e
|
|
Packit |
667938 |
\& \-\-ifdesc=alias \e
|
|
Packit |
667938 |
\& public@router1.place.xyz \e
|
|
Packit |
667938 |
\& public@router2.place.xyz \e
|
|
Packit |
667938 |
\& \-\-global "Options[_]: growright" \e
|
|
Packit |
667938 |
\& \-\-ifref=name \e
|
|
Packit |
667938 |
\& \-\-ifdesc=descr \e
|
|
Packit |
667938 |
\& public@switch1.place.xyz \e
|
|
Packit |
667938 |
\& \-\-ifdesc=name \e
|
|
Packit |
667938 |
\& public@switch2.place.xyz > mrtg.cfg
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
The next example demonstrates how to use the \fB\-\-community\fR,
|
|
Packit |
667938 |
\&\fB\-\-snmp\-options\fR and \fB\-\-dns\-domain\fR to make the command line
|
|
Packit |
667938 |
simpler. All the equipment will use the community \fIhidden\fR, except for
|
|
Packit |
667938 |
the ppp-server which use community \fIaccess\fR. All equipment uses these
|
|
Packit |
667938 |
\&\s-1SNMP\s0 options: \fB1s timeout\fR, \fB1 retry\fR and \fB\s-1SNMP\s0 version 2\fR (\fBbackoff\fR and
|
|
Packit |
667938 |
\&\fBport\fR is unspecified which means they use the default values).
|
|
Packit |
667938 |
The exception again is the ppp-server which uses \fB\s-1SNMP\s0 version 1\fR.
|
|
Packit |
667938 |
Finally, all the equipment is part of the domain \fIplace.xyz\fR, except
|
|
Packit |
667938 |
for the ppp-server which is part of the domain \fIremote.place.xyz\fR.
|
|
Packit |
667938 |
Note that the latter is achieved simply by specifying the name
|
|
Packit |
667938 |
of the ppp-server to be \fIppp-server.\f(BIremote\fI\fR .
|
|
Packit |
667938 |
.PP
|
|
Packit |
667938 |
.Vb 10
|
|
Packit |
667938 |
\& cfgmaker \-\-global "WorkDir: /home/tobi" \e
|
|
Packit |
667938 |
\& \-\-global "Options[_]: growright,bits" \e
|
|
Packit |
667938 |
\& \-\-dns\-domain=place.xyz \e
|
|
Packit |
667938 |
\& \-\-community=hidden \e
|
|
Packit |
667938 |
\& \-\-snmp\-options=::1:1::2 \e
|
|
Packit |
667938 |
\& router1 \e
|
|
Packit |
667938 |
\& router2 \e
|
|
Packit |
667938 |
\& router3 \e
|
|
Packit |
667938 |
\& router4 \e
|
|
Packit |
667938 |
\& router5 \e
|
|
Packit |
667938 |
\& switch1 \e
|
|
Packit |
667938 |
\& switch2 \e
|
|
Packit |
667938 |
\& switch3 \e
|
|
Packit |
667938 |
\& switch4 \e
|
|
Packit |
667938 |
\& switch5 \e
|
|
Packit |
667938 |
\& switch6 \e
|
|
Packit |
667938 |
\& switch7 \e
|
|
Packit |
667938 |
\& access@ppp\-server.remote:::::1 > mrtg.cfg
|
|
Packit |
667938 |
.Ve
|
|
Packit |
667938 |
.SH "SEE ALSO"
|
|
Packit |
667938 |
.IX Header "SEE ALSO"
|
|
Packit |
667938 |
mrtg-reference
|
|
Packit |
667938 |
.SH "AUTHOR"
|
|
Packit |
667938 |
.IX Header "AUTHOR"
|
|
Packit |
667938 |
Tobias Oetiker <tobi@oetiker.ch> and
|
|
Packit |
667938 |
Jakob Ilves <jakob.ilves@oracle.com>
|
|
Packit |
667938 |
.SH "LICENSE"
|
|
Packit |
667938 |
.IX Header "LICENSE"
|
|
Packit |
667938 |
\&\s-1GNU\s0 General Public License
|
|
Packit |
667938 |
.SH "COPYRIGHT"
|
|
Packit |
667938 |
.IX Header "COPYRIGHT"
|
|
Packit |
667938 |
Cfgmaker is Copyright 2000 by Tobias Oetiker <tobi@oetiker.ch>
|