I've been happily dealing with GET requests in my perl handler (thanks for
the libraries that made that pretty easy). Now moving on to look at SET and
find myself puzzled. I'd welcome any help or pointers to additional docs.

My first goal is just to process setting a simple scalar value, but
eventually I will want to look at row creation so I'd like to understand
the bigger picture.

The example handler
<http://search.cpan.org/~hardaker/NetSNMP-agent-5.0401/agent.pm#Sub-agent_example>
shows
process a SET_ACTION request, but it doesn't indicate what if, anything I
am required to do.

 } elsif ($request_info->getMode() == MODE_SET_ACTION) {
           # ... (or use the value)
           $value = $request->getValue();
 }

First, processing relating to the value. I guess that I do whatever the
value means (eg. adjust a setting in the system that the MIB represents)
and perhaps adjust any cached values in my agent. I'm not clear whether I
also need to call request->setValue() or whether a subsequent GET just
picks up the new state.

Then the other aspect is to return something to my caller. Studying the C
code examples it looks like maybe all I need to do is call
request->setError() if there's a problem, and possibly setDelegated() if
there is deferred work. Seem like I then see the remaining SET stages occur
until we reach Commit.

Thanks for any comments or examples,
Dave
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to