Skip to content

Loading_your_own_MIBs

Bill Fenner edited this page Aug 30, 2018 · 1 revision

Question

I've created my own MIB, placed it in /usr/share/snmp/mibs (which is where I believe it should go) but yet and the other tools fail to find it.

Answer

It is highly likely that one of the following issues is you problem:

Simple understanding of the MIB loading process is needed

There is a good tutorial on loading MIBs into the tools. Please make sure you read the page too.

A broken MIB

If you have a syntax error in your MIB file, even if you do everything else right snmptranslate and related tools will still fail to find it.

A good thing to do always before trying to use your MIB is run it through a syntax checker. The best freely-available syntax checker out there is probably smilint from the libsmi package.

Before you do anything else with your mib, install libsmi and run smilint on your MIB

Incorrect paths

It is also possible that your MIB loading paths are incorrect. You can always add the -M flag to your tool to make sure your directory is being searched:

 snmptranslate -M +/my/path/to/my/mibs

Debugging what is actually going on will help too (see below)

Proper MIB Node Naming

The best test you could do to try and load you mib is using your MIB name and the mib node name in combination. This is the safest loading test:

 snmptranslate MY-NAMED-MIB::myMibNodeName

MIB loading debugging

When all else fails, be prepared to examine the dump details for exactly what might be going wrong as it loads the MIBs. To do this (which requires net-snmp was build with the debugging output left in place) use the -Dparse flag:

 snmptranslate -Dparse MY-NAMED-MIB::myMibNodeName

warning: lots of (useful) data will be printed

Category:MIBs

Clone this wiki locally