15 August
2007
Digg digg it  |  Slashdot slashdot.org  |  Reddit reddit  |  del.icio.us del.icio.us  |  Technorati Technorati

A small (but complete) Python ctypes-based Net-SNMP wrapper module.

Till last week we were using an heavy modified version of the old and unmaintained yapsnmp module to interface the Devil Framework with the cool Net-SNMP library. It was a real PITA to maintain it and to make it work on all the platforms we currently support (Linux, Windows and OS X). So I've begun a search for an alternative and (in examination order) found and discarded (for various reasons) the Python wrapper included into the Net-SNMP library itself, the pysnmp pure Python implementation and the ctypes-based pynetsnmp that comes with Zenoss.

I than decided to write my own version. Trying to avoid the "not invented here" syndrome I've started modifying the work already done by the cool people at Zenoss. It took only a full work day to (re)implement:

I was quite impressed and satisfied till I've tested the code on Windows where I've found that:

After 2 (two !!!) days of C code analysis and (useless) debugging (now I know quite well the network section of the Net-SNMP lib :-) ) I've learned that:

Then was time to test the lib under OS X, but been Unix no problems should occur....WRONG! Under OS X ctypes (or the Net-SNMP lib) does not like to receive a statically nested scope function as a session callback. Anyone can explain this either? A hack was required.

Final notes before the code:

The code can be found at the DLNetSNMP home page.


Category Python 
Posted by alex at 22:58 | Comments (0) | Trackbacks (0)
<< Event Horizon: Devil Framework's event management system | Main | A new version of the DLNetSNMP (Python ctypes wrapper for NetSNMP) >>
Comments
There is no comment.
Trackbacks
Please send trackback to:http://www.dlevel.com/blogs/alex/22/tbping
There is no trackback.