<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Greetings.<br>
    This may be an old bug - hard to say with the trac access sealed in
    the web site - but it's happened to me plenty and recently<font
      face="sans-serif">, and the 'net is quiet about it.<br>
      Hopefully this'll help some poor schmuck</font>
    <br>
    <br>
    I have seen that in the above (subject) mentioned conditions it may
    happen that a <br>
    clean configuration file starts acting up by spewing&nbsp; <br>
    <pre><font face="sans-serif">Unknown SNMP Variable

errors.

Others have met this as well.: see <a class="moz-txt-link-freetext" href="https://lists.oetiker.ch/pipermail/mrtg/2011-March/036481.html">https://lists.oetiker.ch/pipermail/mrtg/2011-March/036481.html</a>)

As explained in the link, the apparent cause of the error is a missing /var/lib/mrtg/oid-mib-cache.txt file 
that should be automatically created and populated with name-to-oid translations loaded from the LoadMib specified files
(but isn't). One unpleasant solution is creating the file by hand.

The root cause I found for this is as follows.
The mrtg distro apparently ships with two similarly named files:

</font><tt>Net_SNMP_util</tt><tt>.pm</tt><tt>

</tt><font face="sans-serif">and 
</font><tt>
SNMP_util.pm</tt><tt>
</tt><font face="sans-serif">
They are different but contain similarly named functions and it turns out that MRTG mixes up calls between the two. 
In this particular case, when parsing the cfg file MRTG_lib.pm calls (line 681):

snmpQueue_MIB_File($mibFile)

stepping through in the debugger, it is possible to see that this is 
</font></pre>
    <tt><br>
      Net_SNMP_util::snmpQueue_MIB_File</tt>
    <br>
    <br>
    <pre><font face="sans-serif">the name-to-oid translation, however, is made through SNMP_utils::toOID function. This does not know about the MIB files (they have been 
queued in the wrong module, above) and so it breaks.
Replacing;

</font>
<font face="sans-serif"><font face="sans-serif">snmpQueue_MIB_File($mibFile)
</font>

with 
 
SNMP_util::</font><font face="sans-serif"><font face="sans-serif">snmpQueue_MIB_File($mibFile)</font></font>
<font face="sans-serif">
Makes all the error go away. The reason of the mixup or of the presence of two SNMP libraries, I cannot fathom. I'd bet that one OR the other should be present 
and that shipping both causes the snafu, but that's me. Maybe removing one or the other fixes everything as well - or it may make it worse - I did not try that.

Cheers,
alf
</font>


</pre>
    <br>
    <pre class="moz-signature" cols="72">






-- 
Alessandro Forghieri
Nouvelle s.r.l.
via Giardini 456/C 41124 Modena  (ITALY)
tel. +39 059 2929338 - Fax +39 059 347606
</pre>
  </body>
</html>