![]() ![]() ![]() |
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 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 :
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:
|
![]() ![]() ![]() |