Opsview Knowledge Center

MIBs for SNMP Traps and Gets

An introduction to working with MIBs for SNMP Traps and Gets

SNMP Get requests (or polling) and SNMP Traps communicate data using numeric OIDs (Object IDentifiers). The OIDs are translated from numbers into textual strings and back into numbers using MIBs (Management Information Bases). In Opsview, MIBs are used in the following ways:

  • Translating the numeric OIDs into their textual form for easier reading in the Opsview web UI
  • Translating the textual OIDs entered in the Opsview web UI into their numeric OID form for plugin execution without the need for MIBs on every executor
  • Evaluating trap rules when a trap is received by a trap collector

Manufacturers have to conform to a set of standards for OIDs to work correctly - as a result, common SNMP OIDs should be translated on your Opsview Collector without any extra configuration.

However, many SNMP capable devices have specific attributes that are unique to them and as such may need additional MIBs installed on the Opsview Monitor systems to be able to translate the OIDs.

Some of these additional MIBs may be available through your normal package repository (for example, for Debian and Ubuntu) on each Opsview Monitor server. Other MIBs will need to be obtained from your device manufacturer and installed onto each of the Opsview Monitor servers.

In order to add MIBs to Opsview, you need to first know what the MIB will be used for:

  • If the MIB is to be used for translating incoming traps then it needs to exist on every trap collector
  • If the MIB is to be used for any other purpose such as polling then it only needs to exist on just the master

For translation of incoming traps on trap collectors, place your MIB in one of the appropriate directories on all servers responsible for monitoring the traps (including the master server). The directories for this purpose are:

  • /opt/opsview/snmptraps/var/load
  • /usr/share/mibs
  • /usr/share/snmp/mibs

For translation on the master, place your MIB in the appropriate directory for your distribution:

  • /usr/share/mibs
  • /usr/share/snmp/mibs
  • custom location (see below)

On the master you can define a custom location for your MIBs, to do so place the MIB files into a directory e.g. /opt/opsview/var/snmp and amend your /etc/snmp/snmp.conf file to include lines similar to:

mibdirs +/opt/opsview/var/snmp
mibs +ALL

This will naturally add the directory to the MIB search path that your command-line SNMP utilities use. You could also add the path to your trap MIBs in /opt/opsview/snmptraps/var/load in order to test sending those traps from the command-line

You can see which directories are currently used on your Opsview Monitor system by using a command similar to

snmpget -v2c -D get_mib_directory -c <community string> <hostname> SNMPv2-MIB::sysDescr.0