![]() ![]() ![]() |
18.1 Overview
18.3 Supported Standards
The SNMPv2c Agent does a lot of processing such as Authentication, Processing Requests, Sending Notifications, etc., as defined in the standards. You may encounter errors when doing the above functions. In such a case, the Management stations require the details of the errors. They might also need some common (standard) information such as sysName, sysUpTime, sysObjectId, etc., from the agents in order to define uniform management.
The above requirements are addressed using RFC 3418 (SNMPv2-MIB). It has different groups namely :System Group, Set Group, SNMP Group Counters, sysORTable, and SNMP Notification Group. WebNMS SNMP Agent has implemented this MIB and provides support for the same.
SNMPv2c Compliance can be enabled, either using MIB Compiler UI options or using API Calls.
Using MIB Compiler UI
By default, V2 Compliance is enabled for an SNMPv2c and SNMPv3 Agent. To disable it,
Clear the V2 Compliance option in Project -> Settings menu -> General Panel of MIB Compiler UI. |
Using API calls
To implement V2 Compliance through API calls, add the following piece of code in the main file generated below all the registrations made in initSnmpExtensionNodes()
// For Snmp Group counters support (for both v1 and v2) AgentSnmpGroup grp = new AgentSnmpGroup(); grp.addRegistrationListener(hdlr); super.addAuthenticationListener(grp.getAuthenticationListener()); // SysORTable support for SnmpV2 Compliance sysORTable = new com.adventnet.snmp.snmp2.agent.SysORTableRequestHandler((SnmpAgent)this, "conf", "SysORTable.xml", false); sysORTable.addRegistrationListener(hdlr); // System Group support for SnmpV2 Compliance SystemGroupInstrument instru = new SystemGroupInstrument(); super.addSystemGroupListener(instru); // SnmpSet Group support for SnmpV2 Compliance snmpSetGroupListener = new com.adventnet.snmp.snmp2.agent.SnmpSetRequestHandler((SnmpAgent)this); super.addSnmpSetGroupListener(snmpSetGroupListener); |
This would implement V2 Compliance. Also, include the following lines between the codes given for Variable Declarations in the Main file.
SNMPv2 Compliance supports the following groups along with their implementations.
18.3.1 SNMP Group Counters (Compliant to v1 Standards)
SNMP Group Counters are defined in SNMPv2 MIB to count the number of packets received in each category such as valid PDU, invalid PDU, bad authentication, GET, GET-NEXT, SET, etc., of an SNMP entity. The WebNMS Agent Toolkit has implemented these counters as per the RFC1213 MIB specification. This implementation is optional.
The WebNMS Agent Toolkit provides methods for instrumenting the System Group of SNMPv2 Mib. This group is a collection of objects common to all managed systems. The objects that are defined in this group are as follows:
sysDescr - Description of the managed node.
sysObjectID - Object Identifier of the node.
sysUpTime - Time (in hundredth of a second) since the network management portion of the system was reinitialized.
sysContact - Contact person for the managed node.
sysName - Name of the managed node.
sysLocation - Physical location of the node.
sysServices - Value that indicates the set of services offered by this node.
sysORLastChange - The value of sysUpTime at the time of the most recent change in state or value of any instance of sysORID.
Implementing a Listener To Read Your System Values
The SystemGroupListener class in com.adventnet.snmp.snmp2.agent package acts as an interface for the SystemGroup. You can implement this class to read the original values from your managed object. For example, you can have your own implementation of SystemGroupListener and add the registration code in the Main file, below all the registrations made in initSnmpExtensionNodes(),
SystemGroupListener impl = new MySystemGroupImpl(); super.addSystemGroupListener(impl); |
The WebNMS Agent Toolkit provides methods for instrumenting the SnmpSet Group of the SNMPV2 MIB. The objects defined in this group provide a locking mechanism for the Managers for providing SNMP SET requests. The object defined in this group is snmpSetSerialNo.
The sysORTable defined in SNMPv2 Mib has the following columns defined in it :
sysORIndex - the index column.
sysORID - the OID of the Mib Module supported by the Agent.
sysORDescr - the Description of the Mib Module.
sysORUpTime - the sysUpTime when the row was last instantiated.
18.3.4.1 Storing the Table Data
The sysORTable information gets stored in a data file called the SysORTable.xml. This file gets created under the conf folder in <Agent Toolkit Home>/snmpprojects/projectname/agent/bin directory. The Agent is started by reading this text file that contains the default entry as :
Index |
OID of Mib Module |
Description of Mib Module |
sysORUpTime |
---|---|---|---|
1 |
.1.3.6.1.6.3.1 |
The Mib Module for SnmpV2 entities. |
agent uptime |
![]() ![]() ![]() |