![]() ![]() ![]() |
13.1 Overview
13.2 SNMP Master Agent
13.3 SNMP Subagent
13.5 Creating a Subagent
13.6 Registering the Subagent to the Master Agent
13.7 Different Types of Master Subagent Relationship
13.8 Knowing the Status of the Subagent (Heart Beat Mechanism)
13.9 Sending Traps From Subagents Through the Master Agent.
13.10 Security in Proxy (Using SNMPv3)
13.11 Making WebNMS Agents as Subagents to Third Party Agents (Including OS Native Agents)
13.12 Running the Example
In original model of SNMP Management, it is a monolithic agent that used to carry out all the management responsibilities on a given network element (node). This solution was not flexible enough to provide an effective management of increasingly complex and distributed systems. In addition to the agents typically provided by computer manufacturers for hardware and operating system information, agents are also produced by other software vendors for SQL, Application servers, etc.
Also in distributed systems where different components of the product will be present in different network nodes (different IP address), each component needs its own management requirement for which each component will have an SNMP agent. However, there should be a single gateway for managing the entire product (distributed components).
This disadvantage of the original SNMP model, being unable to accommodate such complex and heterogeneous systems, is solved using Master - Subagent concept where the Master agent acts as a proxy for other SNMP agents. WebNMS Agent Toolkit provides generic comprehensive Master Subagent architecture for making agents Subagent to Master agent on the fly. This dynamic behavior can be accomplished by the "Dynamic Registration concept in Master Subagent Architecture".
The Master agent is an entity or process on a managed node that exchanges SNMP messages with the Management applications such as WebNMS Web NMS, HP Openview, IBM Tivoli, etc.,. It acts as a primary interface between the Network Manager and Subagents.
Subagents are processes that access the management information and provide manageability to various applications/components within a system. These Subagents interact with the Master agent using SNMP. They do not interact with the Managers directly.
All the agents generated using MIB Compiler can act as both Master agent and Subagent. By default, the generated agent acts as a standalone monolithic agent. Follow the steps given below to make the standalone agent, a Master agent.
Using MIB Compiler UI
Create a Project and Load a MIB (MIB that you would like to make as a Master agent).
Select Project -> Settings menu from the menu bar of MIB Compiler UI.
Choose the Proxy Panel.
Check Generate Agent as Proxy option.
By default, the OID Based Proxy option is selected. If preferred, the other options Context Based Proxy or Instance Based Proxy can be selected.
After selecting these options, generate and compile the code.
The agent gets created as a Master agent with Proxy support.
By default you will have a Subagent entry registered for every type of Proxy Table.
To register more Subagents, refer to the topic "Registering Subagents in the Master Agent".
|
Note: Master agent can be created with or without using a MIB. |
Using API
To enable Proxy using API calls, add any one of the following piece of code to the Master agent's Main File before the code for populating entries for aclTable based on the registration.
//For OID Based Proxy dyn = new DynamicRegistration(false, "conf", "ProxyTable.xml"); dyn.addRegistrationListener(hdlr, true);
//For Context Based Proxy dynCom = new DynamicRegistrationWithCommunity(false, "conf", "ProxyTable.xml"); dynCom.addRegistrationListener(hdlr, true);
//For Instance Based Proxy dynIns = new DynamicRegistrationWithInstance(false, "conf", "ProxyTable.xml"); dynIns.addRegistrationListener(hdlr, true); |
These API call implements Proxy. Please note that the api calls will work provided the variable declaration private DynamicRegistration dyn = null; / private DynamicRegistrationwithCommunity dynCom = null; / private DynamicRegistrationwithInstance dynIns = null; are included respectively (based on the type of registration) in the Main file where all declarations are present.
All the agents generated using MIB Compiler can act as both Master agent and Subagent. By default, the generated agent can directly act as Subagent. There is no specific option to make an agent act as a Subagent. Any SNMP agent can act as a Subagent. The Subagent's host, port number details are to be registered in the Master agent for forwarding the requests to the exact Subagent. So, create a simple agent using a MIB (from which you prefer to access the details) and make it act as a Subagent.
13.6 Registering Subagents in the Master Agent
There are two ways to register Subagents in the Master agent. It can be done either : (1) Before Agent Startup or (2) During Run Time.
By registering the Subagent to the Master agent before agent startup, the Subagent information is hard coded in the Java file. To register the Subagent before agent-start up you can use either the MIB Compiler UI or Text/XML Files or API calls.
Using MIB Compiler UI
Select Project -> Settings menu from the MIB Compiler UI.
Choose the Proxy Panel.
Check Generate Agent as Proxy option.
By default, the OID Based Proxy option becomes enabled.
Select proxyTable from the Panel.
Add Subagent entries to the table and click OK.
Using Text / XML Files / Runtime Memory
Once the entries are added through MIB Compiler UI, the configurations are saved in a text or XML file namely ProxyTable.txt / .xml (for OID Based Proxy) under <Agent Toolkit Home>/snmpprojects/projectname/agent/bin/conf directory. To make use of this text file or xml file storage,
Select Project -> Settings menu from the MIB Compiler UI.
Select proxyTable from Proxy Panel.
Choose XML File or Text File from the Storage Type Option. By default, XML is chosen.
These files can be edited to add Manager entries. The ProxyTable.xml given below has been edited for adding a new Subagent entry with OID ".1.3.6.1.2.1.1" ; Manager Port : "8004".
<?xml version="1.0" encoding="UTF-8"?> <Table> <row> <column name="proxyOid" value=".1.3.6.1.2.1" ></column> <column name="proxyHost" value="localhost" ></column> <column name="proxyPortNumber" value="161" ></column> <column name="proxyVersion" value="2" ></column> <column name="proxyCommunity" value="public" ></column> <column name="proxyTimeout" value="5000" ></column> <column name="proxyRetries" value="0" ></column> <column name="proxyRowStatus" value="1" ></column> </row>
<row> <column name="proxyOid" value=".1.3.6.1.2.1.1" ></column> <column name="proxyHost" value="localhost" ></column> <column name="proxyPortNumber" value="8004" ></column> <column name="proxyVersion" value="2" ></column> <column name="proxyCommunity" value="public" ></column> <column name="proxyTimeout" value="5000" ></column> <column name="proxyRetries" value="0" ></column> <column name="proxyRowStatus" value="1" ></column> </row> </Table> |
Similarly, the text/xml files get generated for Context Based Proxy and Instance Based Proxy and they can be edited for adding new Subagent entries. Please note that the agent has to be restarted for the changes to take effect.
Run-Time Memory
Run-Time memory can be used to store the Manager information in the agent Memory . Using this option does not store the entries in text files or xml files. To use the run time memory for adding Manager entries dynamically, follow the instructions given below.
Choose Project -> Settings menu from the menu bar of MIB Compiler UI.
Select proxyTable from the Proxy Panel (can be any Proxy Table you prefer).
Select Runtime Memory from the Storage Type.
Add entries using the Add option.
After this, follow the steps given in adding entries From the Manager i.e During Runtime (13.6.2) . Please note that once the agent is killed, the added entries are removed from the memory.
Using API Calls
Add the following piece of code in the generated Main file of Master agent before the code for aclTable registration to register a Subagent entry. (OID Based Registration)
dyn = new DynamicRegistration(false); Vector subAgentEntries = new Vector();
com.adventnet.utils.agent.DynamicRegistrationEntry entry0 = dyn.createDynamicRegistrationEntry(".1.3.6.1.2.1","localhost",new Integer("161"),new Integer("2"),"public",new Long("4000"),new Long("0")); subAgentEntries.addElement(entry0);
dyn.setTableVector(subAgentEntries); dyn.addRegistrationListener(hdlr, true); |
Using this api method will also include Subagents to the Master agent. For Context Based Proxy and Instance Based Proxy the following api calls can be used
//For Community Based Dynamic Registration
dynCom = new DynamicRegistrationWithCommunity(this, false); Vector subAgentEntries = new Vector();
com.adventnet.utils.agent.DynamicRegistrationEntry entry0 = dynCom.createDynamicRegistrationEntry(".1.3.6.1.2.1","public","localhost",new Integer("161"),new Integer("2"),"public",new Long("4000"),new Long("0")); subAgentEntries.addElement(entry0);
dynCom.setTableVector(subAgentEntries); dynCom.addRegistrationListener(hdlr, true);
//For Instance Based Dynamic Registration
dynIns = new DynamicRegistrationWithInstance(false); Vector subAgentEntries = new Vector();
com.adventnet.utils.agent.DynamicRegistrationEntry entry0 = dynIns.createDynamicRegistrationEntry(".1.3.6.1.2.1.2.2.1",".1","localhost",new Integer("161"),new Integer("2"),"public",new Long("4000"),new Long("0")); subAgentEntries.addElement(entry0);
dynIns.setTableVector(subAgentEntries); dynIns.addRegistrationListener(hdlr, true); |
Subagents can also be registered in the Master agent during run time.
From the Manager
To add Subagent entries to the Master agent's Proxy Table from the Manager, follow the steps given below:
Load AGENT-SNMP-CONFIG-MIB in the MIB Browser application.
Select proxyTable (or whichever preferred Subagent table) from the subAgentTables module of agentConfiguration group.
Selecting the respective table and clicking SNMP Table icon (View SNMP Table Data)in MIB Browser open up a wizard wherein entries can be added to the corresponding proxyTable.
Click Add in that SNMP Table wizard. The corresponding columns of the Table are listed.
Include the Subagent entries. The entries added from remote get updated in the text/XML file provided the storage option is selected.
Enable "Remote Configuration" option by selecting Proxy Panel of Project -> Settings menu in MIB Compiler UI or including any of the following API in the generated main method. Please note that it is possible to access the table from remote only if "Remote Configuration" is enabled.
By just including the below API for a particular
type of Proxy in the initSnmpExtensionNodes() method in the generated
main file, remote configuration of the respective Proxy Table is possible.
For OID Based Proxy
dyn = new DynamicRegistration(false, "conf", "ProxyTable.xml");
dyn.addRegistrationListener(hdlr, true);
For Context Based Proxy
dynCom.setTableVector(subAgentEntries);
dynCom.addRegistrationListener(hdlr, true);
For Instance Based Proxy
dynIns.setTableVector(subAgentEntries);
dynIns.addRegistrationListener(hdlr, true);
By making the argument as false [dynIns.addRegistrationListener(hdlr, false);],
the facility of Remote configuration is disabled.
13.7 Different Types of Master - Subagent Relationship
Considering the design and the complexity of the distributed systems, it is very difficult to have just normal OID-based Master - Subagent relationship. This made us evolve the Master - Subagent relationship further and made us support different types of Master - Subagent relationship such as Context-based registration and Instance-based registration.
13.7.1 OID-based Registration
This is the normal registration where all Subagents implement different MIBs or different groups in the MIB. The proxyTable in AGENT-SNMP-CONFIG-MIB is used for this type of registration. Following are the columns present in the proxyTable :-
proxyOid - OID of the Subagent.
proxyHost - Host of the Subagent.
proxyPortNumber - Port Number in which the Subagent is running.
proxyVersion - Version of the Subagent using which the Subagent is to be contacted or queried.
proxyCommunity - The Community with the Subagent is to be contacted or proxied.
proxyTimeout - The time for which the Master agent should wait for the response from the Subagent.
proxyRetries - Number of Retries to be made, in case the Subagent does not send a response within the time out value specified before.
proxyRowStatus - Row Status column facilitating addition and deletion of rows. If the status is not active then the request will not be proxied to the corresponding Subagent.
So, "Create a Master agent and a Subagent". To "Register Subagents in the Master Agent", please refer to the previous topic. With the explanation provided in "Registering Subagents" topic, you can add Subagent entries to the Proxy Table. Thus, General Master - Subagent feature is achieved. To test the same, please have a look at Running the Example, which explains the feature with an example.
13.7.2 Context-based Registration
This kind of registration helps in having more than one Subagent implementing the same MIB or a subtree in a MIB. In this case, the Master agent should have a criterion to identify the Subagent to forward the request. Community of the Subagent is made as the criteria. The contextBasedProxyTable in AGENT-SNMP-CONFIG-MIB stores the details of the Subagents. Following are the columns present in the contextBasedProxyTable :-
proxyContextOid OID of the Subagent.
proxyContextName - The Community Name of the Subagent to which the request is to be proxied i.e the request from the Manager for the Subagent will be authenticated only if such a community exists in the Master agent's aclTable.
proxyContextHost - Host of the Subagent.
proxyContextPortNumber - Port Number in which the Subagent is running.
proxyContextVersion - Version of the Subagent using which the Subagent is to be contacted or queried.
proxyContextCommunity - The Community with the Subagent is to be contacted or proxied i.e. the request from the Master agent will be authenticated by the Subagent only if such a community exists in the Subagent's aclTable.
proxyContextTimeout - The time for which the Master agent should wait for the response from the Subagent.
proxyContextRetries - Number of Retries to be made, in case the Subagent does not send a response within the time out value specified before.
proxyContextRowStatus - Row Status column facilitating addition and deletion of rows. If the status is not active then the request will not be proxied to the corresponding Subagent and so there will not be any response from the Subagent.
So, "Create a Master Agent and a Subagent". To "Register Subagents in the Master Agent", please refer to the previous topic. With the explanation provided in "Registering Subagents" topic, you can add Subagent entries to the Context-based Proxy Table. Thus, Context-based Master - Subagent feature is achieved. To test the same, please have a look at Running the Example , which explains the feature with an example.
13.7.3 Instance-based Registration
This kind of registration is used when the Subagents implement different rows of a table. The Master agent identifies the Subagent based on the instance value, present in the request received from the Manager, and forwards the request to the respective Subagent. The instanceBasedProxyTable in AGENT-SNMP-CONFIG-MIB stores the details of the Subagents. Following are the columns present in the instanceBasedproxyTable :-
proxyEntryOid - Entry OID of the Subagent Table.
proxyEntryInstance - Instance value of the Subagent.
proxyInsHost - Host of the Subagent.
proxyInsPortNumber - Port Number in which the Subagent is running.
proxyInsVersion - Version of the Subagent using which the Subagent is to be contacted or queried.
proxyInsCommunity - The Community with the Subagent is to be contacted or proxied.
proxyInsTimeout - The time for which the Master agent should wait for the response from the Subagent.
proxyInsRetries - Number of Retries to be made, in case the Subagent does not send a response within the time out value specified before.
proxyInsRowStatus - Row Status column facilitating addition and deletion of rows. If the status is not active then the request will not be proxied to the corresponding Subagent and so there will not be any response from the Subagent.
So, "Create a Master Agent and a Subagent". To "Register Subagents in the Master Agent", please refer to the previous topic. With the explanation provided in "Registering Subagents" topic, you can add Subagent entries to the Instance-based Proxy Table. Thus, Instance-based Master - Subagent feature is achieved. To test the same, please have a look at Running the Example, which explains the feature with an example.
13.8 Knowing the Status of the Subagent (Heart Beat Mechanism)
As the name implies, Heart Beat Mechanism is helpful to determine the existence of a connection between Master - Subagent. This feature is implemented to constantly monitor the status of the Subagent and make it available to the Master agent.
By knowing the status, the Master agent does not forward the request to Subagents, which are not alive. Instead, the Master agent throws a 'general failure' error directly to the Manager.
13.8.1 Enabling Heart Beat Mechanism
Heart Beat mechanism can be enabled using MIB Compiler UI options or the API calls. To enable this feature in the Master agent,
Using MIB Compiler UI
Select Project -> Settings menu from the MIB Compiler UI while creating a Master agent.
Choose the Proxy Panel.
Check Generate Agent as Proxy option.
By default, the OID Based Proxy option is enabled. Select the preferred type of Proxy.
Check Heart Beat Mechanism option to implement the polling mechanism in Proxy.
Using API calls
Instead of the MIB Compiler UI options, the following API calls can be used for enabling Heart Beat Mechanism. Add the following piece of code in the initSnmpExtensionNodes method of the Master agent's generated Main file after the Dynamic Registration class instantiation to enable Heart Beat with the default values. For OID-based Proxy, add the following code.
dyn.checkSubAgentHeartBeat(true, null, null, null, this); |
Here, 'dyn' represents the instance of Dynamic Registration. This dyn varies according to the type of registration. For Instance-based and Context-based Proxy the code has to be as follows:
dynIns.checkSubAgentHeartBeat(true, null, null, null, this); dynCom.checkSubAgentHeartBeat(true, null, null, null, this); |
The Parameters true, null, null, null, this represents the following respectively.
boolean toPoll - Here, 'true' enables polling and 'false' disables polling.
Long pollInterval - Specifies the required interval in Polling (by default, 5000). null takes the default value.
Integer timeOut - States the time out value of the requests (by default, 1 second). null takes the default value.
Integer retries - States the number of retries to be done (by default, one time). null takes the default value.
SnmpAgent agent - Specifies the reference to the SnmpAgent for sending traps. Because the generated main file extends SnmpAgent, the value for the parameter SnmpAgent can be passed as "this".
Thus the code for Heartbeat is :
checkSubAgentHeartBeat (boolean toPoll, Long pollInterval, Integer timeOut, Integer retries, SnmpAgent agent);
To know how this Heart Beat functionality works refer to Running the Example section.
13.8.2 LinkUp and LinkDown Traps
Subagent's status is intimated to the Master agent through Heart Beat support. As per this support, the Row Status column of the proxyTable in the Master agent is updated frequently with NOT IN SERVICE and ACTIVE status. When the Subagent status is down, the Row Status column becomes NOT_IN_SERVICE and when it is up, the row status column becomes ACTIVE.
On becoming NOT_IN_SERVICE, a Link Down Trap can be generated and forwarded to the Managers by the Master agent. Similarly, a Link Up Trap can be generated when the status shifts to ACTIVE.
To know which Subagent is down or active, the Trap Details can be viewed. The Trap PDU contains the details of the Subagent Host and Port number and using these details Subagents can be identified by the Manager.
These Trap details can be viewed by loading the AGENT-SNMP-CONFIG-MIB in MIB Browser application and querying the related tables. The OID of the General Based Proxy linkUp and linkDown traps in the AGENT-SNMP-CONFIG-MIB are .1.3.6.1.4.1.2162.10.3.1.4.1 and .1.3.6.1.4.1.2162.10.3.1.4.2 respectively. The Managers to whom these traps should be sent are identified using the entries in Trap Forwarding Table.
13.9 Sending Traps From Subagent Through Master Agent
Subagents generate traps and send them through the Master agent to the Manager. Even though traps can be sent directly to the Manager from the Subagent, normally the traps are forwarded to the Master agent. The Master agent forwards them to the interested Managers. This is most applicable in the real time environment and the details of the Managers (to whom these traps should be sent) can be availed from the Trap Forwarding Table. For more information about the Trap Forwarding Table and configuring Managers in the Forwarding Table, refer to Traps section.
13.9.1 Filtering Traps Received from Subagent Using Trap Filtering Table
To restrict the generation of certain traps to the manager, the Subagent specifies a condition wherein every Trap passes through that condition before it is forwarded to the Manager through the Master agent. Only if that condition is satisfied, the trap reaches the manager. Thus, filtering is done and if required by the Manager, traps are sent across or else they are dropped.
To filter and send traps through the Master agent, a Trap Filtering Table is maintained by Agent Toolkit in the Master agent. This Trap Filtering table maintains information of the Subagents registered with the Master agent (Proxy Table). The Subagent registrations in the Trap Filtering Table purely depends on your requirement. You can either include all the Subagent details present in the Master agent (proxyTable) or a particular set of Subagents from which you prefer to receive traps. This table can also be used even if Master Subagent concept is not used.
The Trap Filtering Table contains the following columns defined in it : -
agentHostType (Index Column) - Type of Addressing Model (IPv4/IPV6)
agentHost (Index Column) - Host of the Subagent.
agentTrapPortNumber (Index Column) - Port number from which the Subagent sends traps.
agentCommunity - Community of the Subagent.
agentStatus - Row Status column facilitating addition and deletion of rows.
13.9.2 Enabling Trap Filtering Table
You can enable Trap Filtering Table either by using MIB Compiler UI or by using API Calls.
Using MIB Compiler UI
Select Project -> Settings menu from the MIB Compiler UI.
Select Proxy Panel.
Check Generate Agent as Proxy option.
By default the OID Based Proxy option becomes enabled.
Check Trap Filtering Table option.
Enter the port number for TrapReceiver Port. This port opens a different session for receiving traps for the Master agent and forwards it to Managers. The default port mentioned here (8005). Thus support for Trap Filtering Table is enabled.
|
Note:
|
Using API calls
Alternatively, you can add the following piece of code in the Master agent Main file toward the end of initSnmpExtensionNodes() after the SnmpTrapService instantiation, to enable Trap Filtering Table support
// This takes care of forwarding the traps from Sub agents received at the port 8005. They get generated by default if Proxy is enabled. IN case proxy entries are added using API calls, then this entry has to be added.
SnmpTrapReceiverService trapReceiverService = new SnmpTrapReceiverService(8005 ); trapReceiverService.addTrapRequestListener(trapListener);
// For TrapFilteringTable. trapTableListener = new com.adventnet.snmp.snmp2.agent.TrapTableRequestHandler (this, false); trapTableListener.addRegistrationListener(hdlr); trapReceiverService.setAgentTableModel(trapTableListener.getAgentTableModel()); } |
The following declaration has to be included in the Main file where all Variable declarations are present. The API call will work only when this declaration is included.
private com.adventnet.snmp.snmp2.agent.TrapTableRequestHandler trapTableListener = null;
13.9.3 Adding Subagent Entries to Trap Filtering Table
Subagent entries can be added to the Table either : (1) Before Agent Startup or (2) During Run Time.
13.9.3.1 Before Agent Startup
To add Manager Entries at Agent Startup, either use MIB Compiler UI option or Text/XML File / Runtime Memory option or API calls.
Using MIB Compiler UI
Select Project -> Settings menu from the MIB Compiler UI.
Select Proxy Panel.
Check Generate Agent as Proxy option.
By default, the OID Based Proxy option is enabled. Choose whichever proxy you prefer.
Check Trap Filtering Table option. By default, the Trap Receiver Port is 8005.
Select trapFilteringTable from the Proxy Panel and
Click Add to add the Subagent entries already existing in the Proxy Tables.
Using Text / XML File/ Runtime Memory
Once the entries are added through MIB Compiler UI and code is generated, the configurations are saved in a text or xml file namely TrapFilteringTable.xml/txt under <Agent Toolkit Home>/snmpprojects/projectname/agent/bin/conf directory. To make use of this text file or XML file storage,
Select Project -> Settings menu from the MIB Compiler UI.
Choose the Proxy Panel.
Check Generate Agent as Proxy option.
By default, the OID Based Proxy option is selected.
Select trapFilteringTable.
Choose XML or Text File from the Storage Type Option. By default, XML File is chosen.
These files can be edited to add Manager entries. The TrapReceiverTable.xml given below has been edited for adding a new Subagent entry with agent Trap Port : "8004" and agentCommunity : "private".
<?xml version="1.0" encoding="UTF-8"?> <Table> <row> <column name="agentHostType" value="IPv4" ></column> <column name="agentHost" value="127.0.0.1" ></column> <column name="agentTrapPortNumber" value="161" ></column> <column name="agentCommunity" value="public" ></column> <column name="agentStatus" value="1" ></column> </row>
<row> <column name="agentHostType" value="IPv4" ></column> <column name="agentHost" value="127.0.0.1" ></column> <column name="agentTrapPortNumber" value="8004" ></column> <column name="agentCommunity" value="private" ></column> <column name="agentStatus" value="1" ></column> </row> </Table> |
Please note that the agent has to be restarted for the changes to take effect.
Runtime Memory
Run-time memory can be used to store the Manager information in the agent Memory . Using this option does not store the entries in text files or XML files. To use the run-time memory for adding entries dynamically, follow the instructions given below:
Choose Project -> Settings menu from the menu bar of MIB Compiler UI.
Select Trap Filtering Table from the Proxy Panel.
Select Runtime Memory from Storage Type.
Add entries using the Add option.
After this, follow the steps given in adding entries From the Manager i.e During Runtime (13.9.3.2). Please note that once the agent is killed, the entries added are removed from the memory.
Using API Calls
Add the following piece of code in the generated Main file of Master agent after the code of Trap Table Listener instantiation i.e., above "trapTableListener.addRegistrationListener(hdlr);
trapTableListener.createAndAddTrapFilteringEntry(new Integer(1), "127.0.0.1", 161, "public"); |
This will also add entries to the Trap Filtering Table.
13.9.3.2 During Run Time
From the Manager
To add Subagent entries to the Master agent's Trap Filtering Table from the Manager, follow the steps given below :
Load AGENT-SNMP-CONFIG-MIB in the MIB Browser application.
Select trapFilteringTable from the subAgentTables module of agentConfiguration group, in the MIB.
Selecting the respective table and clicking on SNMP Table icon in MIB Browser open up a wizard wherein entries can be added to the trapFilteringTable.
The entries added from remote get updated in the text/xml file.
Please note that it is possible to access the table from remote only if "Remote Configuration" is enabled in the Proxy Panel of Project -> Settings menu in MIB Compiler UI.
For better understanding on sending traps through Master agent please go through the example available in <Agent Toolkit Home>/examples/snmp/traps/trapthroughmasteragent directory. The information in readme.html will help you run the example.
13.10 Security in Proxy (Using SNMPv3)
WebNMS SNMP Agent also supports Proxy Concept in SNMPV3. Mostly, the Master and Subagents run in a private network and the Manager in a private network. So the only communication that takes place is between a Manager and the Master agent. Hence, the agents running in a private network may not require SNMP V3 as they would be well secured.
Having this in mind, WebNMS's implementation provides only v1/v2c support to Subagents. Even if the Manager sends a request of V3 type, the Master agent being a V3 agent would convert the V3 request to a V1/V2c Request and forward the PDU to the Subagents. The V1/V2c Response would be further converted to a V3 response and sent back to the Manager.
13.11 Making WebNMS Agents as Subagents to Third-Party Agents (including OS Native agents )
Because the Master - Subagent communication uses SNMP PDU, any agent that understands SNMP can be made as Subagent to WebNMS Master agent. Even the Native agents can be made as Subagent to WebNMS Master agent. WebNMS agents can also be made as Subagents to Third-Party agents / Native agents. This helps to derive the data of the OS you prefer. The supported OS by WebNMS are Windows, linux, and Solaris.
13.11.1 Configuring WebNMS Agent as Subagent to Solaris Agent
To make WebNMS agent as Subagent to Solaris agent,
Generate an SNMP Agent using Agent Toolkit with the MIB file that you want to make as a Subagent.
Compile the class files.
To register this WebNMS agent as a Subagent to Solaris agent, go to the directory <Agent Toolkit Home>/snmpprojects/projectName/agent/bin from the command line and add the compiled classes in to a jar file.
This jar has to be created for the generated classes to be present in the classpath.
jar -cvf com.jar com |
Change the following entries in the files "sample-agent.reg" and "RunSolsticeAgent.sh" present under <Agent Toolkit Home>/subagents/solarisutils directory.
The "sample-agent-reg" file contains the details of the port number for which the Subagent is running and the OID to be proxied.
In RunSlosticeAgent.sh file, include the jar in the CLASSPATH that was earlier created from generated classes. Also, change the corresponding class that should run for this : com.myCompany.myPackage.AGENT_SAMPLE_MIB
Then, copy the following files from <Agent Toolkit Home>/subagents/solarisutils to /etc/snmp/conf directory of Solaris OS.
AdventNetSnmp.jar
AdventNetSnmpAgent.jar
AdventNetAgentUtilities.jar
AdventNetLogging.jar
AdventNetAgentRuntimeUtilities.jar
crimson.jar
jaxp.jar
xalan.jar
The GENERATED JAR
sample-agent.rsrc
sample-agent.reg
RunSolsticeAgent.sh
Go to /etc/rc3.d and execute S*snmpdx as follows (Where * represents a number) .
Use the command sh S*snmpdx stop for stopping the Solaris Master agent that is running already and sh S*snmpdx start to start the Solaris Master agent to start the WebNMS Subagent.
The Master agent starts at port 161 and the Subagent at 8001.
Now, invoke the MIB Browser application and load AGENT-SAMPLE-MIB.txt .
Change the port in the MIB Browser settings to 161 where the Master agent is running and do a GET request to the node tftpServername .The results will be given.
13.11.2 Configuring WebNMS Agent as Subagent to Windows Agent Using apadll
To make WebNMS agent as Subagent to Windows agent,
Create an SNMP agent (Subagent) using Agent Toolkit.
Go to <Agent Toolkit Home>/subagents/NTutils from the command prompt. Execute proxyReg.exe file. The "proxyReg.exe" is used to register the apadll.dll into the registry.
Enter the following details (as specified here) in the proxyreg file, which opens in the command prompt:
Enter the dll path : <Agent Toolkit Home>/dll/proxy/apadll.dll and press Enter
Enter the conf file path: <Agent Toolkit Home>/dll/proxy/snmp.conf and press Enter.
Instead of entering the details on prompt messages, the dll path and conf details can be given in the command line directly. This is possible by giving a space after proxyreg and entering the dll and conf path. Thus, the proxyreg directly starts with the required dll and conf path.
The snmp.conf file in <Agent Toolkit Home>/dll/proxy directory contains details about the port and the registered OID.
To start the registry, use regedit in Start -> Run which starts the registry of the Windows.
Now, start the command line agent (WebNMS agent) by executing the run.bat/run.sh file in the output directory.
The agent must be started at the port specified in the snmp.conf file. By default, the port is set to 8001.
Stop the SNMP service by selecting the Settings->Control Panel->Services option in Windows NT and restart it, which will invoke the apadll.dll and will wait for the PDUs (No JVM invocation is done here).
To test the same, start the MibBrowser application and load the MIB with which the Subagent was created.
Go to MibBrowser Settings and change the SNMP Version to Snmp_Version1 and port to 161 as Windows Master agent by default runs at port 8001.
Do a GET request to the OID specified in the snmp.conf file.
You will receive the response without any problem.
13.11.2.1 Sending Traps Through Windows Master Agent
Trap generation support is also provided when the WebNMS agent is made to act as Windows Subagent. To avail Trap generation support here:
Run the proxyReg.exe file from the directory <Agent Toolkit Home>/subagents/NTutils.
When started, it will prompt the following:
Enter the dll path : Enter the absolute path of apadll.dll file bundled with this example.
Enter the conf file path: Enter the absolute path of the snmp.conf file bundled with this example.
The following details
should have been edited in the snmp.conf file before running the proxyReg.exe
:
TRAP_RECEIVER(Y/N)=N : Make this as Y (Yes) to receive traps.
TRAP_RECEIVER_PORT= 8004. Change the port according to the requirement.
The Master agent (Windows agent) will listen for traps in this port.
Setting the Properties of the SNMP Service
Click the Start Button.
Go to Control Panel of the Settings Menu.
Double-click the Network icon in the Control Panel. Network Dialog will be opened.
Select the Services tabbed pane from the Network Dialog.
From the Network Services, double-click the SNMP Services. SNMP Properties dialog will be opened.
Select the traps tabbed pane from the SNMP Properties dialog.
Stopping and Restarting the SNMP Service
Click the Start Button.
Go to Control Panel of the Settings Menu.
Double-click the Services icon in the Control panel. Services dialog will be opened.
Select SNMP from the Services. Click the Stop button.
Select SNMP from the Services. Click the Start button.
Start the Trap Browser of WebNMS Mib Browser and listen to Trap at the port 162 for public community.
Run the agent by executing the file run.bat .
The Startup(Cold Start Trap ) trap sent by the agent will be received in the Trap Browser at port 162.
Do an SNMP set operation on the node agentNetstat of the utilities group (Mib : AGENT-SAMPLE-MIB). The Trap sent can be seen received in the Trap Browser at port 162.
13.11.3 Configuring WebNMS Agent as Subagent to Linux Agent
Generate an agent for AGENT-SAMPLE-MIB using Mib Compiler.
Compile the agent.
Start the WebNMS agent in port 8001.
Add a proxy
entry in the ucd-snmp agent in the file /etc/snmp/snmpd.conf as
proxy -c public -v 1 -p 8001 localhost .1.3.6.1.4.1.2162
If the UCD-SNMP Version is 5.0 and above then the entry in the conf
file should be added as
proxy -c public -v 1 127.0.0.1:8001 .1.3.6.1.4.1.2162
After adding the above entry in snmpd.conf file, restart the ucd-snmp agent.
Open MibBrowser and load AGENT-SAMPLE-MIB.
Access the subagent information browsing through the master agent, i.e., sending the request to the master agent.
This proxy feature is supported by 4.2.1
and higher versions of UCD-SNMP. We support Redhat Linux 7.2 that provides
4.2.1 UCD SNMP. We also support Red Hat Linux Advanced Server release
2.1AS/i686 to enable this feature.
13.11.4 MIB-II Support Using Native Agent as Subagent
All Operating Systems support MIB-II. Because our agent architecture support makes other third-party agents as Subagent to WebNMS Master agent, MIB-II support is not implemented. By making the Enterprise agent built using Agent Toolkit as Master agent and Native OS agent as Subagent, MIB-II support will be available through the Enterprise agent built using Agent Toolkit.
The example present under <Agent Toolkit Home>/examples/snmp/proxy directory will help you test the following functionalities.
Have a look at the readme.html for running the example.
![]() ![]() ![]() |