All Apps and Add-ons

Adding Custom MIBs

nandipatisunil
Path Finder

Any updates on this

"This is all just an interim measure until pysnmp supports plain text MIB files, a development feature in the pipeline for pysnmp. When that feature is ready , all you will have to do is drop the plain text MIB in the SPLUNK_HOME/etc/apps/snmp_ta/bin/mibs and the SNMP Modular Input will do the rest. Watch this space !"

I am having a rough time converting my custom MIBs to Py and adding them to the egg.
I am using Windows 7. As per the documentation it says i need to have pysnmp to get the utility to convert it. Is there a way around?

1 Solution

MartinMcNutt
Communicator

As a windows person, this was a very painful process for me. I was able to use the smidump from Here to compile the Mib into a python file.

Example:
smidump -f python SYMANTEC-EMAIL-SECURITY.MIB >SYMANTEC-EMAIL-SECURITY.MIB.PY




another Example from nandipatisunil's comments: 
smidump -f python -p <path to="" load_mib_module=""> -p <path to="" load="" another="" mib="" module=""> mymibfile.mib > mymibfile.py

View solution in original post

Damien_Dallimor
Ultra Champion

General note : as soon as the underlying library (pysnmp) supports plain text MIBS , a work item in the project pipeline , then this need to convert 3rd party MIBs to python modules will go away. You'll just drop in your plain text MIB files and SNMP Mod Input will automatically pick them up and load them in.

Damien_Dallimor
Ultra Champion

As per the documentation , currently 3rd party MIBs need to be converted to Python modules and dropped in snmp_ta/bin/mibs. In the future you'll be able to bypass this conversion step and just drop in the plain text MIB file.

0 Karma

saurabhkunte
Path Finder

Hello,

Is this still a requirement ? Also, some of the custom MIBs i want to import are with .txt extension. Please let me know. Thanks.

0 Karma

nandipatisunil
Path Finder

Hi Damien, So does that mean currently it does not work if i drop the MIB in the location?

0 Karma

MartinMcNutt
Communicator

As a windows person, this was a very painful process for me. I was able to use the smidump from Here to compile the Mib into a python file.

Example:
smidump -f python SYMANTEC-EMAIL-SECURITY.MIB >SYMANTEC-EMAIL-SECURITY.MIB.PY




another Example from nandipatisunil's comments: 
smidump -f python -p <path to="" load_mib_module=""> -p <path to="" load="" another="" mib="" module=""> mymibfile.mib > mymibfile.py

nandipatisunil
Path Finder

Thanks Martin. I threw the .py file in the mibs folder. I mentioned my MIB name in the MIB names column in my SNMP data input settings. I was expecting the trap data i am receiving on my 162 port to be decrypted to more key value pairs using the definitions in my custom MIB. however i am still seeing most of the data is still sitting in the message and not getting converted to more keys. Am i missing something more?

0 Karma

MartinMcNutt
Communicator

No need for the egg. Just throw the .py file in the mibs folder and you are ready to go. The latest version removed the *.egg requirement.

0 Karma

nandipatisunil
Path Finder

finally i did something like this and was able to create the .py file

smidump -f python -p -p mymibfile.mib > mymibfile.py

Now figuring out a way to 'egg' up.

0 Karma

nandipatisunil
Path Finder

I tried copying the MIBs into the bin folder as suggested, i also created a environment variable SMIPATH to point to my mibs folder where i had the SNMPV2-SMI, RFC1155-SMI, etc.

But I still am getting the same error messages.

0 Karma

MartinMcNutt
Communicator

When I was working with the Brightmail gateways, I placed all the mibs on the page (about 4-5 of them) and placed them into the BIN folder.

When I executed the smidump, I didnt have any trouble.

If this works for you too...let me know and I will update my answer to reflect these changes.

BTW: Are you able to place a windows Tag on this?

0 Karma

nandipatisunil
Path Finder

I downloaded the smidump from suggested link above. When trying to run the command

smidump -f python alarms.mib >alarms.mib.py

getting the following errors

alarms.mib:5: failed to locate MIB module SNMPv2-SMI'
alarms.mib:7: failed to locate MIB module
RFC1155-SMI'
alarms.mib:9: failed to locate MIB module RFC-1212'
alarms.mib:11: failed to locate MIB module
RFC-1215'
alarms.mib:1012: unknown type IpAddress'
...
alarms.mib:14: unknown object identifier label
enterprises'
smidump: module `alarms.mib' contains errors, expect flawed output

I can see all the MIBs at ..\smi\mibs\ietf.

0 Karma

MartinMcNutt
Communicator

32bit / 64bit is not an issue as this util is simply converting the MIB into a python supported file. You will use the utility for 1 second and never use it again unless the MIBs get update. So make sure you make note of it.

Once you have the converted MIB you drop it into the MIB folder and configure the data input. When enter the MIB name you have to drop the .py extention.

Splunk will run python in the background to pull the information.

nandipatisunil
Path Finder

does this support windows 64 bit?

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...