Introduction:
This application allows Subagents to dynamically register with the Master Agent. Uses SNMP for the master subagent linkage (Relaying). Proxies requests to Subagents based on the instance and table OID with which the subagent is registered to the master agent in the instanceBasedProxyTable.
Overview:
This example is generated with instanceBased proxy enabled in the MibCompiler->Project -> Settings->Proxy Panel. Subagent entry is added for oid(OID - .1.3.6.1.2.1.2.2.1), instance ".1" and the port as 8010 in instanceBasedProxyTable. In this case Master Agent can be run at any port and the Subagent should be started at 8010. So the query for the oid under .1.3.6.1.2.1.2.2.1 group with ".1" as instance will be forwarded to the Subagent. Similarly we can also add some more entries in the proxytable with different instances and we can test more Subagents. New row can be added either from the Manager or through ProxyTable.xml file.
Source files:
1. MasterAgent:
MasterAgent.java
* DynamicRegistrationWithInstance class is instantiated.
* Created instance is registered with PduRequestHandler.
2. SubAgent:
Subagent is generated for RFC1213-MIB.
Compilation:
1. Go to <Installation Directory>\WebNMS\JavaAgent\examples\snmp\proxy\instancebased\agent\bindirectory and compile the source using,
sh compile.sh (for
Linux
users) OR
compile (for Windows
Users)
Staring the Agents:
1. Start the Master Agent from <Installation Directory>\WebNMS\JavaAgent\examples\snmp\proxy\instancebased\agent\bindirectory using,
sh run.sh (for
Linux users)
OR
run(for Windows Users)
2. Start the subagent from the <Installation Directory>\WebNMS\JavaAgent\examples\snmp\proxy\subagent\agent\bindirectory using,
sh run.sh (for Linux
users)
OR
run (for Windows Users)
Now query the Iftable columns of RFC1213-MIB
with
instance ".1" . The Master Agent will proxy the request to localhost,
port
8010.
Copyright (c) 2009 ZOHO Corp. All
Rights Reserved.