On 17 May 2011 at 11:04, Robert Story wrote:
> On Tue, 17 May 2011 09:05:05 +0200 Giuseppe wrote:
> GM> 2. Variables that are meaningful only if an optional hardware is 
> GM> installed in the electronic equipment. In this case, if the optional 
> GM> hardware is not present, I can't associate a value for related 
> GM> variables. Should I return an error code to GET and SET requests? 
> GM> Which error codes? SNMP_ERR_GENERR?
> GM> In the first I tried SNMP_ERR_RESOURCEUNAVAILABLE, but I think it is 
> GM> for other purposes.
> 
> For scalars, set the varbind to SNMP_NOSUCHOBJECT, eg
> 
>   netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
> 
> For table objects, use SNMP_NOSUCHINSTANCE.
> 
> Make sure you do not return an error from the function.

Now I understand.  The handler should returns always 
SNMP_ERR_NOERROR, but the variable should be marked with an error 
code with netsnmp_set_request_error().

Thank you for point me that.  I have tried returning the error from 
the handler and I had snmpwalk stopped at that OID.  Does 
netsnmp_set_request_error() solve the problem and let snmpwalk to 
cross the entire tree, even in presence of errors for some 
variables?


> GM> 3. Variables that are related to hardware sub-sections in the 
> GM> machine. What should I return if this sub-section stop communicating 
> GM> with the agent (for a mulfunction)? Which error code to choose?
> 
> SNMP_ERR_RESOURCEUNAVAILABLE.

Should I use netsnmp_set_request_error() as above, or should I 
return this error from the handler function?

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to