Re: Consistent snmpget return value?

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 17/10/06, Naylor, Mark <[email protected]> wrote:
> I have a questions about snmpget and the (error) return
> codes. In particular I can get a return code 1 or 2 from
> the snmpget command depending on whether I load the standard mibs
> in /usr/local/share/snmp/mibs. I do not know if this intended.

Yes - it is.
A return code of 1 means that the application was unable to send the
request (for some reason or other).
A return code of 2 means that the application *was* able to send the
request, and the response indicated an error.

So 1 equates to "the client said No"
and 2 equates to "the agent said No"

In the first case you describe, the snmpget command recognises that
the request is invalid so never actually contacts the agent at all.
(Hence no packet dump is displayed).
In the second case, the snmpget command doesn't spot the problem
(because it doesn't have the MIB information), so it's the agent that
reports the problem - resulting in an error code of 2.

You'd probably get the same effect if you loaded the MIB files, but
used the option "-Ir" to disable the ranges checks.   (But I haven't
tested this)


Does that help make things clearer?

Dave

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.