[mrtg] nic ordering in snmp

Niall O'Reilly Niall.oReilly at ucd.ie
Sat Jan 10 21:05:31 CET 2009


On Sat, 2009-01-10 at 14:33 -0500, R Dicaire wrote:
> Also, are the contents of [ ] critical to the resolution of interface
> name when using --ifref=name?

	Not at all.  The contents of the [ ] serve to identify
	the data set to MRTG, and are used to name the log file.

	It's the '...:public at rdb:' which specifies the interface.

	If there's just a number where the dots are, it's the 
	numeric interface index, which may change on reboot, or
	when you add or remove interfaces, whether physically or 
	just by enabling or disabling them.

	Otherwise, the prefix character is used to indicate which
	MIB table is used to resolve the string which follows, up
	to the colon (:).  The '#' means find a match in ifName
	to determine which numeric index (SNMP need an integer)
	to use.  As you can see from the MRTG reference, other
	prefixes correspond to other ways of referring to the
	interface, and trigger a lookup in the corresponding MIB
	table.

	[ There's much more to specifying how MRTG interacts with
	  the SNMP agent, but it's not important right now. ]

	And, no: in this context, '#' doesn't cause the rest of the
	line in the configuration file to be discarded as a comment.
	IIUC, it works as a comment introducer only at the beginning
	of a line.

> I ask because I'm going to be editing an existing mrtg.cfg to
> implement the --ifref=name changes and hope to keep existing log
> files.

	Don't mess with what's between the [ ], and your log files
	(or RRD files) with matching names will just keep on 
	accumulating the data.

	/Niall




More information about the mrtg mailing list