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.
- Locate your custom vendor MIB file(s) , for this example lets say it is called FOOBAR-MIB.txt
- On a Nix variant operating system we are going to run a command to convert the MIB file into a Python module
- Install the smidump command , for example on Ubuntu Linux it might be done with :
sudo apt-get install smitools
- Install the libsmi2pysnmp script , you can just grab it from Github
- The smidump command can be configured in
- In this file you will see a section for paths to MIB files
- Put your FOOBAR-MIB.txt file in one of these path directorys
- MIB files also have dependencies to resolve, you can view these at the top of the MIB file in the imports section
- A quick shortcut to dealing with dependencies is to just grab all these MIB files here
- And then put them in one of your
/etc/smi.confpath directories also
- Now you are ready to run the command
smidump -f python FOOBAR-MIB | libsmi2pysnmp > FOOBAR-MIB.py
- Take the resulting python module (FOOBAR-MIB.py) and copy it to
- 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
- When you configure your SNMP input , simply declare your MIB(s) to be loaded