Cfgmaker
Cfgmaker
N#NA#AM#ME#E
cfgmaker - Creates mrtg.cfg files (for mrtg-2.17.10)
S#SY#YN#NO#OP#PS#SI#IS#S
cfgmaker [options] [community@]router [[options] [community@]router
...]
O#OP#PT#TI#IO#ON#NS#S
--ifref=name interface references by Interface Name (default)
--ifref=ip ... by Ip Address
--ifref=eth ... by Ethernet Number
--ifref=descr ... by Interface Description
--ifref=nr ... by Interface Number
--ifref=type ... by Interface Type
You may also use multiple options separated by commas,
in which case the first available one is used:
e.g. --ifref=ip,name,nr
--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
--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)"
--snmp-options=:[<port>][:[<tmout>][:[<retr>][:[<backoff>][:<ver>]]]]
--dns-domain=domain
Specifies a domain to append to the name of all
routers following.
D#DE#ES#SC#CR#RI#IP#PT#TI#IO#ON#N
C#Cf#fg#gm#ma#ak#ke#er#r creates MRTG configuration files based on
information pulled
from a router or another SNMP manageable device.
[_#c_#o_#m_#m_#u_#n_#i_#t_#y@#@]_#r_#o_#u_#t_#e_#r
r#ro#ou#ut#te#er#r[:[p#pr#rt#t][:[t#tm#mo#ou#ut#t][:[r#re#et#tr#r][:
[b#ba#ac#ck#ko#of#ff#f][:v#ve#er#rs#s]]]]]
Note that the first line of the generated cfg file will contain all the
commandline options you used for generating it. This is to allow for
the easy 'regeneration' in case you want to add newhosts or make some
other global change.
C#Co#on#nf#fi#ig#gu#ur#ra#at#ti#io#on#n
Except for the -#--#-o#ou#ut#tp#pu#ut#t and -#--#-g#gl#lo#ob#ba#al#l
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.
-#--#-h#he#el#lp#p
Print a brief help message and exit.
-#--#-m#ma#an#n
Prints the manual page and exits.
-#--#-v#ve#er#rs#si#io#on#n
Print the version of cfgmaker. This should match the version of
MRTG for which config files are being created.
-#--#-i#if#fr#re#ef#f n#nr#r|i#ip#p|e#et#th#h|d#de#es#sc#cr#r|n#na#am#me#e
Select the interface identification method. Default is n#nr#r 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 their numbering every full moon just for fun.
-#--#-i#if#fd#de#es#sc#c n#nr#r|i#ip#p|e#et#th#h|d#de#es#sc#cr#r|
n#na#am#me#e|t#ty#yp#pe#e|a#al#li#ia#as#s
Select what to use as the description of the interface. The
description appears in the "Title[]" property for the target as
well as the text header in the HTML code defined in the target's
"PageTop[]". Default is to use n#nr#r which is just the interface
number which isn't always useful to the viewer of the graphs.
There are 6 other properties which could be used. Use i#ip#p if you
want to use the interface's IP-address. Use e#et#th#h if you want to
use
the interface's ethernet address. If you want a better
description, you can use either d#de#es#sc#cr#r, n#na#am#me#e or
a#al#li#ia#as#s. 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 n#na#am#me#e might result in "S0" being
the
interface description , d#de#es#sc#cr#r might result in "Serial0" and
a#al#li#ia#as#s
might result in "Link to HQ" (provided that is what is used as the
interface's "description" in the router's configuration).
-#--#-i#if#f-#-f#fi#il#lt#te#er#r 'f#fi#il#lt#te#er#r-#-
e#ex#xp#pr#re#es#ss#si#io#on#n'
First of all, this is under some development and is experimental.
Use this if you want to have better control over what interfaces
gets included into the configuration. The f#fi#il#lt#te#er#r-#-
e#ex#xp#pr#re#es#ss#si#io#on#n 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
interface.
For a further discussion on how these filters work, see the section
"Details on Filters" below.
-#--#-i#if#f-#-t#te#em#mp#pl#la#at#te#e t#te#em#mp#pl#la#at#te#e-#-
f#fi#il#le#e
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 t#te#em#mp#pl#la#at#te#e-#-f#fi#il#le#e will be evaluated as a Perl
program which
generates the lines using certain variables for input and output.
-#--#-h#ho#os#st#t-#-t#te#em#mp#pl#la#at#te#e t#te#em#mp#pl#la#at#te#e-#-
f#fi#il#le#e
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
t#te#em#mp#pl#la#at#te#e-#-f#fi#il#le#e
will be evaluated once per host as a Perl program which generates
the lines using certain variables for input and output.
-#--#-c#co#om#mm#mu#un#ni#it#ty#y c#co#om#mm#mu#un#ni#it#ty#y-#-
s#st#tr#ri#in#ng#g
Use this to set the community for the routers following on the
command line to c#co#om#mm#mu#un#ni#it#ty#y-#-s#st#tr#ri#in#ng#g.
Individual routers might
override this community string by using the syntax
c#co#om#mm#mu#un#ni#it#ty#y@#@r#ro#ou#ut#te#er#r.
-#--#-e#en#na#ab#bl#le#e-#-i#ip#pv#v6#6
This option enables IPv6 support. It requires the appropriate perl
modules; if they are not found then IPv6 is disabled (see the ipv6
documentation).
cfgmaker will use IPv6 or IPv4 depending on the target. If the
target is a numeric address, the protocol depends on the type of
address. If the target is a hostname, cfgmaker will try to resolve
the name first to an IPv6 address then to an IPv4 address.
For example:
If the target has both an IPv6 address and an IPv4 address with the
same hostname, cfgmaker first queries the target using IPv6 and
falls back to IPv4 if it fails. This is useful for targets which
don't support SNMP over IPv6.
-#--#-u#us#se#e-#-1#16#6b#bi#it#t
This option forces the use of 16bit SNMP request IDs. Some broken
SNMP agents do not accept 32bit request IDs. Try to avoid this
option as much as possible, complain to your agent vendor instead.
-#--#-s#sn#nm#mp#p-#-o#op#pt#ti#io#on#ns#s :[p#po#or#rt#t][:
[t#ti#im#me#eo#ou#ut#t][:[r#re#et#tr#ri#ie#es#s][:[b#ba#ac#ck#ko#of#ff#f]
[:v#ve#er#rs#si#io#on#n]]]]
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 -#--#-s#sn#nm#mp#p-#-o#op#pt#ti#io#on#ns#s by
using the syntax
r#ro#ou#ut#te#er#r[:[p#po#or#rt#t][:[t#ti#im#me#eo#ou#ut#t][:
[r#re#et#tr#ri#ie#es#s][:[b#ba#ac#ck#ko#of#ff#f][:v#ve#er#rs#si#io#on#n]]]]]
-#--#-n#no#or#re#ev#ve#er#rs#se#ed#dn#ns#s
Do not try to reverse lookup IP numbers ... a must for DNS free
environments.
-#--#-n#no#o-#-d#do#ow#wn#n
Normally cfgmaker will not include interfaces which are marked
anything but administratively and operationally UP. With this
switch you get them all.
-#--#-s#sh#ho#ow#w-#-o#op#p-#-d#do#ow#wn#n
Include interfaces which are operatively down.
-#--#-z#ze#er#ro#o-#-s#sp#pe#ee#ed#d _#s_#p_#e_#e_#d
Assign this speed in bits-per-second to all interfaces which return
0 for ifSpeed and ifHighSpeed. Some switches, notably Foundry
equipment, return a speed of zero for some interfaces. For
example, to have all interfaces reporting zero set to 100Mbps, use
--zero-speed=100000000.
-#--#-s#su#ub#bd#di#ir#rs#s _#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 replacements. The string "HOSTNAME" will be
replaced by the hostname of the router (however you specified it on
the c#cf#fg#gm#ma#ak#ke#er#r commandline -- it may be an actual hostname
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:
Directory[10.10.0.18_1]: 10.10.0.18__fp2200-bothrip-1.3
-#--#-o#ou#ut#tp#pu#ut#t _#f_#i_#l_#e
Write the output from c#cf#fg#gm#ma#ak#ke#er#r into the file
_#f_#i_#l_#e. The default is
to use "STDOUT". -#--#-o#ou#ut#tp#pu#ut#t is expected to appear only
once on the
command line. If used multiple times, the file specified by the
last -#--#-o#ou#ut#tp#pu#ut#t will be used.
-#--#-n#no#oi#in#nt#te#er#rf#fa#ac#ce#es#s
Don't generate configuration lines for interfaces.
-#--#-i#in#nt#te#er#rf#fa#ac#ce#es#s
This makes cfgmaker generate configuration lines for interfaces
(the default behaviour).
--enablesnmpv3 {yes|no}
The -#--#-e#en#na#ab#bl#le#es#sn#nm#mp#pv#v3#3 option is an optional
flag to check for the
presence of the N#Ne#et#t:#::#:S#SN#NM#MP#P libraries.
C#Cf#fg#gm#ma#ak#ke#er#r will try to
determine whether this flag is required and will set the values
automatically.
_#S_#N_#M_#P_#v_#3 _#A_#r_#g_#u_#m_#e_#n_#t_#s
Context Engine ID
The -#--#-c#co#on#nt#te#ex#xt#te#en#ng#gi#in#ne#ei#id#d argument expects
a hexadecimal string
representing the desired contextEngineID. The string must be 10 to
64 characters (5 to 32 octets) long and can be prefixed with an
optional "0x". Once the -#--#-
c#co#on#nt#te#ex#xt#te#en#ng#gi#in#ne#ei#id#d is specified it stays
with the object until it is changed again or reset to default by
passing in the undefined value. By default, the contextEngineID is
set to match the authoritativeEngineID of the authoritative SNMP
engine.
Context Name
The contextName is passed as a string which must be 0 to 32 octets
in length using the -#--#-c#co#on#nt#te#ex#xt#tn#na#am#me#e argument.
The contextName stays
with the object until it is changed. The contextName defaults to
an empty string which represents the "default" context.
Two different hash algorithms are defined by SNMPv3 which can be used
by the Security Model for authentication. These algorithms are
HMAC-MD5-96 "MD5" (RFC 1321) and HMAC-SHA-96 "SHA-1" (NIST FIPS PUB
180-1). The default algorithm used by the module is HMAC-MD5-96.
This behavior can be changed by using the -#--#-
a#au#ut#th#hp#pr#ro#ot#to#oc#co#ol#l argument.
This argument expects either the string 'md5' or 'sha' to be passed to
modify the hash algorithm.
_#P_#r_#e_#d_#e_#f_#i_#n_#e_#d _#F_#i_#l_#t_#e_#r
_#V_#a_#r_#i_#a_#b_#l_#e_#s
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 evaluated
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 quotes will
avoid such accidental evaluation:
$#$i#if#f_#_t#ty#yp#pe#e
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 variables below. Normally, cfgmaker puts
in the target's PageTop this iftype value within parenthesis after
the name of the interface type. (e.g "propPointToPointSerial
(22)").
$#$d#de#ef#fa#au#ul#lt#t
True if and only if cfgmaker normally should accepted the interface
based on the interfaces administrative and operational state
(taking the flags -#--#-n#no#o-#-d#do#ow#wn#n and -#--#-s#sh#ho#ow#w-#-
o#op#p-#-d#do#ow#wn#n into account) and
it's type (and a few other things).
$#$d#de#ef#fa#au#ul#lt#t_#_i#if#fs#st#ta#at#te#e
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 -#--#-n#no#o-#-d#do#ow#wn#n and
-#--#-s#sh#ho#ow#w-#-o#op#p-#-d#do#ow#wn#n).
$#$d#de#ef#fa#au#ul#lt#t_#_i#if#ft#ty#yp#pe#e
True if and only if cfgmaker would have accepted the interface
based on it's type (and a few type specific details in addition).
$#$i#if#f_#_a#ad#dm#mi#in#n
True if and only if the interface is in an administrative up state.
$#$i#if#f_#_o#op#pe#er#r
True if and only if the interface is in an operational up state.
$#$i#if#f_#_i#is#s_#_e#et#th#he#er#rn#ne#et#t
True for ethernet interfaces (nr 6, 7, 26, 62, 69 and 117).
$#$i#if#f_#_i#is#s_#_i#is#sd#dn#n
True for various ISDN interface types (nr 20, 21, 63, 75, 76 and
77)
$#$i#if#f_#_i#is#s_#_d#di#ia#al#lu#up#p
True for dial-up interfaces such as PPP as well as ISDN. (nr 23,
81, 82 and 108 in addition to the numbers of
$#$i#if#f_#_i#is#s_#_i#is#sd#dn#n).
$#$i#if#f_#_i#is#s_#_a#at#tm#m
True for miscellaneous ATM related interface types (nr 37, 49, 107,
105, 106, 114 and 134).
$#$i#if#f_#_i#is#s_#_w#wa#an#n
True for WAN interfaces point to point, Frame Relay and High Speed
Serial ( 22,32,44,46)
$#$i#if#f_#_i#is#s_#_l#la#an#n
True for LAN interfaces (8, 9, 11, 15, 26, 55, 59, 60 and 115 in
addition to the numbers of
$#$i#if#f_#_i#is#s_#_e#et#th#he#er#rn#ne#et#t).
$#$i#if#f_#_i#is#s_#_d#ds#sl#l
True for ADSL, RDSL, HDSL and SDSL (nr 94, 95, 96, 97)
$#$i#if#f_#_i#is#s_#_l#lo#oo#op#pb#ba#ac#ck#k
True for software loopback interfaces (nr 24)
$#$i#if#f_#_i#is#s_#_c#ci#is#sc#co#ov#vl#la#an#n
True for Cisco VLAN interfaces (interfaces with the word Vlan or
VLAN in their ifdescs)
$#$i#if#f_#_v#vl#la#an#n_#_i#id#d
Returns the vlan id associated with a specific port on Cisco
Catalyst switches under both Catalyst OS and IOS, and 3Com
switches. If it is not a vlan interface, will return undef.
$#$i#if#f_#_c#ci#is#sc#co#o_#_t#tr#ru#un#nk#k
Returns the trunking state of a specific port on Cisco Catalyst
switches under both Catalyst OS and IOS. Returns "1" if the
interface is a trunk, undef otherwise.
$#$i#if#f_#_M#MT#TU#U
Returns the Maximum Transfer Unit associated with a specific port.
Besides that, you can also use the variables defined for templates
below. Further, all the variables available in cfgmaker is at the
scripts disposal even if the use of such features is discouraged. More
"shortcuts" in the form of variables and functions will be made
available in the future instead.
The following filter will not affect which interfaces gets 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.
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 "<", ">" and "&" 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).
_#W_#r_#i_#t_#a_#b_#l_#e _#T_#e_#m_#p_#l_#a_#t_#e
_#V_#a_#r_#i_#a_#b_#l_#e_#s
These are the variables available to store the configuration 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 happens: 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 $#$t#ta#ar#rg#ge#et#t_#_l#li#in#ne#es#s are turned into
comments by adding a hash
mark ("#") at their beginning. Then all the variables
$#$h#he#ea#ad#d_#_l#li#in#ne#es#s,
$#$p#pr#ro#ob#bl#le#em#m_#_l#li#in#ne#es#s ,
$#$t#ta#ar#rg#ge#et#t_#_l#li#in#ne#es#s and
$#$s#se#ep#pa#ar#ra#at#to#or#r_#_l#li#in#ne#es#s are concatenated
together to form the lines to add to the configuration file.
$#$t#ta#ar#rg#ge#et#t_#_l#li#in#ne#es#s
This variable is the placeholder for the configuration lines
created by the template. $#$t#ta#ar#rg#ge#et#t_#_l#li#in#ne#es#s is
predefined to be empty
when the template code is evaluated.
$#$h#he#ea#ad#d_#_l#li#in#ne#es#s
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
$#$h#he#ea#ad#d_#_l#li#in#ne#es#s
during evaluation, the comment will look like usual in the config
file.
$#$p#pr#ro#ob#bl#le#em#m_#_l#li#in#ne#es#s
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
$#$p#pr#ro#ob#bl#le#em#m_#_l#li#in#ne#es#s is
predefined with the error description comments which cfgmaker
normally would use for rejected interfaces or as the empty string
for accepted interfaces.
$#$s#se#ep#pa#ar#ra#at#to#or#r_#_l#li#in#ne#es#s
This variable is the placeholder for the string to use as the
separator between the code for individual targets. 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).
_#P_#r_#e_#d_#e_#f_#i_#n_#e_#d _#T_#e_#m_#p_#l_#a_#t_#e
_#V_#a_#r_#i_#a_#b_#l_#e_#s
All the variables below are available for interface templates to use.
For host templates, only those listed under "Host and System Variables"
are available.
$#$r#ro#ou#ut#te#er#r_#_n#na#am#me#e
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 -#--#-d#dn#ns#s-#-d#do#om#ma#ai#in#n.
$#$r#ro#ou#ut#te#er#r_#_c#co#on#nn#ne#ec#ct#t
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, -#--#-c#co#om#mm#mu#un#ni#it#ty#y, -#--#-
s#sn#nm#mp#p-#-o#op#pt#ti#io#on#ns#s and -#--#-d#dn#ns#s-#-d#do#om#ma#ai#in#n.
(There's no HTML escaped variant available)
$#$d#di#ir#re#ec#ct#to#or#ry#y_#_n#na#am#me#e
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 -#--#-s#su#ub#bd#di#ir#rs#s command line
option. If
-#--#-s#su#ub#bd#di#ir#rs#s isn't specified
$#$d#di#ir#re#ec#ct#to#or#ry#y_#_n#na#am#me#e will be the empty string.
(There's no HTML escaped variant available)
$#$s#sy#ys#sc#co#on#nt#ta#ac#ct#t
This variable is the router's SNMP sysContact value. (HTML escaped
variant: $#$h#ht#tm#ml#l_#_s#sy#ys#sc#co#on#nt#ta#ac#ct#t)
$#$s#sy#ys#sn#na#am#me#e
This variable is the router's SNMP sysName value. (No HTML escaped
variant available)
$#$s#sy#ys#sl#lo#oc#ca#at#ti#io#on#n
This variable is the router's SNMP sysLocation value. (HTML
escaped variant: $#$h#ht#tm#ml#l_#_s#sy#ys#sl#lo#oc#ca#at#ti#io#on#n)
$#$s#sy#ys#sd#de#es#sc#cr#r
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: $#$h#ht#tm#ml#l_#_s#sy#ys#sd#de#es#sc#cr#r)
$#$t#ta#ar#rg#ge#et#t_#_n#na#am#me#e
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 directives. (There's no HTML escaped
variant available)
$#$i#if#f_#_r#re#ef#f
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 -#--#-
i#if#fr#re#ef#f
command line option. It is normally used together with
$#$r#ro#ou#ut#te#er#r_#_c#co#on#nn#ne#ec#ct#t. (There's no HTML escaped
variant available)
$#$i#if#f_#_o#ok#k
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 $#$p#pr#ro#ob#bl#le#em#m_#_l#li#in#ne#es#s to find out
if an interface will
be rejected or not, use this $#$i#if#f_#_o#ok#k instead.
$#$d#de#ef#fa#au#ul#lt#t_#_t#ta#ar#rg#ge#et#t_#_l#li#in#ne#es#s
This variable contains all the target lines which cfgmaker 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 template.
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.
$#$d#de#ef#fa#au#ul#lt#t_#_t#ta#ar#rg#ge#et#t_#_d#di#ir#re#ec#ct#ti#iv#ve#e
This variable contains the default string for the Target[]
directive line.
$#$d#de#ef#fa#au#ul#lt#t_#_s#se#et#te#en#nv#v_#_d#di#ir#re#ec#ct#ti#iv#ve#e
This variable contains the default string for the SetEnv[]
directive line.
$#$d#de#ef#fa#au#ul#lt#t_#_d#di#ir#re#ec#ct#to#or#ry#y_#_d#di#ir#re#ec#ct#ti#iv#ve#
e
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.
$#$d#de#ef#fa#au#ul#lt#t_#_m#ma#ax#xb#by#yt#te#es#s_#_d#di#ir#re#ec#ct#ti#iv#ve#e
This variable contains the default string for the MaxBytes[]
directive line.
$#$d#de#ef#fa#au#ul#lt#t_#_t#ti#it#tl#le#e_#_d#di#ir#re#ec#ct#ti#iv#ve#e
This variable contains the default string for the Title[] directive
line.
$#$d#de#ef#fa#au#ul#lt#t_#_p#pa#ag#ge#et#to#op#p_#_d#di#ir#re#ec#ct#ti#iv#ve#e
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
$#$i#if#f_#_i#ip#p
This variable should contain the IP-address of the interface, if
any has been assigned to it. (There's no HTML escaped variant
available)
$#$i#if#fi#in#nd#de#ex#x
This variable is the SNMP ifIndex for the interface which per
definition always is an integer. (There's no HTML escaped variant
available)
$#$i#if#f_#_i#in#nd#de#ex#x
Equivalent with $#$i#if#fi#in#nd#de#ex#x.
$#$i#if#f_#_e#et#th#h
Contains the ethernet address of the interface, if any. (There's
no HTML escaped variant available)
$#$i#if#f_#_s#sp#pe#ee#ed#d
This variable is the speed in bytes/second (with prefixes).
(There's no HTML escaped variant available)
$#$i#if#f_#_s#sp#pe#ee#ed#d_#_s#st#tr#r
This variable is a cooked speed description which is either in bits
or bytes depending on whether 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)
$#$i#if#f_#_t#ty#yp#pe#e_#_d#de#es#sc#c
This variable is a textual description of the interface type.
(HTML escaped variant:
$#$h#ht#tm#ml#l_#_i#if#f_#_t#ty#yp#pe#e_#_d#de#es#sc#c)
$#$i#if#f_#_t#ty#yp#pe#e_#_n#nu#um#m
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 available)
$#$i#if#f_#_d#dn#ns#s_#_n#na#am#me#e
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
$#$i#if#f_#_s#sn#nm#mp#p_#_d#de#es#sc#cr#r
This variable should contain the "raw" description of the interface
as determined by the SNMP polling of the router. (HTML escaped
variant: $#$h#ht#tm#ml#l_#_i#if#f_#_s#sn#nm#mp#p_#_d#de#es#sc#cr#r)
$#$i#if#f_#_s#sn#nm#mp#p_#_n#na#am#me#e
The "raw" name for the interface as provided by SNMP polling.
(HTML escaped variant:
$#$h#ht#tm#ml#l_#_i#if#f_#_s#sn#nm#mp#p_#_n#na#am#me#e)
$#$i#if#f_#_s#sn#nm#mp#p_#_a#al#li#ia#as#s
The "raw" ifAlias for the interface as provided by SNMP polling.
(HTML escaped variant:
$#$h#ht#tm#ml#l_#_i#if#f_#_s#sn#nm#mp#p_#_a#al#li#ia#as#s)
$#$i#if#f_#_c#ci#is#sc#co#o_#_d#de#es#sc#cr#r
The "raw" CiscolocIfDescr for the interface as provided by SNMP
polling. (HTML escaped variant:
$#$h#ht#tm#ml#l_#_i#if#f_#_c#ci#is#sc#co#o_#_d#de#es#sc#cr#r)
$#$i#if#f_#_d#de#es#sc#cr#ri#ip#pt#ti#io#on#n
This is the "cooked" description string for the interface, taking
into account the SNMP values found for the interface's RDescr,
ifAlias and CiscolocIfDescr. (HTML escaped variant:
$#$h#ht#tm#ml#l_#_i#if#f_#_d#de#es#sc#cr#ri#ip#pt#ti#io#on#n)
$#$i#if#f_#_t#ti#it#tl#le#e
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
$#$d#de#es#sc#c_#_p#pr#re#ef#fi#ix#x,
$#$i#if#f_#_t#ti#it#tl#le#e_#_d#de#es#sc#c and $#$s#sy#ys#sn#na#am#me#e.
As $#$i#if#f_#_t#ti#it#tl#le#e depends on
$#$i#if#f_#_t#ti#it#tl#le#e_#_d#de#es#sc#c, it is possible to
indirectly control $#$i#if#f_#_t#ti#it#tl#le#e by using the command line
option
-#--#-i#if#f-#-d#de#es#sc#cr#r.
$#$i#if#f_#_p#po#or#rt#t_#_n#na#am#me#e
If the host is a Cisco Catalyst LAN switch, this variable is the
name of that port. (No HTML escaped variant available)
$#$i#if#f_#_p#pp#p_#_p#po#or#rt#t_#_n#na#am#me#e
If the host is a Nortel Passport LAN switch, this variable is the
name of that port. (No HTML escaped variant available)
$#$d#de#es#sc#c_#_p#pr#re#ef#fi#ix#x
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 "Traffic analysis for ". (HTML escaped
variant: $#$h#ht#tm#ml#l_#_d#de#es#sc#c_#_p#pr#re#ef#fi#ix#x)
$#$i#if#f_#_t#ti#it#tl#le#e_#_d#de#es#sc#c
This is the description of the interface normally used by cfgmaker
as part of the variable $#$i#if#f_#_t#ti#it#tl#le#e. The latter is used
as the full
string in the "Title[]" directive and the H1 section in the
PageTop[].
h#ht#tm#ml#l_#_e#es#sc#ca#ap#pe#e(#(_#s#s_#t#t_#r#r_#i#i_#n#n_#g#g)#)
h#ht#tm#ml#l_#_e#es#sc#ca#ap#pe#e(#()#) takes a string as an argument
and returns a new
string where the following substitutions has been done: the chars
"<", ">" and "&" are replaced by "<", ">" and "&" and
that newlines embedded in the string are prepended with "<BR>" and
appended with a space character (newlines at the end of the string
are not touched).
o#oi#id#d_#_p#pi#ic#ck#k(#($#$r#ro#ou#ut#te#er#r_#_c#co#on#nn#ne#ec#ct#t,#,
$#$v#v3#3o#op#pt#t,#,"#"o#oi#id#d1#1"#",#,"#"o#oi#id#d2#2"#".#..#..#.)#)
This function will try to poll each of the oids specified until it
is successful or has run out of oids. It will return the name of
the first oid that worked or undef if it is not successful
This template file generates exactly the same configuration 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>
<div id="sysdetails">
<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;
</table>
</div>
ECHO
} else {
$head_lines="";
$problem_lines="";
$target_lines="";
$separator_lines="";
}
if($if_ok) {
$target_lines = $default_target_lines;
} else {
$head_lines="";
$problem_lines="";
$target_lines="";
$separator_lines="";
}
$head_lines .= <<ECHO;
#---------------------------------------------------------------------
ECHO
$target_lines .= <<ECHO;
E#EX#XA#AM#MP#PL#LE#ES#S
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.
Note: if cfgmaker is not in your path, but you are in the directory
where cfgmaker is stored, you can start it with ./cfgmaker
S#SE#EE#E A#AL#LS#SO#O
mrtg-reference
A#AU#UT#TH#HO#OR#R
Tobias Oetiker <[email protected]> and Jakob Ilves
<[email protected]>
L#LI#IC#CE#EN#NS#SE#E
GNU General Public License
C#CO#OP#PY#YR#RI#IG#GH#HT#T
Cfgmaker is Copyright 2000 by Tobias Oetiker <[email protected]>