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.


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.

------------------------------------------------------------------------------
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