[SNMP4J] Issues implementing master agent

Frank Fock fock at agentpp.com
Fri Feb 23 01:05:43 CET 2007


Hi Peder,

Thanks again for your feedback.

I have fixed these issues for the 1.0 release.
The second one can be fixed by:

   protected AgentXResponsePDU unregister(AgentXUnregisterPDU pdu,
                                          AgentXCommandEvent event,
                                          AgentXMasterSession session) {
     AgentXResponsePDU response = createResponse(pdu, session);
     if (session != null) {
       AgentXRegEntry regEntry =
           new AgentXRegEntry(session,
                              pdu.getRegion(),
                              pdu.getPriority(),
                              pdu.getContext(),
                              pdu.getTimeout());
       for (Iterator it = registrations.iterator(); it.hasNext(); ) {
         AgentXRegEntry r = (AgentXRegEntry) it.next();
         if (r.equals(regEntry)) {
           if (!removeRegistration(r, it)) {
 
response.setErrorStatus(AgentXProtocol.AGENTX_UNKNOWN_REGISTRATION);
           }
           break;
         }
       }
     }
     return response;
   }

Best regards,
Frank

Peder Toftegaard Olsen wrote:
> 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
> 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list