9.1 SNMP Adaptor

 


9.1.1 Overview

9.1.2 Registering SNMP Adaptor

9.1.3 Features Supported by the JMX SNMP Agent


 

9.1.1 Overview

 

The com.adventnet.adaptors.snmp.SnmpAdaptor class from AdventNet acts as a protocol adaptor for SNMP to make the Multi-Protocol agent accessible from the management applications (for e.g., AdventNet MIB Browser) outside the Agent's JVM.

This class itself acts as an MBean for exposing the SNMP Agent configuration parameters which can be viewed and changed through some other protocol adaptors (say RMI/HTTP/IIOP).

 

This class extends the com.adventnet.adaptors.common.AbstractAdaptor which provides the implementation of com.adventnet.adaptors.common. ServiceInfo interface and acts as the SNMP Agent. This class also implements the javax.management.MBeanRegistration interface. Thus the method preRegister(..) in this MBeanRegistration interface allows this adaptor to perform any operations it needs before being registered with the MBeanServer.

 

The SNMP Agent gets actually started only inside the preRegister(..) method at the specified port mentioned in the key "port" of the ObjectName (the name with which this Adaptor gets registered with the MBeanServer) . If the key "port" is absent, then the service(Snmp agent) gets started at the default port 8001.

 

9.1.2 Registering SNMP Adaptor

 

To create a Multi-Protocol agent with SNMP Adaptor support, the adaptor must be registered with the MBean server of the Multi-Protocol agent. This can be done either from the JMX Compiler or using API calls.

 

As the SNMP Adaptor is itself registered as an MBean, its configuration parameters ( e.g. Port number, Authentication ) can also be viewed and changed through other protocol adaptors.

 

Using JMX Compiler UI

On code generation, code is generated to register the SNMP adaptor with the MBean server.

 

Using API

 

To register SNMP Adaptor using API, add the following code to the respective methods as shown below in the agent main file.

      ////import com.adventnet.adaptors.snmp.SnmpAdaptor;////

       

      /* Variables representing the different configurations for different adaptors.*/

      private SnmpAdaptor snmpadaptor = null; private int snmpPort = 8001;

       

      //Registering the Snmp Adaptor in registerAdventNetAdaptors() method

      snmpadaptor = new SnmpAdaptor(snmpPort);
      name = "Adaptors:type=SNMPAdaptor";
      snmpadaptor.setSnmpVersion("V2c");

      server.registerMBean(snmpadaptor, new ObjectName(name));

This SnmpAdaptor just acts as a wrapper class for the AdventNet SnmpAgent api thus ensuring to provide the same stability that has come from the AdventNet model of Agent Toolkit (which supports only SNMP management).

9.1.3 Features supported by the JMX SNMP Agent

 

Various features supported by JMX SNMP Agent through Agent Toolkit's SnmpAdaptor are dealt with in detail in the following topics.

To know more on the features supported by Standalone SNMP Agents please have a look at Building SNMP Agents section.