|
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.
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.
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.
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
Execute the following command from <SimulatorHome>/tutorials/rmi/simulator/bin directory.
StartAgentSimulator.bat/sh - snmp - c <configuration filename> -tn <database table name>
(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
1. Execute the following command from <SimulatorHome>/tutorials/rmi/simulator/bin directory.
StartAgentSimulator.bat/sh - tl1 - c <configuration filename> -tn <database table name>
(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 :
Go to <Simulator_Home>/bin/cmdline directory.
Execute the StartRMIRegistry.bat file for Windows OS and StartRMIRegistry.sh file for Linux OS. This command starts the RMI registry at the default port 1099.
Create the network with the required number of devices in the Network Designer.
Select the option Manage using RMI in the Settings -> Runtime Settings dialog.
Start the network. Now when the network is started, all the devices in the network will be accessible via RMI.
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 :
bin : The batch/shell scripts to execute the RMI client programs.
conf : The RMIParameters.conf file which contains the RMI parameters for the registration of the simulator object to the RMI registry.
source : SimulatorRMIClient.java program gets the simulator object reference and executes the RMI API methods .
jar: The AdventNetSimulatorClient.jar file contains the class files of the above specified java files and the RMI client API implementation.
|
|
Note: You can create a zip of the client folder, extract and run it in any other system separately. |
To run the client program,
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.
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:
|
|