[mrtg] Can not determine ifNumber and duplicate entries of IP-Ifindex at the .ok files

Steve Shipway s.shipway at auckland.ac.nz
Tue Feb 1 23:16:45 CET 2011

Marinos said:
> Yes, I have deleted several times the .ok files, in the next run mrtg
> creates them again but after a while the errors start again and the .ok
> files contain the duplicate entries.

This is odd; are these devices in some way dynamic, reconfiguring on a regular basic?  You might need to use a different way to identify the network interfaces if IP address is not resulting in meaningful data.  Also, try using SNMPv2 and see if this gives a better result (have a :2 on the end of the Target definition where you currently have a :1)

There is no official way to tell MRTG to NOT cache the interface index table; so we need to find a different way to specify the interface.  If all else fails you can use the interface number although this might produce invalid graphs if the device is reconfiguring numbers at a regular time.

An unsupported hack that might work is to change the .ok file ownership to root, and set permissions to 0 (no read permission for anyone) and then empty the file -- this SHOULD mean that MRTG is forced to re-query the interface details every pass, but cannot write to the .ok file to cache them.  However it may also result in a few error messages :(, and it will of course not work if you are running MRTG as root (but you're not doing that, are you? :)


Steve Shipway
ITS Unix Services Design Lead
University of Auckland, New Zealand
Floor 1, 58 Symonds Street, Auckland
Phone: +64 (0)9 3737599 ext 86487
DDI: +64 (0)9 924 6487
Mobile: +64 (0)21 753 189
Email: s.shipway at auckland.ac.nz
 Please consider the environment before printing this e-mail 

More information about the mrtg mailing list