![]() |
|||
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
| ||||||||||||||
|
$ java -classpath classpath -Djdmk.security.file=jdmk.security StandAloneAgent 8085 |
This binds StandAloneAgent to port 8085. Do not send traps when prompted.
Start the overlap 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/overlap, 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 >> 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 : sysDescr1, Object ID : 1.3.6.1.2.1.1.2.0 (Syntax : String) Value : sysDescr2, 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 : sysDescr1, Object ID : 1.3.6.1.2.1.1.2.0 (Syntax : String) Value : sysDescr2, 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 overlap master agent. As you can see, the error# values have been replaced by the variables sysDescr1 and sysDescr2, which were configured in the master agent to overlap with the variables in the subagent's MIB.
In this scenario, an SNMPv1 trap or a v2 trap is sent by the subagent. The master agent forwards the trap as is and sends a translated trap. The version translation from v1 to v2, or from v2 to v1 is performed by the master agent. The manager therefore receives two traps, namely, the initial trap and the translated trap.
Start the StandAloneAgent subagent.
In examplesDir/current/Snmp/MasterAgent/standalone, type the following command:
$ java -classpath classpath -Djdmk.security.file=jdmk.security StandAloneAgent 8085 |
The following output is displayed:
NOTE: SNMP Adaptor is bound on UDP port 8085 Press Return if you want to send trap |
Press Return to activate stand alone traps
The following output is displayed:
Press crtl-c in order to kill the agent Type 1 in order to launch snmp V1 traps, 2 for snmp V2. |
Do not send any traps yet, but leave the StandAloneAgent active.
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, which in this example must be 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. |
Do not send a request this time.
Go back to examplesDir/current/Snmp/MasterAgent/standalone
The StandAloneAgent should still be waiting to send traps.
Type either 1 or 2 to send SNMPv1 or SNMPv2 traps
The following output is displayed:
1 V1 TRAP to send Trap V1 sent! Type 1 in order to launch snmp V1 traps, 2 for snmp V2. 2 V2 TRAP to send Trap V2 sent! Type 1 in order to launch snmp V1 traps, 2 for snmp V2. |
Go back to examplesDir/current/Snmp/MasterAgent/manager
Notice that the SimpleManager application has received SNMPv1 and v2 traps from the StandAloneAgent. The following output from SimpleManager is displayed:
NOTE: TrapListenerImpl received SNMPv1 trap : Generic 0 Specific 0 TimeStamp 104549 Agent adress 129.157.203.98 NOTE: TrapListenerImpl received SNMPv2 trap: CommunityString : VarBind list : oid : 1.3.6.1.2.1.1.3.0 val : 0:17:25 oid : 1.3.6.1.6.3.1.1.4.1.0 val : 1.3.6.1.6.3.1.1.5.1 oid : 1.2.3.4.5.6.0.0 val : Test values oid : 1.2.3.4.5.6.1.0 val : NULL oid : 1.2.3.4.5.6.2.0 val : 43 oid : 1.2.3.4.5.6.3.0 val : Test values oid : 1.3.6.1.6.3.18.1.3.0 val : 129.157.203.98 oid : 1.3.6.1.6.3.18.1.3.0 val : 129.157.203.98 oid : 1.3.6.1.6.3.18.1.4.0 val : oid : 1.3.6.1.6.3.1.1.4.3.0 val : 1.3.6.1.4.1.42 |
Stop the StandAloneAgent and the SimpleManager by pressing Control-C, and stop the MasterAgent by pressing Enter.
![]() ![]() |