On Fri, 2005-05-27 at 09:54, jigar contractor wrote:

> But what if I want to set some error explicitely while
> retriving some values using snmpget command.

You can't.
You *must* stick to the SNMP specifications - that's
what standards are all about.

The *only* valid errors/exceptions that can be returned
following a GET request are 'noSuchName' (SNMPv1) and
'noSuchObject'/'noSuchInstance' (SNMPv2c/SNMPv3).


In terms of your code, you should use netsnmp_set_request_error()
to set either SNMP_NOSUCHINSTANCE or SNMP_NOSUCHOBJECT
The main agent will take care of everything else.


>  How would I set error in response pdu sent fom sub agent......

Exactly the same way. Use netsnmp_set_request_error to set
SNMP_NOSUCHINSTANCE or SNMP_NOSUCHOBJECT.

Part of the design of the Net-SNMP MIB module API, is that it
works identically whether the mode is used within an AgentX
subagent, or a standalone SNMP agent.  No code changes are
needed at all.


Dave



-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to