All Apps and Add-ons

How to install build-pysmp-mib in Windows Server 2008 to create Python EGG for custom MIB

cpt12tech
Contributor

I'm having problems creating a cusom MIB egg in Windows Server 2008.

I'm trying to install build-pysnmp-mib. I see the download but don't know how to install on Windows.
I've seen reference on the web that it's as easy as

pip install pysnmp

I just don't know where to run the command from in CMD. When I type python in CMD I get the message:
'python' is not recognized as an internal or external command.
Have tried running this from the ...\Splunk\Python-2.7 directory.

Do I need to install Python outside of splunk?

An easier solution might be to create the .egg from a Mac as the Python command works in the terminal. However, there's probably other Windows users out there having the same problem.

Tags (1)
0 Karma
1 Solution

cpt12tech
Contributor

I've been able to install the python modules to convert the MIBs to python using a Mac / *nix. Still having problems getting this working, however... this site will allow you to upload a MIB and run the smidump command on their server!

https://www.ibr.cs.tu-bs.de/bin/smitools.cgi

It will show you the command that was run, and is running on the latest smidump.
Example:

command listed on the webpage:

Your request has been processed by the command
timeout 10 smidump -k -f python mibs/MIRANDA-MIB.mib>MIRANDA-MIB.mib.python 2>report.txt  

You can access any intermediately created files, the processing report (which might be empty if no errors or warnings have been found), and output files (in case of a conversion request) for reading and download from a temporary server directory for approx. 24 hours.

# python version 1.0                        DO NOT EDIT
#
# Generated by smidump version 0.4.8:
#
#   smidump -f python MIRANDA-MIB

There is a link where you can download the output file. Then rename the file so that it has a .py extension.

I've had other issues and found a splunk answer that MIB need to be converted to SMIV2
https://answers.splunk.com/answers/220242/snmp-modular-input-why-am-i-getting-an-error-with.html
and this website can do the conversion.

Great tool to have if you are on windows and having problems getting smidump or build-pysnmp-mib to run.

You can get this to work in windows by installing the Splunk App for SNMP Modular Input. That will get the traps into splunk. If you have custom MIBs, upload to this site, convert to python, move into the MIB folder in the splunk server instance and add in the Data Inputs in the splunk settings.

View solution in original post

0 Karma

cpt12tech
Contributor

I've been able to install the python modules to convert the MIBs to python using a Mac / *nix. Still having problems getting this working, however... this site will allow you to upload a MIB and run the smidump command on their server!

https://www.ibr.cs.tu-bs.de/bin/smitools.cgi

It will show you the command that was run, and is running on the latest smidump.
Example:

command listed on the webpage:

Your request has been processed by the command
timeout 10 smidump -k -f python mibs/MIRANDA-MIB.mib>MIRANDA-MIB.mib.python 2>report.txt  

You can access any intermediately created files, the processing report (which might be empty if no errors or warnings have been found), and output files (in case of a conversion request) for reading and download from a temporary server directory for approx. 24 hours.

# python version 1.0                        DO NOT EDIT
#
# Generated by smidump version 0.4.8:
#
#   smidump -f python MIRANDA-MIB

There is a link where you can download the output file. Then rename the file so that it has a .py extension.

I've had other issues and found a splunk answer that MIB need to be converted to SMIV2
https://answers.splunk.com/answers/220242/snmp-modular-input-why-am-i-getting-an-error-with.html
and this website can do the conversion.

Great tool to have if you are on windows and having problems getting smidump or build-pysnmp-mib to run.

You can get this to work in windows by installing the Splunk App for SNMP Modular Input. That will get the traps into splunk. If you have custom MIBs, upload to this site, convert to python, move into the MIB folder in the splunk server instance and add in the Data Inputs in the splunk settings.

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...