Java Reference
In-Depth Information
A network management system (
NMS
) sends information to and listens for infor-
mation from agents.
SNMP
provides capabilities for the
NMS
to communicate with the managed
device. The
SNMP
API
has two commands:
read
and
write
. The
read
command is
sent to the agent in order to get information about the current state of a man-
aged device. The
write
command is used to set the state on the managed device.
Likewise, the managed device can signal the
NMS
that something interesting has
occurred by sending an
SNMP
trap
. A trap is the
SNMP
equivalent of a
JMX
noti-
fication.
Recall from chapter 1 that information about managed devices is stored in a
Management Information Base (
MIB
). The
MIB
is a hierarchical representation
of information about devices. A managed device can be located on a
MIB
tree
using an object name or object identifier—for example, organization.dod.enter-
prise.myenterprise.variables.theProduct. An object identifier is a set of numbers
that translates to the textual name. (For more information about
MIB
s, read the
SNMP
specifications at http://www.ietf.org.)
Due to incompatibilities between machines on the Internet, data must be
exchanged using a neutral representation. A standard called Abstract Syntax
Notation One (
ASN
.
1
) was developed to enable this exchange. Using this notation,
people created rules for defining the management information called the
Struc-
ture of Management Information (SMI).
SMI
defines simple types such as integers,
octet strings, and object ids. It also defines application data types such as network
addresses, counters, gauges, time ticks, opaques, integers, and unsigned integers.
9.4.2
Using an SNMP protocol adapter
As with any protocol or transport technology, the flexible
JMX
architecture
enables agents to communicate with
SNMP
management applications. An
SNMP
adapter translates data from an MBean to an
SNMP
MIB
and uses the
SNMP
pro-
tocol to transport the information to interested listeners.
Sun Microsystems provides an implementation of an
SNMP
adapter with a
tool suite included with the
JDMK
. The toolkit provides the capability to develop
a
JMX
agent using an
SNMP
protocol adapter. Using a tool called mibgen, you
can generate MBeans that represent
SNMP
MIB
s. The mibgen tool creates Java
objects for you using your existing
MIB
definitions. There is even a toolkit to
build an
NMS
using a management
API
.
The
SNMP
protocol adapter can work with
SNMP
v1 and
SNMP
v2 protocols.
As the protocol adapter receives requests from the
SNMP
system, it maps the