Re: How to get notified of a "set" operation

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 24 February 2010 00:43, Sylvain Dery <[email protected]> wrote:
> I'm writing a very basic snmp sub-agent consisting of a simple scalar.
> I generated the C skeleton code using mib2c.int_watch.conf; however I'd like
> to get notified when the scalar is setted as a result of a snmp set
> command.
> Any advice on how this could be achieved would be greatly appreciated.

The second parameter to netsnmp_create_handler_registration()
is the name of a user-provided "handler routine", which should be called
whenever a request for that OID (or group of OIDs) is received.

The basic operation of a watched scalar doesn't require such processing,
so this parameter is NULL.   But if you specify your own routine, then it will
be called for all relevant requests (GET* and SET).   You can then check
the details of the request, and handle SET requests appropriately.


See the other MIB module code files for examples of what this routine
should look like.

Dave

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.