[SNMP4J] Processing agentx-Notify-PDU in AgentXMasterAgent

Peder Toftegaard Olsen p.olsen at mobilethink.dk
Thu Mar 15 10:38:13 CET 2007


Hi,

AgentXMasterAgent returns an error when sending notifications. The error
code is 268 (processingError) and the error index is 2. I tracked it down to
AgentXCommandProcessor.notify(...). The validation of the first two variable
bindings is incorrect.

This is the original code:

  if ((vbs.length < 2) ||
      (SnmpConstants.snmpTrapOID.equals(vbs[1].getOid()))) {
    response.setErrorStatus(AgentXProtocol.AGENTX_PROCESSING_ERROR);
    response.setErrorIndex(2);
  }

It should be:

  if ((vbs.length < 2) ||
      (!SnmpConstants.snmpTrapOID.equals(vbs[1].getOid()))) {
    response.setErrorStatus(AgentXProtocol.AGENTX_PROCESSING_ERROR);
    response.setErrorIndex(2);
  }



Best regards

Peder Toftegaard Olsen
Senior Software Architect, Mobilethink A/S





More information about the SNMP4J mailing list