SNMP Proxy
AdventNet Multi-Protocol agent also supports the proxy function using the SNMP protocol, where requests for an OID sub-tree can be forwarded to another SNMP agent. This is implemented using the com.adventnet.snmp.snmp2.agent.SnmpProxy JavaBean.
The Proxy bean is useful in statically registering the subagents with the Multi-protocol Master agent (i.e the SnmpAdaptor).It can only be used in registering the subagents during the Master agent start-up. The proxy works much the same as Dynamic Registration, except that the subagent's entries cannot be added dynamically. If your implementation does not require the subagents to be added dynamically, then SnmpProxy can be used.
The code for adding a proxy for
mib-2 to host="localhost" and port=161 is shown below .
| MBeanServer
server = MBeanServerFactory.createMBeanServer(); SnmpAdaptor snmpadaptor = new SnmpAdaptor(); String name = server.getDefaultDomain() +":type=com.adventnet.adaptors.snmp.SnmpAdaptor,protocol=snmp, port=8001"; server.registerMBean(snmpadaptor, new ObjectName(name)); // Instantiate
the SnmpProxy bean // setting
the proxy host // setting
the proxy port // setting
the proxy registered OID // Registering
the proxy with the SnmpAdaptor |