All Apps and Add-ons

Converting MIB to Python module and creating the EGG.

Path Finder

Can anyone provide more detailed steps? I have a plain text MIB file, PowerNet-MIB.mib. I converted it to PowerNet-MIB.py, using the command: build-pysnmp-mib -o PowerNet-MIB.py PowerNet-MIB.mib. Then I created a python EGG after scouring over the internet. I can't post the link to the site because I don't have enough Karma to include links. But if you include http and www on the front of this:

blog.pythonlibrary.org/2012/07/12/python-101-easy_install-or-how-to-create-eggs/

One thing to note, I had to follow directions to create a package, by creating an empty init.py. Without this file in the directory structure; the EGG did not include my PowerNet-MIB.py. Now I have an EGG and inside of that EGG SOURCES.txt lists: PowerNet-MIB/PowerNet-MIB.py. When I drop the EGG ini /snmp_ta/bin, and then try to use PowerNet-MIB for MIB names in the modular input. I get the following errors in Splunkd.log.

ERROR ExecProcessor - message from "python /Applications/splunk/etc/apps/snmp_ta/bin/snmp.py" pysnmp.smi.error.SmiError: MIB file "PowerNet-MIB.py[co]" not found in search path

Help? I have been looking at this off and on for a week. Is it possible that we can just drop PowerNet-MIB.py files into this app in the future? How am I packaging this up wrong?

Path Finder

I am using the 1.06beta on windows and get this error message when dropping the .py converted mib into the mibs subfolder:

pysnmp.smi.error.SmiError: MIB file "WWP-TRAFFIC-PROFILE-MIB.py[co]" not found in search path

Did I miss a step?

Thanks.

0 Karma

Ultra Champion

You should drop the egg into snmp_ta/bin/mibs

I might add a non egg option in the next release so you can just add a folder into the mibs dropin directory.

0 Karma

Communicator

Hi @mikesaia, were you able to make your customized MIB work? If yes, could you share with me the steps you had take to map your data to the MIB. Thank you.

0 Karma

Ultra Champion

The SNMP Modular Input comes with field extractions for the default "snmp_ta" sourcetype.

0 Karma

Path Finder

My custom MIB works now. Events don't show up anymore descriptive however than this: PowerNet-MIB:.318.1.2.xxxx whatever the mib is. And I've noticed that as well with the standard mibs, they look like this SNMPv2-SMI::enterprises."705.1.5.2.0" = "100" or something. Am I understanding this correctly that the field would then need to be extracted with a regex in props, and you would just use "SNMPv2-SMI::enterprises."705.1.5.2.0"" as the field, and rename it something human readable?

0 Karma

Path Finder

Saw that just now. I'm going to try it out. Thanks

0 Karma

Ultra Champion

OK , I just uploaded a new release , 1.0.5beta.

You can now drop the python files directly in the bin/mibs directory without needing to egg them up.

Ultra Champion

Look at the structure of pysnmp_mibs-0.1.4-py2.7.egg that ships with the SNMP Mod Input.

FYI : going to release a new verison this week that supports plain py files , no need to egg up.

0 Karma

Path Finder

Thanks for the reply Damien. I dropped the egg in that directory and thats the error I'm getting. Am I packaging the egg up wrong? Do I need to use a specific version of Python?

0 Karma