|
|
| HOME | PRODUCTS | DOWNLOAD | SALES | SUPPORT | ABOUT US | |
|
Koshna SNMP JMX Toolkit Includes JMX(TM) TechnologyConfiguring the SNMP Adaptor for JMXA simplified block diagram of the architecture of the SNMP Adaptor is shown below.
To configure the SNMP Adaptor for JMX.
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 |
|
Copyright © 2007 Koshna Software Technologies Pvt Ltd, Bangalore, India. All rights reserved.
JMX and all JMX based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. |