![]() The sample programs traplistener.py and trapsender.py have no problem talking to each other but if I run traplistener.py waiting for my own SNMP signals I again fail to receive anything. Since I don't know Java and like to mess around with Python, I installed libsnmp via easy_install and tried to get that working. SelectionKey key = (SelectionKey) keyIt.next() ![]() Iterator keyIt = mux.selectedKeys().iterator() Here's what I gather to be the code from the Java program that binds to the socket: DatagramChannel dgChannel1=DatagramChannel.open() ÄgChannel1.socket().bind(new InetSocketAddress(8255)) ÄgChannel1.register(mux,SelectionKey.OP_READ) However, it never reports receiving any SNMP traps, which makes me wonder whether it's really able to read on the socket. I was able to get the Java code to compile on my OS X machine and it runs without any complaints, including none of the exceptions I would expect to be thrown if it was unable to bind to socket 8255. I'd like to either get the Java code running on my development machine or whip up some Python code to do the same. I have been given some Java code that runs on Windows with net-snmp. I need to receive and parse some SNMP traps (messages) and I would appreciate any advice on getting the code I have working on my OS X machine.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |