Is there any context in which an snmpget
request with version 2c can generate a response with a non zero error status?
After playing a bit with snmp tools provided by linux Net-SNMP applications, I could not find any such situation. In particular:
if the oid is not present in the agent mib then the agent replies with a value set to noSuchObject
same if the client cannot access the object (e.g., because some view has been defined)
if the community provided by snmpget
is wrong then the agent does not answer at all.
So I'm wondering whether this situation (having a positive error status in response of an snmpget
request) can occur at all.
The actual GET request processing is documented in RFC 3416 section 4.2.1,
https://datatracker.ietf.org/doc/html/rfc3416#section-4.2.1
and there are a few places/cases you must get an error response.
An actual SNMP agent must implement those error responses so as to be compliant with the standard, but it might add its own logic when needed. You can find a C# agent sample here to see how it handles GET requests and sends back error responses,