[mrtg] cfgmaker and multiple IPs per interface

Steve Bonds 388rzvl02 at sneakemail.com
Wed May 4 22:29:12 MEST 2005


MRTG Folks:

When running cfgmaker 2.11.1 against some of our UNIX hosts with
virtual IPs (e.g. multiple IPs per physical interface) the IP that is
chosen as the interface IP isn't the non-virtual IP but is chosen at
random from the set of IPs on that interface.  This wouldn't be a
problem except that the VIPs move around from host to host, breaking
the resulting MRTG graphs.

I dug through the code for cfgmaker and the problem is that the IP is
chosen from the %confcache hash, which scrambles the order in which
they were returned by SNMP.  On our hosts the first IP returned for a
given interface instance seems to correspond to the non-virtual IP.

Unfortunately, in order to correct the problem some potentially
invasive changes would need to be made to MRTG_lib.pm.

I suggest adding a key to the %confcache hash which stores the first
IP returned for each interface (e.g.
%confcache{hostinfo}{'FirstIp'}{<interface instance>} = <ip address>) 
The cfgmaker script could then use this as the interface IP instead of
taking the last one returned from the %confcache iteration.

What do you all think?  Is there a better/easier way?

  -- Steve

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the mrtg mailing list