Question

I use SNMP4J and try to set some value.

        Variable var = OctetString.fromHexString(v);
        VariableBinding varBind = new VariableBinding(new OID(o),var);
        pdu.add(varBind);
        pdu.setRequestID(new Integer32(1));
        pdu.setType(PDU.SET);
        Snmp snmp = new Snmp(transport);
        ResponseEvent response = snmp.set(pdu, comtarget);
        if (response != null){
            PDU responsePDU = response.getResponse();
            if (responsePDU != null){
                int errorStatus = responsePDU.getErrorStatus();
                String errorStatusText = responsePDU.getErrorStatusText();
                if (errorStatus == PDU.noError) return responsePDU.get(0).getVariable().toString();
                else return errorStatusText;
            }else return "No response";
        }else return null;

Its work fine, but sometimes i got error Undo failed
Does any one know what the reason of this error and how can I fix it?

Was it helpful?

Solution

The error code Undo Failed means that

  1. You tried to set more than one variable in a single request
  2. One of the set attempts failed
  3. While trying to rollback the entire operation (i.e. undo the completed changes), another error prevented completing the undo

This is essentially telling you that it doesn't know how much of the original set operation was completed, and things might be left in an inconsistent state. I don't know enough about SNMP error reporting details to know if the response contains additional error codes describing the earlier problem.

BTW, it took all of 20 seconds to find this information using Google.

OTHER TIPS

There is little hope for you to fix, as if you dive into the RFC document,

http://www.ietf.org/rfc/rfc1448.txt

On page 25 the reason for undoFailed is documented.

Strictly speaking this is caused by the SNMP agent, and only its vendor can tell how to avoid it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top