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?
First, as explained here, set up SNMP on your Ubuntu 12.04 computer:
Install the SNMP packages:
$ sudo apt-get install snmpd $ sudo apt-get install snmp
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. (...)
# 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:
$ 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 <firstname.lastname@example.org> SNMPv2-MIB::sysName.0 = STRING: ubuntu (...)
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.