31.0 Migration Guide for SNMP Agents

 


Migration from 4.2 to 5.1.0

Migration from 5.0 to 5.1.0

Migration from 5.1.0 to 6.0.0


 

This section will be helpful for users who are using SNMP Agents in the earlier versions of Agent Toolkit Java Edition and now wish to migrate to the latest release of the Toolkit. The document explains how to

Migration from 4.2 to 5.1 Release

 

Move your Source files

Modify your Package Structure

 

The Package structure for certain imports have been modified and before generation the older imports have to be commented and new import statements have to be added. Package structure have been changed for the following import :

Code Generation Changes

The following table lists the details of code generation that has to be implemented in 5.1 while migrating from 4.2.
 

Functions

Current Implementation in 4.2

To be modified in 5.1.0

AgentSnmpGroup() method

AgentSnmpGroup grp = new AgentSnmpGroup();

AgentSnmpGroup grp = new AgentSnmpGroup(this);

acltable

acl = new com.adventnet.snmp.snmp2.agent. AclTableRequestHandler((SnmpAgent)this,
"conf","acl.txt",false);

aclTable = new

com.adventnet.snmp.snmp2.agent.

AclTable((SnmpAgent)this,"acl.txt","xml");

 

acl = new com.adventnet.snmp.snmp2.agent. AclTableRequestHandler((SnmpAgent)this,

aclTable);

 

Also the following line should be added in variable declarations

 

private com.adventnet.snmp.snmp2.agent.AclTable aclTable = null;

vacltable

super.setV1v2AccessControl(true);

com.adventnet.snmp.snmp2.agent.

VaclTableRequestHandler vacl = new com.adventnet.snmp.snmp2 .agent.VaclTableRequestHandler

((SnmpAgent)this, "conf", "vacl.txt", false);

vacl.addRegistrationListener(hdlr);

vaclTable = new

com.adventnet.snmp.snmp2.agent.

VaclTable((SnmpAgent)this,"vacl.txt","xml");

 

vacl = new com.adventnet.snmp.snmp2.agent. VaclTableRequestHandler((SnmpAgent)this,

vaclTable);

 

Also the following line should be added in variable declarations

 

private com.adventnet.snmp.snmp2.agent.VaclTable vaclTable = null;

 

Note: The OCTET STRING is handled as java.lang.String in 4.2 whereas it is handled as byte[] in 5.1.0 release.

 

Methods Modified

 

If you have instrumented your implementation with the entry methods, then be aware that the name and argument are changed in the latest release. Some of the methods of 4.2 release modified in this 5.1 release are as follows:

Forwarding Entry Class

V3 Forwarding Entry Class

Methods Deprecated

 

Have a look at the deprecated methods : -

  1. DynamicRegistrationWithCommunity, DynamicRegistrationWithInstance, & DynamicRegistration

  2. DynamicRegistrationWithInstance

  3. SnmpAgent.

  4. SnmpTrapService.

  5. AclTableRequestHandler

  6. VaclTableRequestHandler.

  7. Agent Param Options

  8. Traps

Usage of PropertyRegistraionListener is not recommended. (SingleAgent Bean option is completely deprecated)

All these methods will still work with 5.1.0 release of Agent Toolkit (Java Edition) tool as they have not been removed.

 

Methods Removed

 

The Methods that are removed from the 5.1.0 release of Agent Toolkit (Java Edition) Which were already in the deprecated List of 4.2 Release)

 

1. DynamicRegistrationWithCommunity

2. DynamicRegistrationWithInstance

3. DynamicRegistration

4. AclTableRequestHandler

5. Traps

Tool for Migration

 

Need for the tool

 

In this 5.1.0 release of Agent Toolkit Java Edition a few extra columns have been added to the following tables to achieve complete functionality.

These tables earlier present in AGENT-SAMPLE-MIB are now available in AGENT-SNMP-CONFIG-MIB. The Tables have been renamed as

respectively. The file names that created for these tables have also been renamed as follows :

 

Old Name

New Name

forwardingTable.txt/xml

V1V2TrapForwardingTable.txt/xml

v3forwardingTable.txt/xml

V3TrapForwardingTable.txt/xml

Subagent.txt/xml

ProxyTable.txt/xml

SubagentWithCommunity.txt/xml

ProxyTable.txt/xml

SubagentWithInstance.txt/xml

ProxyTable.txt/xml

 

If you are an user of the previous release you may have stored entries in these text files with the old columns. To make the new columns available in the old text files, this utility has to be used. The additional columns will be created with some default values.

 

How to run the tool

Details required for running the tool

 

You will have to provide the following information once the utility is made to run.

Migration from 5.0 to 5.1.0 Release

 

SnmpTrapAppender Method

 

This method has been modified in Release 5.1.0. To implement this feature in 5.1.0, please refer Sending Traps for Log Messages implemented using Log4j section in Sending Traps and Informs.

 

Other than this, there are no major changes involved while migrating from 5.0 to 5.1.0.

 

Migration from 5.1.0 to 6.0.0 Release

 

The following changes are involved while migrating from 5.1.0 to 6.0.0.

 

Modify your Package Structure

 

The package structure have been modified for certain imports. The following table depicts the changes in package structure in 6.0.0 compared to 5.1.0.  

 

Package Structure in 5.1.0 Package Structure in 6.0.0

com.adventnet.agent.utilities.common

com.adventnet.utilities.common (Common Utils)

com.adventnet.agent.utilities.xml

com.adventnet.utilities.xml.dom

com.adventnet.agent.utilities.xml.XMLIntender

com.adventnet.utilities.xml.indenter.XMLIntender

com.adventnet.agent.logging

com.adventnet.utilities.logging

 

Before generating the agent, you need to ensure that the latest package structure is followed.

 

In 5.1.0 release, the java.util.TooManyListenersException class was used. This has to be changed to com.adventnet.utils.agent.RegistrationListenerException class in 6.0.0.

 

Changes in Configuration Files

Backward compatibility is supported in the Agent Toolkit. So, if you are a 5.1 user having an older version of xml files, you can keep the 6.0.0 jars in the classpath and run the agent. The columns will be automatically added to the above-mentioned configuration files.



Copyright © 2009, ZOHO Corp. All Rights Reserved.