Section 14.1. SNMP4J


14.1. SNMP4J

The 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:

[*] HP no longer develops or supports SNMP++. Frank Fock and Jochen Katz have taken SNMP++ and added SNMPv3 support. See http://www.agentpp.com for details.

  • SNMPv3 with MD5 and SHA authentication and DES and AES 128, AES 192, and AES 256 privacy.

  • Pluggable Message Processing Models with implementations for MPv1, MPv2c, and MPv3.

  • All PDU types.

  • Pluggable transport mappings. UDP and TCP are supported out of the box.

  • Pluggable timeout model.

  • Synchronous and asynchronous requests.

  • Command generator as well as command responder support.

  • Java 1.4.1 or later.

  • Logging based on Log4J but supports other logging APIs like Java 1.4 Logging.

  • Row-based efficient asynchronous table retrieval with GETBULK.

  • Multithreading support.

  • JUnit tests (coming in release 2.0).

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.




Essential SNMP
Essential SNMP, Second Edition
ISBN: 0596008406
EAN: 2147483647
Year: 2003
Pages: 165

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net