6

I want to play around with snmp traps on my computer, but need the MIB list for that (I guess). So where can I find it on a Ubuntu 12.04 system?

1
  • 1
    Can you be more specific, what are you referring to when you say "the MIB list for that"? Which packages pertaining to SNMP have you installed so far, did you run the mib downloader?
    – tink
    Feb 4, 2013 at 19:45

1 Answer 1

12

First, as explained here, set up SNMP on your Ubuntu 12.04 computer:

  1. Install the SNMP packages:

    $ sudo apt-get install snmpd
    $ sudo apt-get install snmp
    
  2. Download the MIB files with this command:

    $ sudo apt-get install snmp-mibs-downloader
    (...)
    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.
    (...)
    
  3. Comment out mibs: in /etc/snmp/snmp.conf like this:

    # As the snmp packages come without MIB files due to license reasons, loading
    # of MIBs is disabled by default. If you added the MIBs you can reenable
    # loaging them by commenting out the following line.
    #mibs:
    
  4. Restart snmpd:

    $ sudo /etc/init.d/snmpd restart
    

Now you can query your local SNMP daemon:

$ snmpwalk -mALL -v1 -cpublic localhost system 2>/dev/null
SNMPv2-MIB::sysDescr.0 = STRING: Linux ubuntu 3.2.0-37-generic #58-Ubuntu SMP Thu Jan 24 15:28:57 UTC 2013 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-TC::linux
DISMAN-EXPRESSION-MIB::sysUpTimeInstance = Timeticks: (54813) 0:09:08.13
SNMPv2-MIB::sysContact.0 = STRING: Me <[email protected]>
SNMPv2-MIB::sysName.0 = STRING: ubuntu
(...)

system in snmpwalk above is an object identifier (OID), that is, a unique name that identifies a variable that can be queried via SNMP. OIDs are organized hierarchically, and in this case snmpwalk shows all variables found in the subtree under system.

For an list of Linux OIDs that you can use to test SNMP visit http://www.debianadmin.com/linux-snmp-oids-for-cpumemory-and-disk-statistics.html.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .