18.0 Making the SNMPv2c Agent Compliant to SNMPv2c Standards

 


18.1 Overview

18.2 Enabling V2 Compliance

18.3 Supported Standards


 

18.1 Overview

 

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.

 

18.2 Enabling V2 Compliance

 

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.

 

18.3 Supported Standards

 

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.

 

18.3.2 System Group Support

 

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:

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(),

18.3.3 SNMP SET Group Support

 

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.

 

18.3.4 sysORTable

 

The sysORTable defined in SNMPv2 Mib has the following columns defined in it :

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

 



Copyright © 2013, ZOHO Corp. All Rights Reserved.