[SNMP4J] SET command problem with agentX

Frank Fock fock at agentpp.com
Wed Sep 27 19:19:13 CEST 2006


Hello Vincent,

Are you using a new SNMP4J-Agent version with SNMP4J-AgentX
than originally shipped?

In any case SNMP4J-Agent needs to be patched in
AbstractRequest.java as follows:

   public void setPhase(int phase) throws NoSuchElementException {
     if ((phase < 0) || (phase > getMaxPhase())) {
       throw new NoSuchElementException("Illegal phase identifier: "+phase);
     }
     if (this.phase != phase) {
       resetCompletionStatus();
     }
     this.phase = phase;
   }

This fix will be part of SNMP4J-Agent 1.0.1 and thus also
of SNMP4J-AgentX beta 1.

Best regards,
Frank


Vincent-v.LOPEZ at thalesgroup.com wrote:
> Hello, 
> 
> I am trying to implement a subagent using the TestSubAgent class as a base. My code is basically the same, except that I have created my own managed object (extending MOScalar with an overridden constructor and isValueOk method) with a read/write access and they are initialized with default values on the sub-agent start up. 
> 
> As a master agent, I use the TestMasterAgent class from SNMP4J AgentX.
> 
> I succeed in reading values without any problem. The problem is when I try to perform a set command, the return of the command is ok, but the value of the targeted managed object is not updated. 
> I understood that the update of a managed object is done in two phases. It seems that the prepare phase is done, but the commit phase never occurs (as I hit a breakpoint in the MOScalar prepare method, but never in the commit method).
> 
> Did I miss something in my subagent class or is there a problem when a SET command is processed?
> 
> Any help would be greatly appreciated. 
> 
> Thanks in advance.
> 
> Vincent Lopez.
> _______________________________________________
> 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