GNU/Linux man pages

Livre :
Expressions régulières,
Syntaxe et mise en oeuvre :

ISBN : 978-2-7460-9712-4
EAN : 9782746097124
(Editions ENI)


CentOS 2.1AS







cfgmaker − Creates mrtg.cfg files (for mrtg-2.9.6)


cfgmaker [options] community@router [community@router ...]


 --ifref=nr        interface references by Interface Number (default)
 --ifref=ip                         ... by Ip Address
 --ifref=eth                        ... by Ethernet Number
 --ifref=descr                      ... by Interface Description
 --ifref=name                       ... by Interface Name
 --ifref=type                       ... by Interface Type
 --ifdesc=nr      interface description uses Interface Number (default)
 --ifdesc=ip                        ... uses Ip Address
 --ifdesc=eth                       ... uses Ethernet Number
 --ifdesc=descr                     ... uses Interface Description
 --ifdesc=name                      ... uses Interface Name
 --ifdesc=alias                     ... uses Interface Alias
 --ifdesc=type                      ... uses Interface Type
 --global "x: a"   add global config entries
 --no-down         do not look at admin or opr status of interfaces
 --descint         describe interface instead of just ’Traffic Analysis for’
 --subdirs=format  give each router its own subdirectory, naming each per
                   "format", in which HOSTNAME and SNMPNAME will be
                   replaced by the values of those items -- for instance,
                   --subdirs=HOSTNAME or --subdirs="HOSTNAME (SNMPNAME)"
 --noreversedns    do not reverse lookup ip numbers
 --help            brief help message
 --man             full documentation
 --version         print the version of cfgmaker
 --output=file     output filename default is STDOUT


Cfgmaker creates MRTG configuration files based on information pulled from a router or another SNMP manageable device.

Community is the community name of the device you want to create a configuration for. The default community name is ’public’; you might want to try this first if you do not know the community name of a device. If you are using the wrong comunity name you will get no response from the device.

Router is the DNS name or the IP number of an SNMP-managable device. Following the name you can specify 6 further options separated by colons. The full syntax looks like this:


Of special interest may be the last parameter, version. If you set this to ’2’ then your device will be queried with SNMP version 2 requests. This allows to poll the 64 bit traffic counters in the device and will thus work much better with fast interfaces (no more counter overrun).


Print a brief help message and exit.


Prints the manual page and exits.


Print the version of cfgmaker. This should match the version of MRTG for which config files are being created.

--ifref nripethdescrname

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

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

Select ip to identify the interface by its IP number. Use eth to use the ethernet address for identification. Or use descr to use the Interface description.

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

--ifdesc nripethdescrnametypealias

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 nr 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 ip if you want to use the interface’s IP-address. Use eth if you want to use the interface’s ethernet address. If you want a better description, you can use either descr, name or alias. 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 name might result in "S0" being the interface description , descr might result in "Serial0" and alias might result in "Link to HQ " (provided that is what is used as the interface’s "description" in the router’s configuration).

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

--global ""bla: abc""

Use this to add global options to the generated config file. You can call --global several times to add multiple options.

 --global "workdir: /home/mrtg"

If you want some default Options you might want to put

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


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


Normally cfgmaker will not include interfaces which are marked anything but administratively and operationally UP . With this switch you get them all.

--subdirs format

Give each router its own subdirectory for the HTML and graphics (or .rrd) files. The directory name is the given format 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 cfgmaker 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:

 cfgmaker --subdirs=HOSTNAME__SNMPNAME public@

would result in the generation of lines looking something like:



This example creates a config file for router.place.xyz: the router has the community name public. Interfaces get identified by their IP number. Two global options get added to the config file. The config file gets redirected to mrtg.conf. The ’\’ signs at the end of the line mean that this command should be written on a single line.

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


the reference manpage


Tobias Oetiker <tobi@oetiker.ch>


GNU General Public License


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