Install the missing MIB files on Debian Squeeze

       249 words, 2 minutes

I never had issues with MIB files on my OpenBSD boxes but my new Debian 6 (Squeeze) system seem to not have the Management Information Base (MIB) files installed correctly.

I got errors like:

  Cannot find module (SNMP-FRAMEWORK-MIB): At line 9 in /usr/share/mibs/netsnmp/NET-SNMP-AGENT-MIB
  Cannot find module (SNMPv2-SMI): At line 8 in /usr/share/mibs/netsnmp/NET-SNMP-MIB
  Did not find 'enterprises' in module #-1 (/usr/share/mibs/netsnmp/NET-SNMP-MIB)
  Unlinked OID in NET-SNMP-MIB: netSnmp ::= { enterprises 8072 }
  Undefined identifier: enterprises near line 10 of /usr/share/mibs/netsnmp/NET-SNMP-MIB
  Cannot find module (SNMPv2-TC): At line 21 in /usr/share/mibs/netsnmp/NET-SNMP-AGENT-MIB

What’s to be done is to install those files via the APT package manager:

  # sudo apt-get install snmp-mibs-downloader
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  The following extra packages will be installed:
    smistrip
  The following NEW packages will be installed:
    smistrip snmp-mibs-downloader
  (...)
  Setting up smistrip (0.4.8+dfsg2-3) ...
  Setting up snmp-mibs-downloader (1.1) ...
  
  Downloading documents and extracting MIB files.
  This will take some minutes.
  
  In case this process fails, it can always be repeated later by executing
  /usr/bin/download-mibs again.
  
  RFC1155-SMI: 119 lines.
  RFC1213-MIB: 2613 lines.
  NOTE: SMUX: ignored.
  SMUX-MIB: 158 lines.
  CLNS-MIB: 1294 lines.
  RFC1381-MIB: 1007 lines.
  RFC1382-MIB: 2627 lines.
  RFC1414-MIB: 131 lines.
  SNMPv2-PARTY-MIB: 1410 lines.
  SNMPv2-M2M-MIB: 807 lines.
  (...)
  IANA-IPPM-METRICS-REGISTRY-MIB: 650 lines.
  IANA-MAU-MIB: 895 lines.
  IPFIX-SELECTOR-MIB: 167 lines.

The remote SNMP daemon can now be polled properly:

  # snmpwalk -c secret -v 2c synology 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."cputime"'
  NET-SNMP-EXTEND-MIB::nsExtendOutLine."cputime".1 = STRING: us: 35
  NET-SNMP-EXTEND-MIB::nsExtendOutLine."cputime".2 = STRING: sy: 0
  NET-SNMP-EXTEND-MIB::nsExtendOutLine."cputime".3 = STRING: id: 65

Really simple, once you know it.