14.1. SNMP4JThe SNMP API presented in this chapter is SNMP4J. The current version is 1.5 and it works with Java 1.4.1 or later. It is released for free under the Apache software license. You can obtain a copy of SNMP4J from http://www.snmp4j.org. The library's design is patterned after the successful SNMP++ C++ library whose early versions were developed by HP.[*] Because of its roots, SNMP4J has a clean and easy-to-use API. SNMP4J's features include:
SNMP4J has a built-in thread pool model. This means that you can specify the number of threads that respond to and process incoming requests, making your SNMP applications highly efficient. At this writing, the maintainers of SNMP4J have released an SNMP agent API based on SNMP4J. It is currently in the early alpha stage, so we will not discuss it in this chapter. But for those of you who are interested, keep an eye on the SNMP4J web site to track its development. A detailed discussion of SNMP4J's API is beyond the scope of this chapter. Instead, we present examples of how to use the library to perform various SNMP operations. You will see that creating SNMP applications is quite easy and requires minimal programming. As a result, you don't have to think as much about using the API and can focus more on creating useful applications that solve whatever problems you face. Example source code is provided on this book's web site, at http://www.oreilly.com/catalog/esnmp2/. The example sources were built using a command-line tool that is available as a separate download from the SNMP4J web site. Each section in this chapter discusses pertinent aspects of the SNMP operation it is implementing as it pertains to SNMP4J. |