On 17 March 2011 10:29, Ravi Kumar Kodam <rav...@cdotb.ernet.in> wrote: > When iam issuing get in netsnmp version 1 with wrong oid (like eg: > .1.3.6.1.2.1200.1.4.0) it is returning the following error string: > "(noSuchName) There is no such variable name in this MIB." this is agent > filling response->errstring as 2.
Yes - that is the correct response for SNMPv1 > When iam issuing get in netsnmp version 1 with wrong oid (like eg: > .1.3.6.1.2.1200.1.4.0) Do you mean version 1, or version 2c ? > it is returning the following error string:"No > Such > Object available on this agent at this OID". This is coming from library. In > this case the agent is filling response->errstring as 0. This is the correct response for SNMPv2c > why this difference. Because that is how the two versions of SNMP are defined. With SNMPv1, a missing value is treated as an error, and the response 'noSuchName' is returned. With SNMPv2c (and above), a missing value is treated as an *exception*. The difference becomes significant when you are querying for two or more values in the same request. With SNMPv1, the whole request will fail, and the querying application won't receive any useful information - just "there was something wrong with this particular varbind". With SNMPv2c, the request will succeed, and the agent will return values for all valid OIDs (and 'noSuchObject' or 'noSuchInstance' for the invalid ones). Try comparing the commands snmpget -Cf -v 1 -c public localhost .1.3.6.1.2.1200.1.4.0 sysDescr.0 and snmpget -Cf -v 2c -c public localhost .1.3.6.1.2.1200.1.4.0 sysDescr.0 Dave ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders