-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
puresnmp.exc.ErrorResponse: unknown error (status-code: 17) on OID 1.3.6.1.2.1.1.4.0 #62
Comments
This exception means that the device itself returns an error with the code But to make sure
and
In case this works, double-check that it is still broken in |
I think it could be related to the case when OID does not exist.
When I try to use Linux CLI based snmpget with the same OID it just return nothing. |
@alexxxe: the last line in the traceback says that the device returned an SNMP packet with an error-code of "5". These error codes are mapped to Python exceptions and are raised if a device returns such a packet. There is a special error-status (2) for non-existing OIDs. So it's either incorrectly reported as "general-error" by the device, or the OID exists, and something else is wrong on the device. I see this comes from a |
... actally, scratch my last comment about adding a more "forgiving" return value. The error-status is a field in the returning PDU, so unfortunately the whole respose packet is tagged as error and raising an Exception is the correct way of handling this. |
@exhuma , thanks for your response. I thinkg in my case device is incorrectly responsed with error-status: 5 on non-existing OID. And yes, this is still a problem in case when the one not exisiting OID fails the whole call. |
I'm actually not sure I can do anything about that. SNMP exchanges messages as "PDU" messages. The error-code is part of the top-level information in that PDU. The requested variables/values are embedded inside that PDU. The error-status "5" flags the whole PDU as erroneous. So in a way it is correct to raise this as an exception. Other errors like "NoSuchOID" or "NoSuchInstance" are actually error values which are not written into the PDU error-status field, but rather in the variable value. I will keep thinking on this. I am currently reading through the SNMPv3 RFCs to get support for that too, but I'm only advancing slowly. But I will need to keep some way in the code to raise errors if something goes wrong on the device. If I will make this more lenient, then devices which correctly return errors might lead to incorrect code/values downstream (in the client code). I prefer to "fail fast". I understand this is not a solution if you have a device which misbehaves, but which you still want to query via SNMP. I'm currently using |
I use the example in the doc,but I raise exception:
the exception as follows:
The text was updated successfully, but these errors were encountered: