![]() |
|||
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
| |||||||||||||
20.7.4 Running the SNMP Master Agent ExamplesBefore running the example applications, compile all the Java classes in each of the four subdirectories inside examplesDir/current/Snmp/MasterAgent, by typing the following command in each directory.
The following procedures give instructions to run five different SNMP master agent scenarios:
Ensure that no agents are already running before you start the examples.
|
$ java -classpath classpath -Djdmk.security.file=jdmk.security StandAloneAgent 8085 |
This binds StandAloneAgent to port 8085. Do not send traps when prompted.
Start the SNMPv2 MasterAgent application.
You need to provide MasterAgent with the following information:
The location of its security configuration file, jdmk.security
The port on which it should listen for incoming requests, in this case we choose 8087
The subagent's host, in this case the local host
The subagent's port number, in this case 8085
In examplesDir/current/Snmp/MasterAgent/master, type the following command:
$ java -classpath classpath -Djdmk.security.file=jdmk.security MasterAgent 8087 localhost 8085 |
The following output is displayed:
NOTE: HTML adaptor is bound on TCP port 8082 NOTE: SNMP Adaptor is bound on UDP port 8087 The master agent forward traps on port : 8088 >> Press Enter if you want to stop. |
Start the SimpleManager application.
You need to provide SimpleManager with the following information:
The location of its security configuration file, jdmk.security
The master agent's host, in this case the local host
The port on which the master agent is listening for request, in this case 8087
In examplesDir/current/Snmp/MasterAgent/manager, type the following command:
$ java -classpath classpath -Djdmk.security.file=jdmk.security SimpleManager localhost 8087 >> Press Enter if you want to send a SNMPv3 request. |
Press Enter to send an SNMPv3 request
The following output is displayed:
SimpleManager::main: Send SNMPv3 get request to SNMPv3 agent on localhost at port 8087 Result: [Object ID : 1.3.6.1.2.1.1.1.0 (Syntax : String) Value : error1, Object ID : 1.3.6.1.2.1.1.2.0 (Syntax : String) Value : error2, Object ID : 1.3.6.1.2.1.1.3.0 (Syntax : String) Value : sysDescr3, Object ID : 1.3.6.1.2.1.1.4.0 (Syntax : String) Value : sysDescr4] >> Press Enter if you want to send a SNMPv2 request. |
Press Enter to send an SNMPv2 request
The following output is displayed:
SimpleManager::main: Send SNMPv2 get request to SNMP agent on localhost at port 8087 Result: [Object ID : 1.3.6.1.2.1.1.1.0 (Syntax : String) Value : error1, Object ID : 1.3.6.1.2.1.1.2.0 (Syntax : String) Value : error2, Object ID : 1.3.6.1.2.1.1.3.0 (Syntax : String) Value : sysDescr3, Object ID : 1.3.6.1.2.1.1.4.0 (Syntax : String) Value : sysDescr4] $ |
The manager has successfully sent the two requests to the subagent, via the master agent.
Because there is no MIB overlapping in this second example, all the variables implemented by the subagent MIB can be seen from the manager. Thus, you see that some of the OIDs queried return a DisplayString value of error#.
Start the StandAloneAgent subagent.
In examplesDir/current/Snmp/MasterAgent/standalone, type the following command:
$ java -classpath classpath -Djdmk.security.file=jdmk.security StandAloneAgent 8085 |
This binds StandAloneAgent to port 8085. Do not send traps when prompted.
Start the SNMPv3 MasterAgentV3 application.
You need to provide MasterAgentV3 with the following information:
The location of its security configuration file, jdmk.security
The port on which it should listen for incoming requests, in this case we choose 8087
The subagent's host, in this case the local host
The subagent's port number, in this case 8085
The manager's host, in this case the local host
In examplesDir/current/Snmp/MasterAgent/master, type the following command:
$ java -classpath classpath -Djdmk.security.file=jdmk.security MasterAgentV3 8087 localhost 8085 localhost |
The following output is displayed:
NOTE: HTML adaptor is bound on TCP port 8082 NOTE: SNMP Adaptor is bound on UDP port 8087 >> Press Enter if you want to stop. |
Start the SimpleManager application.
You need to provide SimpleManager with the following information:
The location of its security configuration file, jdmk.security
The master agent's host, in this case the local host
The port on which the master agent is listening for requests, in this case 8087
In examplesDir/current/Snmp/MasterAgent/manager, type the following command:
$ java -classpath classpath -Djdmk.security.file=jdmk.security SimpleManager localhost 8087 >> Press Enter if you want to send a SNMPv3 request. |
Press Enter to send an SNMPv3 request
The following output is displayed:
SimpleManager::main: Send SNMPv3 get request to SNMPv3 agent on localhost at port 8087 Result: [Object ID : 1.3.6.1.2.1.1.1.0 (Syntax : String) Value : error1, Object ID : 1.3.6.1.2.1.1.2.0 (Syntax : String) Value : error2, Object ID : 1.3.6.1.2.1.1.3.0 (Syntax : String) Value : sysDescr3, Object ID : 1.3.6.1.2.1.1.4.0 (Syntax : String) Value : sysDescr4] >> Press Enter if you want to send a SNMPv2 request. |
Press Enter to send an SNMPv2 request
The following output is displayed:
SimpleManager::main: Send SNMPv2 get request to SNMP agent on localhost at port 8087 Result: [Object ID : 1.3.6.1.2.1.1.1.0 (Syntax : String) Value : error1, Object ID : 1.3.6.1.2.1.1.2.0 (Syntax : String) Value : error2, Object ID : 1.3.6.1.2.1.1.3.0 (Syntax : String) Value : sysDescr3, Object ID : 1.3.6.1.2.1.1.4.0 (Syntax : String) Value : sysDescr4] $ |
The manager has successfully sent the two requests to the subagent, via the SNMPv3 master agent.
![]() ![]() |