Logo
Home page Net-SNMP

Archive Search:

Require all words?

Site Search:
Google
NET-SNMP Tutorial -- Using local MIBs

NET-SNMP Tutorial -- Using local MIBs

The net-snmp tools can translate numeric object identifies (OIDs) into textual object identifiers using the MIB description files. The net-snmp toolkit provides a few of the standard MIBs, but certainly doesn't contain all the MIBs known to man.

First off, you should know about the paths that the tools load MIBs from. By default, it loads things from the following list of directories:

  1. $HOME/.snmp/mibs
  2. /usr/local/share/snmp/mibs

So, lets say you have a MIB called CISCO-RHINO-MIB that you want parsed (it really exists, and I particularly liked the name so I'm using it in the tutorial). Place the file in one of the above two directories. If you pulled it from another file (like an RFC), make sure it doesn't contain anything non-MIB related (like the text leading up to it, and the page separators). The very first line in the file should begin with something like "CISCO-RHINO-MIB DEFINITIONS ::= BEGIN"

No, pick a node in the file that you want to translate that currently isn't being translated. From the CISCO-RHINO-MIB, I'll pick the ciscoLS1010ChassisFanLed node.

First, lets verify that our handy snmptranslate command (discussed earlier) doesn't yet know about this node:


Nope, it doesn't. So, first we need to download the CISCO-RHINO-MIB.my file and place it in a directory that our snmp tools can find it in. So, I'm going to place the file in $HOME/.snmp/mibs.

Now, lets use the -m flag to snmptranslate to tell it to load that mib. We'll use "-m +CISCO-RHINO-MIB" to indicate that we want the tool to load not only the default set of mibs, but the CISCO-RHINO-MIB as well (the leading '+' plus means "also").

    
  

Wait a minute... What the heck is all that stuff? Errors! Well, the first line is the most important and it's telling us that we're missing the CISCO-SMI MIB as well. So, if we go download that MIB file and place it in our $HOME/.snmp/mibs directory as well the command should suddenly work:

    
  

Success!

One last comment: You can also force loading of a given MIB and its node in one fell swoop (and this method is the one most highly recommended by Niels Baggesen, one of our primary core developers):

    
  

So, there you have it. A complete example for how to get your own insert-spiffy-mib-here loaded into the net-snmp tools.

Yes, but how do I make it happen all the time?

Good question. And of course, we have multiple options for you. We support a number of ways of doing this.

Note to Ethereal users: One of these methods is how you would have to do it for Ethereal since it won't support the -m and -M options discussed above.


Please note the following sections of the FAQ as well:


Valid CSS!


Last modified: Wednesday, 01-Aug-2018 04:41:28 UTC
For questions regarding web content and site functionality, please write to the net-snmp-users mail list.