Where is errindex set in netsnmp for a SNMP SET request that fails?

426 Views Asked by At

When is the errindex supposed to be set to the appropriate value in the response PDU for an SNMP SET request that fails? Thank you!

1

There are 1 best solutions below

1
On BEST ANSWER

You actually don't set the error-index using the Net-SNMP API. The problem is that your loop over the requests should actually always return SNMPERR_SUCCESS to indicate the handler succeeded even if some of the SNMP request components didn't.

To indicate a particular request failed with an error message, you would use the following API:

                    netsnmp_set_request_error(reqinfo, request,
                                              SNMP_NOSUCHOBJECT);

for example. For picking the correct error to return, please see section 4.2.5 in RFC3416 which has a nice step-by-step procedure for returning the right error code for a given situation.