Posts Tagged snmp api

Over many years we used the open source project Westhawk’s lightweight SNMP stack for this service. But over the years, the requests to our power switches were constantly growing. Depending on that, we got more and more problems with Westhawks SNMP stack. It hungs from time to time not traceable, which leads to the conclusion that threads weren’t be finished clearly when exceptions were thrown. IPv6 gets more important and it is not officially supported by this library. In fact it seems the project is dead. The last file release was 2009. So we decided to kick it.

Looking around for a better open source alternative I’ve found SNMP4J. The documentation promised what I was looking for. But after I tried to write some testing codes for our power switches, I’ve figured out, that it does not deliver what it promises. The supplied examples didn’t work as expected. E.g. the request of multiple ports of one switch needs very long or it doesn’t work at all for SNMPv1, simple SET and PUT commands didn’t work for SNMPv1 and other things. I lost more than an entire day, – made my day, you know!

My last chance was to take a commercial SNMP API. One of my favorites I’ve found is outstanding in terms of documentation, example code and last but not least the structure of the API! The Java SNMP API off ireasoning. All examples are running out-of-the-box and they are well documented. I was able to build a test code for our power switch environment in less than 30 minutes! Pure tech porn!

First of all: The ‘power switch service’, where the library does its’ job, has been running as expected since weeks.
The source code above demonstrates the easy handling of the API.

Beware! The code isn’t executable. The error handling has to be implemented!