RMI Tutorials

 



 

Introduction

 

This tutorial will guide you through designing the RMI client program and accessing the simulated agent by providing working, illustrative examples.  It describes how the simulated SNMP and TL1 agents can be accessed and controlled from a remote system using the RMI client APIs bundled with Simulation Toolkit.  

 

Application Overview

 

The RMI tutorial is available in <SimulatorHome>/tutorials/rmi directory.  The client folder contains sample RMI client program which can be run on any remote system. The simulator folder contains the script files to start the simulated agents that can be managed via RMI.

 

The RMI client program invokes some of the RMI client API methods in the simulator to control the simulated agents running in another system.

 

Working with the Tutorial

 

In this section, the steps to start the simulated agent and the RMI client programs are provided. This would help you run the application by yourself and view the results.

 

Starting the Agent

 

The <SimulatorHome>/tutorials/rmi/simulator/bin directory contains the batch/shell files to start the simulated SNMP and TL1 agents with RMI support.

 

Starting the Standalone SNMP Agent with RMI support From UI


             Start the SNMP Agent Simulator by invoking SnmpAgentSimulator.bat file for Windows OS and SnmpAgentSimulator.sh file for Linux OS from <Simulator_Home>/bin directory.

             Load all the desired MIBs and simulate default values.

             Choose the menu option Settings  --> Agent Settings . This will invoke the Agent Settings dialog.

             Select the check box Manage using RMI.

             To start the SNMP agent which is made accessible via RMI, select Operations -> Start Agent option in the menu bar of the SNMP Agent Simulator. Now, when the SNMP agent is started it will              be accessible via RMI.

             To access RMI objects started through UI, the StartRMIRegistry.bat/sh script available under <Simulator_Home>/bin/cmdline must be invoked before starting the agents.
 
             Starting the Standalone SNMP Agent with RMI support From Command Line

Execute the following command from <SimulatorHome>/tutorials/rmi/simulator/bin directory.

 

StartAgentSimulator.bat/sh  - snmp  - c <configuration filename>

 

(or)

 

StartAgentSimulator.bat/sh  - snmp   - m <MIB filename> -tn  <database table name>

 

The above command will start the simulated SNMP agent at port 8001, that can be managed via RMI. It will also start the RMI registry at port number 1099 at localhost.  

 

Starting the Standalone TL1 Agent with RMI support From UI

    Start the TL1 Agent Simulator by invoking TL1AgentSimulator.bat file for Windows OS and TL1AgentSimulator.sh file for Linux OS from <Simulator_Home>/bin directory.

    Load all the desired TCS and simulate default values.

    Choose the menu option Settings  --> Agent Settings . This will invoke the Agent Settings dialog.

    Select the check box Manage using RMI.

    To start the TL1 agent which is made accessible via RMI, select Operations -> Start option in the menu bar of the TL1 Agent Simulator. Now when the TL1 Agent is started it will be         accessible via RMI.
   
    To access RMI objects started through UI, the StartRMIRegistry.bat/sh script available under <Simulator_Home>/bin/cmdline must be invoked before starting the agents.


    Starting the Standalone TL1 Agent with RMI support From Command Line

1. Execute the following command from <SimulatorHome>/tutorials/rmi/simulator/bin directory.

 

StartAgentSimulator.bat/sh  - tl1  - c <configuration filename> 

 

(or)

 

StartAgentSimulator.bat/sh  - tl1  - t <TCS filename> -tn  <database table name>

 

The above commands will start the simulated TL1 agent at port 9099,  that can be managed via RMI. It will also start the RMI registry at port number 1099 at localhost.  

 

Starting the Simulated Network with RMI support

 

Batch/Shell files are not provided to start the network with RMI support. This can be done from the Network Designer UI :

Starting the RMI Client

 

The RMI client folder available in <SimulatorHome>/tutorials/rmi directory contains the RMI client programs and RMI client APIs.

 

The following files and directories are available under the client folder :

Note: You can create a zip of the client folder, extract and run it in any other system separately.

 

To run the client program,

  1. Edit the RMIParameters.conf file available in the conf folder, with the host name and port number of the  system, where the simulated agent is running.

  2. Run the executeScript.bat/sh command from <SimulatorHome>/tutorials/rmi/client/bin directory. The SimulatorRMIClient gets the simulator object reference and executes the sample RMI API methods based on the reference obtained.

Note:

  1. Refer to the SimulatorRMIClient.java file in <SimulatorHome>/tutorials/rmi/source directory , to learn how to write your own RMI client programs.

  2. The javadocs of the RMI client api methods  that can be accessed via RMI is available in SimScrRmiIntf.html in <Simulator_Home>/examples/javadocs directory.

  3. If any changes are made in the source files, compile the source files and keep the class files in the classpath.

 

 

Copyright © 2012, ZOHO Corp. All Rights Reserved.
Network Monitoring Software from ManageEngine