Example on Model MBean

Contents:

Introduction

This is a simple example to illustrate the usage of ModelMBean registered with the Multi-Protocol agent.
__________________________________________________________________________________________________________________________

Overview

ModelMBeans give a great flexibility by making the protocol specific details available through the Descriptors.
This example creates a ModelMBean to illustrate how SNMP interface can be made available to the Multi-Protocol Agent.
The main file ModelJmxAgent has three adaptors (SNMP/RMI/HTML)  registered with the Multi-Protocol  (JMX) server.The AgentSystemInstrument object can be managed by making it a model mbean by wrapping it with ModelMBeanImpl and registering it with the MBeanServer.
__________________________________________________________________________________________________________________________

Getting Started :

Source files

The source files  are,

Compilation

To compile the source files go to WebNMS/JavaAgent/examples/jmx/modelMBean directory in the command prompt and type,

compile *.java [Windows]
sh compile sh *.java [Linux/Solaris]

This will compile the source files in the respective directory.

Running the Agent

To start the agent go to WebNMS/JavaAgent/examples/jmx/modelMBean directory in the command prompt and,

1. Run the run.bat or run.sh,

          By default,
                 (a) RMI registry service will be started at port 1099
                 (b) HTML Adaptor will be started at port 8030
                 (c) SNMP Adaptor will be started at port 8001
 
2. Use any webbrowser to connect to the Multi-Protocol server (through HTML adaptor) by specifying the URL as http://localhost:8030

3. Use MBean browser to access the data through RMI( start MBean Browser using MBeanBrowser.bat/MBeanBrowser.sh present in WebNMS/JavaAgent/bin directory. )

Testing

1. This AgentSystemInstrument is represented as a ModelMBean in the Multi-Protocol  (JMX) Server. The AgentSystemInstrument.xml file gives all the SNMP protocol related details like OID to this ModelMBean.

2.To test the Snmp Interface of this ModelMBean, load the Mib AGENT-SAMPLE-MIB in the MibBrowser and make SNMP queries for the AgentSystemGroup.
__________________________________________________________________________________________________________________________

Copyright (c) 2009  ZOHO Corp. All Rights Reserved.