response.getRequestID() + ", errorIndex=" + response.getErrorIndex() + ", " + "errorStatus=" + response.getErrorStatusText() + "(" + response.getErrorStatus() + ")"); response.getRequestID() + ", errorIndex=" + response.getErrorIndex() + ", " + "errorStatus=" + response.getErrorStatusText() + "(" + response.getErrorStatus() + ")");
protected void checkResponseError(PDU responsePDU) throws SnmpException { if (responsePDU == null) { SnmpException e = new SnmpException(SnmpException.NO_RESPONSE_PDU, -1); e.setSnmpErrorMsgProvider(getSnmpErrorMsgProvider()); throw e; } if (responsePDU.getErrorStatus() != 0) { SnmpException e = new SnmpException(responsePDU.getErrorStatus(), responsePDU.getErrorIndex()); e.setSnmpErrorMsgProvider(getSnmpErrorMsgProvider()); throw e; } }
response.getRequestID() + ", errorIndex=" + response.getErrorIndex() + ", " + "errorStatus=" + response.getErrorStatusText() + "(" + response.getErrorStatus() + ")"); response.getRequestID() + ", errorIndex=" + response.getErrorIndex() + ", " + "errorStatus=" + response.getErrorStatusText() + "(" + response.getErrorStatus() + ")");
response.getRequestID() + ", errorIndex=" + response.getErrorIndex() + ", " + "errorStatus=" + response.getErrorStatusText() + "(" + response.getErrorStatus() + ")"); response.getRequestID() + ", errorIndex=" + response.getErrorIndex() + ", " + "errorStatus=" + response.getErrorStatusText() + "(" + response.getErrorStatus() + ")");
throw new IOException("SNMP Timeout"); } else { int index = response.getErrorIndex() - 1; VariableBinding vb = response.get(index); logger.warn(response.getErrorStatusText() + " on " + vb.getOid().toString());
private void processResponse(final PDU response) throws SnmpException { try { LOG.debug("Received a tracker PDU of type {} from {} of size {}, errorStatus = {}, errorStatusText = {}, errorIndex = {}", PDU.getTypeString(response.getType()), getAddress(), response.size(), response.getErrorStatus(), response.getErrorStatusText(), response.getErrorIndex()); if (response.getType() == PDU.REPORT) { handleAuthError("A REPORT PDU was returned from the agent. This is most likely an authentication problem. Please check the config"); } else { if (!processErrors(response.getErrorStatus(), response.getErrorIndex())) { if (response.size() == 0) { // NMS-6484 handleError("A PDU with no errors and 0 varbinds was returned from the agent at " + getAddress() + ". This seems to be related with a broken SNMP agent."); } else { for (int i = 0; i < response.size(); i++) { final VariableBinding vb = response.get(i); final SnmpObjId receivedOid = SnmpObjId.get(vb.getOid().getValue()); final SnmpValue val = new Snmp4JValue(vb.getVariable()); Snmp4JWalker.this.processResponse(receivedOid, val); } } } buildAndSendNextPdu(); } } catch (final RuntimeException|SnmpException e) { handleFatalError(e); } }
private void processResponse(final PDU response) throws SnmpException { try { LOG.debug("Received a tracker PDU of type {} from {} of size {}, errorStatus = {}, errorStatusText = {}, errorIndex = {}", PDU.getTypeString(response.getType()), getAddress(), response.size(), response.getErrorStatus(), response.getErrorStatusText(), response.getErrorIndex()); if (response.getType() == PDU.REPORT) { handleAuthError("A REPORT PDU was returned from the agent. This is most likely an authentication problem. Please check the config"); } else { if (!processErrors(response.getErrorStatus(), response.getErrorIndex())) { if (response.size() == 0) { // NMS-6484 handleError("A PDU with no errors and 0 varbinds was returned from the agent at " + getAddress() + ". This seems to be related with a broken SNMP agent."); } else { for (int i = 0; i < response.size(); i++) { final VariableBinding vb = response.get(i); final SnmpObjId receivedOid = SnmpObjId.get(vb.getOid().getValue()); final SnmpValue val = new Snmp4JValue(vb.getVariable()); Snmp4JWalker.this.processResponse(receivedOid, val); } } } buildAndSendNextPdu(); } } catch (final RuntimeException|SnmpException e) { handleFatalError(e); } }
int errorIndex = responsePDU.getErrorIndex(); String errorStatusText = responsePDU.getErrorStatusText();
private void processResponse(PDU response) { try { if (log().isDebugEnabled()) { log().debug("Received a tracker PDU of type "+PDU.getTypeString(response.getType())+" from "+getAddress()+" of size "+response.size()+", errorStatus = "+response.getErrorStatus()+", errorStatusText = "+response.getErrorStatusText()+", errorIndex = "+response.getErrorIndex()); } if (response.getType() == PDU.REPORT) { handleAuthError("A REPORT PDU was returned from the agent. This is most likely an authentication problem. Please check the config"); } else { if (!processErrors(response.getErrorStatus(), response.getErrorIndex())) { for (int i = 0; i < response.size(); i++) { VariableBinding vb = response.get(i); SnmpObjId receivedOid = SnmpObjId.get(vb.getOid().getValue()); SnmpValue val = new Snmp4JValue(vb.getVariable()); Snmp4JWalker.this.processResponse(receivedOid, val); } } buildAndSendNextPdu(); } } catch (Throwable e) { handleFatalError(e); } }
int errorIndex = responsePDU.getErrorIndex(); String errorStatusText = responsePDU.getErrorStatusText();
if (command.getType() == PDU.INFORM) { int errorIndex = command.getErrorIndex(); int errorStatus = command.getErrorStatus(); int type = command.getType();
if (command.getType() == PDU.INFORM) { int errorIndex = command.getErrorIndex(); int errorStatus = command.getErrorStatus(); int type = command.getType();
/** * @param request * @return */ private PDU processGetNext(PDU request) { PDU response = request; response.setErrorIndex(0); response.setErrorStatus(0); response.setType(PDU.RESPONSE); Vector<? extends VariableBinding> varBinds = response.getVariableBindings(); for(int i = 0; i < varBinds.size(); i++) { VariableBinding varBind = varBinds.get(i); VariableBinding nextVarBind = m_agent.getNext(varBind.getOid()); if (nextVarBind == null) { if (response instanceof PDUv1) { if (response.getErrorIndex() == 0) { response.setErrorIndex(i+1); response.setErrorStatus(PDU.noSuchName); } } else { varBind.setVariable(Null.endOfMibView); } } else { response.set(i, nextVarBind); } } return response; }
/** * @param request * @return */ private PDU processGet(PDU request) { PDU response = request; response.setErrorIndex(0); response.setErrorStatus(0); response.setType(PDU.RESPONSE); Vector<? extends VariableBinding> varBinds = response.getVariableBindings(); for(int i = 0; i < varBinds.size(); i++) { VariableBinding varBind = varBinds.get(i); VariableBinding nextVarBind = m_agent.get(varBind.getOid()); if (nextVarBind == null) { if (response instanceof PDUv1) { if (response.getErrorIndex() == 0) { response.setErrorIndex(i+1); response.setErrorStatus(PDU.noSuchName); } } else { varBind.setVariable(Null.endOfMibView); } } else { response.set(i, nextVarBind); } } return response; }
translatedResponse.setErrorIndex(respPDU.getErrorIndex()); translatedResponse.setErrorStatus(respPDU.getErrorStatus()); } else {
translatedResponse.setErrorIndex(respPDU.getErrorIndex()); translatedResponse.setErrorStatus(respPDU.getErrorStatus());