Simple Network Management Protocol (SNMP) is an Internet-standard protocol for managing devices on IP networks. net-snmp is the main SNMP implementation for Linux and BSD platforms. On Ubuntu or Debian net-snmp tools are installed as follows:

$ sudo apt-get install snmp

You can also install snmpd package. This package contains the SNMP agent.

Installing MIBs

For licensing reasons, net-snmp package installs only a small number of MIBs in /usr/share/mibs directory. A large number of standard MIBs can be installed using snmp-mibs-downloader package:

$ sudo apt-get install snmp-mibs-downloader $ sudo download-mibs

To have the new MIBs recognized by net-snmp, edit /etc/snmp/snmp.conf file as follows:

$ cat /etc/snmp/snmp.conf mibs +ALL $

You can use snmptranslate to check the MIBs have been properly installed by printing the MIB tree:

$ snmptranslate -Tp +--iso(1) | +--org(3) | +--dod(6) | +--internet(1) | +--directory(1) | +--mgmt(2) | | | +--mib-2(1) | | | +--system(1) | | | | | +-- -R-- String sysDescr(1) | | | Textual Convention: DisplayString | | | Size: 0..255 ...

Adding additional MIBs

To install additional MIBs you would need to create first a local ~/.snmp/mibs directory:

$ cd ~ $ mkdir -p .snmp/mibs

Drop any additional MIB files you might have in this directory. To install CISCO MIBs, download v2.tar.gz file from ftp://ftp.cisco.com (the file is located in pub/mibs/v2/), and move all the *.my files in the archive in ~/.snmp/mibs directory.

Installing a MIB browser

qtmib is a MIB browser program, that allows you to connect to any SNMP-enabled device and browse the MIBs. The graphical user interface is build using QT4 library. The program comes with a large number of MIBs pre-installed, anything from Cisco’s and Juniper’s to HP’s and Dell’s. You can also install your own MIBs by copying them into ~/.config/qtmib/mibs directory.

For Ubuntu users, the development team makes available a deb package. Download and install it as:

$ sudo dpkg -i qmib_X.Y.Z_1_amd64.ubuntu.deb

Start the program from the command line as qtmib or from your desktop environment menus. Once started, go into File/Preferences and configure the IP address and community string. Retrieve the data from your device, and click Translate to translate the OIDs in the result window.

Related Posts