Loading Custom Vendor MIBs into the SNMP Modular Input

The SNMP Modular Input ships by default with all the core SNMP MIBs.

However if you want to use Custom Vendor MIBs then you have to convert them into Python modules yourself.

Don’t worry , it is actually pretty easy if you follow these steps accurately.

  1. Locate your custom vendor MIB file(s) , for this example lets say it is called FOOBAR-MIB.txt
  2. On a Nix variant operating system we are going to run a command to convert the MIB file into a Python module
  3. Install the smidump command , for example on Ubuntu Linux it might be done with : sudo apt-get install smitools
  4. Install the libsmi2pysnmp script , you can just grab it from Github
  5. The smidump command can be configured in /etc/smi.conf
  6. In this file you will see a section for paths to MIB files
  7. Put your FOOBAR-MIB.txt file in one of these path directorys
  8. MIB files also have dependencies to resolve, you can view these at the top of the MIB file in the imports section
  9. A quick shortcut to dealing with dependencies is to just grab all these MIB files here
  10. And then put them in one of your /etc/smi.conf path directories also
  11. Now you are ready to run the command
    1. smidump -f python FOOBAR-MIB | libsmi2pysnmp > FOOBAR-MIB.py
  12. Take the resulting python module (FOOBAR-MIB.py) and copy it to $SPLUNK_HOME/etc/apps/snmp_ta/bin/mibs
  13. There is no need to bundle up your Python modules into an Egg , you can if you want , but it is perfectly fine just to copy the plain Python files
  14. When you configure your SNMP input , simply declare your MIB(s) to be loaded

Please follow and like us:

Author: Damien Dallimore

After the better part of a decade working at Splunk as Worldwide Developer Evangelist, Damien's accumulated body of work has been extensively downloaded and installed in Splunk customer production environments globally, in fact, he is the most downloaded and production installed individual developer in the history of Splunk and many of his creations have become de facto standards in their respective domains, spanning public and private sector customers and all verticals that Splunk touches.He has presented to Splunk developers on the global stage at all sizes of Splunk and Industry developer events and been a trailblazer for countless other Splunk Apps, Tools, SDKS, Frameworks and Developer Initiatives.Damien founded BaboonBones and personally oversees all of the team's development and support.