![]() |
|||
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
| |||
20.7.1 Proxy Creation in SNMPv1 and SNMPv2 Master AgentsIn the SNMPv1/v2 master agent example, proxy registration is identical to standard MIB registration. The proxies are created as shown in the following example. Example 20-2 Proxy Creation in the MasterAgent Example
To instantiate and register the proxy, the MasterAgent example first of all creates a peer to the subagent using new SnmpPeer(), and creates security parameters p using the SnmpParameters() method. It then sets the subagent as an SMNPv2 agent using setProtocolVersion. The MasterAgent passes the parameters p to the new peer using peer.setParams. Finally, MasterAgent creates the proxy, passing it the following information:
20.7.2 Proxy Creation in SNMPv3 Master AgentsIn the SNMPv3 master agent example, proxy registration is identical to standard MIB registration. The proxies are created as shown in the following example. Example 20-3 Proxy Creation in the MasterAgentV3 Example
To instantiate and register the proxy, the MasterAgentV3 example first of all creates a peer to the subagent using new SnmpUsmPeer(), and creates SNMPv3 security parameters p using the SnmpUsmParameters() method. These new security parameters are then passed to the peer using peer.setParams, thus translating all requests that come through the peer into SNMPv3 requests. Finally, MasterAgent creates the proxy, passing it the following information:
20.7.3 MIB Overlapping in Master AgentsIn the overlapping MIB master agent example, proxy registration is identical to standard MIB registration and the proxies are created in the same way as for SNMPv1 and v2 master agents. Example 20-4 Overlapping MIBs MasterAgent Example
The overlapping MIB MasterAgent example creates a new MIB using new MIB1_MIB. It then registers the local MIB1 implementation for sysDescr1 and sysDescr2, which are configured into the StandAloneAgent example as error1 and error2, respectively. The local MIB thus shadows the implementation of sysDescr1 and sysDescr2 instrumented in the remote MIB, because it is registered with deeper OIDs than the remote MIB. The MIBs are then added to the SNMP adaptor server using snmpAdaptor.addMib and initialized using init(). | |||
| |||
![]() |