[SNMP4J] Issues implementing master agent

Peder Toftegaard Olsen p.olsen at mobilethink.dk
Thu Feb 22 12:53:35 CET 2007


Hi,

RC2 of SNMP4J-AgentX has fixed my previously reported issues, but some new
ones popped up while creating a master agent to help me test the sub agent I
am implementing:


1) IllegalArgumentException when I try to unregister a previously registered
table row.

The exception is thrown in AgentXRegisterPDU because the constructor checks
the PDU's type. But since AgentXUnregisterPDU is a subclass of
AgentXRegisterPDU this check fails and results in an
IllegalArgumentException.

To get on with my work I removed the check in AgentXRegisterPDU.


2) Warning when unregistering.

2007-02-22 12:20:00,578 WARN  [org.snmp4j.agent.agentx.master.AgentXMib]
Registration has been removed that was not previously added to the
AgentXMib:
org.snmp4j.agent.agentx.master.AgentXRegEntry[region=org.snmp4j.agent.agentx
.AgentXRegion[lowerBound=1.3.6.1.4.1.15204.666.1.1.1.1.1.1,lowerIncluded=tru
e,upperBound=1.3.6.1.4.1.15204.666.1.1.1.1.3.1,upperIncluded=false,rangeSubI
D=13,upperBoundSubID=3],priority=127,context=,timeout=0,id=null,session=org.
snmp4j.agent.agentx.master.AgentXMasterSession[peer=org.snmp4j.agent.agentx.
AgentXPeer[transport=org.snmp4j.transport.DefaultTcpTransportMapping at 2db19d,
address=127.0.0.1/2015,connectionTime=0,timeout=0,id=2,closing=false],sessio
nID=1,byteOrder=null,timeout=5,consecutiveTimeouts=0,agentCaps=null]]

I don't know if this is correct, but I ended up copying the four lines of
code to calculate the index OID from the REGISTRATION_ADDED case.


3) NPE when deallocating an index.

Fixed by adding "vbs[i] = new VariableBinding()" to
AgentXSharedMOTableSupport.deallocateIndex(.).



Best regards

Peder Toftegaard Olsen
Senior Software Architect
Mobilethink A/S




More information about the SNMP4J mailing list