![]() ![]() ![]() |
Running the RMI system and managing the agent via RMI, involves starting the RMI registry, starting the RMI server (agent / network which is accessible via RMI) and starting the RMI Client.
The RMI client can access the RMI server, only if the remote object is created and references to them are accessible. Simulation Toolkit provides option to make the simulated SNMP/TL1 agent and the network devices accessible through RMI.
In this topic, we will learn to start the RMI registry, make the agent accessible through RMI, start the RMI server, and start the client program which invokes the client API methods to access the RMI server.
For obtaining references to remote objects, RMI provides a simple remote object registry interface, implemented by RMI's rmiregistry, that provides methods for storing and retrieving remote object references. A server registers its remote objects with the RMI registry.
To start the RMI registry :
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 in the default port 1099.
Registering the Object with the RMI Registry
From UI
Making the SNMP agent accessible through RMI and starting the agent :
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.
Making TL1 agent accessible through RMI and starting the agent :
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.
Making the network devices accessible through RMI and starting the network :
Start the Network Designer by invoking NetworkDesigner.bat file for Windows OS and NetworkDesigner.sh file for Linux OS from <Simulator_Home>/bin directory.
Load all the desired MIBs and simulate default values.
Choose the menu option Settings --> Runtime Settings . This will invoke the Agent Settings dialog.
Select the check box Manage using RMI.
To start the network which is accessible via RMI, select Run -> Start Network option in the menu bar of the Network Designer. Now when the network is started, all the devices in the network will be accessible via RMI.
From Command line
To start the simulated SNMP agent from command line and manage via RMI, type the following command from the <Simulator_Home>/bin/cmdline directory.
StartSnmpAgent.sh -m RFC1213.MIB -p 8005 -rmi
Refer to the topic, Starting the SNMP Agent from Command Line, to learn more about the command line options provided.
To start the simulated TL1 agent from command line and manage via RMI, type the following command from <Simulator_Home>/bin/cmdline directory .
StartTL1Agent.sh -cs .\tcs\Acme-MSU.tcs -p 9002 -rmi
Refer to the topic, Starting the TL1 Agent from Command Line, to learn more about the command line options provided.
To start the simulated network from command line and manage via RMI, type the following command from <Simulator_Home>/bin/cmdline directory.
StartNetwork -snmp < SNMP text file with path > -tl1 < TL1 text file with path> -rmi
Refer to the topic, Starting the Network from Command Line, to learn more about the command line options provided.
Write the RMI Client program, invoking the methods in RMI client API. 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.
You can invoke methods in RMI Client API by setting the AdventNetSimulatorClient.jar present under the <Simulator_Home>/tutorials/rmi/client/jars directory. Procedure to write the RMI client program is given below :
Create the instance of the Client API Class.
Invoke the method getObjectRef(host, port, objectName). This will return a boolean to denote that the object is fetched successfully from the RMI Server or the object is not fetched successfully.
Start the RMI Client program. If the method getObjectRef(host, port, objectName) returns a boolean, then you can use the rest of the methods available with the RMI client API and manage the simulated agent / network devices.
![]() ![]() ![]() |