[mrtg] MRTG not honouring mib file

Daniel McDonald dan.mcdonald at austinenergy.com
Wed Oct 6 15:24:15 CEST 2010




On 10/6/10 5:00 AM, "Babu  C" <babscontact at rediffmail.com> wrote:

> Hi List,
>  As I suspect my issue is something to do with mrtg I am posting it
> here, I have upgraded the squid box to 3.1.8 and everything is working
> fine except the graph part with mrtg.
>  
>  LoadMIBs: /usr/local/etc/mrtg/squid.mib
>  EnableIPv6: no
>  WorkDir: /usr/local/www/apache22/data
>  Options[_]: bits,growright
>  
>  2010-10-04 12:37:33 -- Unknown SNMP var cacheHttpHits
>  at /usr/local/bin/mrtg line 2242
>  
>  All I could make out from these error was mrtg not reading squid.mib
> file. Am I right?

Yes, the mib parser doesn't know what to do with IMPORTS.  You need to
manually track down the dependencies and add them to your LoadMibs line, in
the proper order.

For example, my LoadMibs statement is a single line (excuse the
word-wrapping here) that reads as:
LoadMibs: /usr/share/snmp/mibs/CISCO-SMI-V1SMI.my
/usr/share/snmp/mibs/CISCO-TC-V1SMI.my
/usr/share/snmp/mibs/CISCO-PROCESS-MIB.my
/usr/share/snmp/mibs/CISCO-QOS-PIB-MIB-V1SMI.my
/usr/share/snmp/mibs/CISCO-MEMORY-POOL-MIB-V1SMI.my
/usr/share/snmp/mibs/sa.mib /usr/share/snmp/mibs/sh2.mib
/usr/share/snmp/mibs/ups.mib /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt
/usr/share/snmp/mibs/CISCO-FIREWALL-MIB-V1SMI.my
/usr/share/snmp/mibs/ETHERLIKE-MIB-V1SMI.my /usr/share/snmp/mibs/apent.mib
/usr/share/snmp/mibs/chassismgrext.mib /usr/share/snmp/mibs/cntsvcext.mib
/usr/share/snmp/mibs/stratum100.mib /usr/share/snmp/mibs/qb.mib
/usr/share/snmp/mibs/OLD-CISCO-INTERFACES-MIB.my
/usr/share/snmp/mibs/itw_mib.mib /usr/share/snmp/mibs/orinoco.mib
/usr/share/snmp/mibs/ENTITY-MIB-V1SMI.my
/usr/share/snmp/mibs/CISCO-ENHANCED-MEMPOOL-MIB-V1SMI.my
/usr/share/snmp/mibs/CISCO-VOICE-COMMON-DIAL-CONTROL-MIB-V1SMI.my
/usr/share/snmp/mibs/CISCO-CCM-MIB.my
/usr/share/snmp/mibs/CISCO-ENTITY-FRU-CONTROL-MIB.my
/usr/share/snmp/mibs/POWER-ETHERNET-MIB-V1SMI.my
/usr/share/snmp/mibs/LIEBERT_GP_REG.MIB
/usr/share/snmp/mibs/LIEBERT_GP_POWER.MIB
/usr/share/snmp/mibs/ENTITY-SENSOR-MIB-V1SMI.my
/usr/share/snmp/mibs/CISCO-ENTITY-SENSOR-MIB-V1SMI.my
/usr/share/snmp/mibs/CISCO-SLB-MIB.my
/usr/share/snmp/mibs/CISCO-ENHANCED-SLB-MIB.my
/usr/share/snmp/mibs/EES-power.mib

To trck this down, look in the squid.mib file for the IMPORTS section.  This
example from the CISCO-PROCESS-MIB (3rd file in my LoadMibs statement) might
be helpful:
IMPORTS
    MODULE-IDENTITY,
    OBJECT-TYPE,
    Counter32,
    Gauge32,
    Unsigned32,
    NOTIFICATION-TYPE
        FROM SNMPv2-SMI
    MODULE-COMPLIANCE,
    OBJECT-GROUP,
    NOTIFICATION-GROUP
        FROM SNMPv2-CONF
    TimeStamp,
    DisplayString,
    RowStatus,
    TruthValue,
    RowPointer
        FROM SNMPv2-TC
    SnmpAdminString
        FROM SNMP-FRAMEWORK-MIB
    EntPhysicalIndexOrZero
        FROM CISCO-TC
    ciscoMgmt
        FROM CISCO-SMI;

So, I needed to load the CISCO-SMI and the CISCO-TC in order to have the
proper entities defined to read the CISCO-PROCESS-MIB.  The parser does
contain most of the SNMPv2-SMI and SNMPv2-TC entities baked in, so you don't
have to go find those.

The netSNMP toolset does know to look in the mib directory for the IMPORTS,
and will follow the chain automatically.  That's why snmpwalk works fine,
and MRTG is confused.

Note also that LoadMibs is a global configuration command, and that only the
last one in the config file is used.



More information about the mrtg mailing list