문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top