etingof / pysnmp

Python SNMP library
http://snmplabs.com/pysnmp/
BSD 2-Clause "Simplified" License
576 stars 194 forks source link

build-pysnmp-mib #61

Closed glaslos closed 7 years ago

glaslos commented 7 years ago

What happened to that script and where can I find it? I use it to import mib files into pysnmp

etingof commented 7 years ago

The script (along with the smidump tool it relies on) is superseded by the pure-python pysmi MIB compiler.

If you upgrade to a reasonably resent pysnmp, it will pull in the pysmi as a dependency and call it behind the scenes to resolve MIB names. That should work fully automatically so you might not need manual MIB compilation anymore.

But you can still turn any MIB into pysnmp module by hand with the mibdump.py tool which is shipped along with pysmi. Just pip install pysmi and run mibdump.py.

glaslos commented 7 years ago

Thanks for the quick feedback. Here is what we used to do: https://github.com/mushorg/conpot/blob/master/conpot/protocols/snmp/build_pysnmp_mib_wrapper.py I will see how we can change that to use the new features.

etingof commented 7 years ago

So if your goal is to just compile MIBs (and dependencies) into pysnmp, take a look at this example. It should fully replace the libsmi-based approach plus it might work way more reliable and accurate plus it could pull ASN.1 MIBs from multiple locations, including HTTP/FTP servers.

There is also some documentation on the package.