HOME | PRODUCTS | DOWNLOAD | SALES | SUPPORT | ABOUT US

 
Koshna SNMP JMX Toolkit
Overview
Technical Description
Usage
API Documentation
Download
Purchase

Koshna SNMP JMX Toolkit  Includes JMX(TM) Technology

Configuring the SNMP Adaptor for JMX

A simplified block diagram of the architecture of the SNMP Adaptor is shown below.

SNMP Adaptor

To configure the SNMP Adaptor for JMX.

  • Create the Transport Layers.
  • Create the SNMP Adaptor and associate the transport layers with it.
  • Create the SNMP Protocol Engines for the different SNMP versions(V1, V2c & V3) and associate them with the Dispatcher.(V1 & V2c engines are added by default).
  • Initialize the internal MIBs.
  • Create the Security Module & associate it with the Protocol Engine(only V3 engine supports this).
  • Create the Command Responders for the different SNMP Versions(V1, V2c & V3) and associate them with the Dispatcher. (V1 & V2c responders are added by default).
  • Create the Access Control Modules and associate them with the Command Responders as needed ( Currently there are implementations for Community based access control and View based access control with the later giving more fine grained control).
  • Create the Mbeans & register them with the MBean Server.
  • Create the SnmpInfoMap Object to procide the SNMP protocol mapping information of the MBeans & Notifications & associate it with the Adaptor.
  • Associate the Adaptor with the MBean Server,
  • Start the Adaptor

For example, here is some sample code:

...

//Create the Adaptor (use the default initialization of transport layer ...).

SnmpAdaptor snmpAdaptor = new SnmpAdaptor(".\\config\\snmp.conf");

// Create Protocol Engines &associate them with the dispatcher

SnmpV3ProtocolEngine pe = new SnmpV3ProtocolEngine(new byte[] {(byte)0x80, 0x00, 0x00, 0x02, 0x01, 0x09, (byte)0x84, 0x03, 0x01});

// Initialize the internal MIBS

InternalMibs internalMibs = new InternalMibs(".\\config\\snmp.conf");

// Create a Access Module

VACMImpl vacm = new VACMImpl(internalMibs.getVacmMibHelper());

// Create a Security Module

USMImpl usm = new USMImpl(internalMibs.getUsmMibHelper());

System.out.println("Registering the v3 protocol engine...");

// Associate the security module with the V3 protocol engine

pe.addSecModule(usm);

snmpAdaptor.registerSnmpProtocolEngine(pe);

// Create the MIB objects

Printer_MIB mib = new Printer_MIB();

for (int i = 1;i<3;i++){

PrtCoverTable coverTable = (PrtCoverTable)mib.getPrtCoverTableMBean();

coverTable.addRow(new PrtCoverEntry(1,i));

}

// Create the Command responders& associate them with the dispatcher

SnmpV3CommandResponder v3_cr = new SnmpV3CommandResponder(vacm);

snmpAdaptor .registerSnmpCommandResponder(v3_cr);

internalMibs.registerMibs(snmpAdaptor.getSnmpCommandResponder(new SnmpV1Context()));

internalMibs.registerMibs(snmpAdaptor.getSnmpCommandResponder(new SnmpV2cContext()));

internalMibs.registerMibs(v3_cr);

// Initialize the MBeans & register them with the MBean Server

mib.init();

MBeanServer server = MBeanServerFactory.createMBeanServer();

server.registerMBean(mib, new ObjectName("Mibs:name=" + mib.getName()));

// Create a SnmpInfoMap object& associate it with the adaptor

SnmpInfoMapImpl map = new SnmpInfoMapImpl("Printer_MIB.xml", true);

snmpAdaptor.setMBeanSnmpInfoMap(map);

//a ssociate the adaptor with the MBean Server.

snmpAdaptor.setMBeanServer(server);

// Start the adaptor

System.out.println("Starting the SNMP adaptor...");

snmpAdaptor.start();

...

The SNMP Adaptor is multi-threaded. To see a working sample, download the KSX toolkit and run the PrinterMIB sample provided