On 4 October 2012 01:38, Mark Gardinier <m...@advancedtechcorp.com> wrote:
>  ....  I can find the type of the
> data using  requests->requestvb->type.

First thing - remember that there may be more than one varbind passed
to the handler routine.   You shouldn't use 'requests->requestvb' directly.
Instead, the code should loop through the list of varbinds - something like

    for ( req = requests;   req;   req = req->next ) {
        type = req->requestvb->type;
        // etc


>                       However, I can't find the index, element, or whatever 
> its
> called.  I tried using both requests->index and requests->requestvb->index

         table_info = netsnmp_extract_table_info(req);
         // table_info->indexes contains a linked list of snmp
         //   variable bindings for the indexes of the table.



> but both are are set to 1.  The handler must be automatically called from
> the master agent.
>
> I check if reqinfo->mode == COMMIT.  When this is true, I need to pass the
> type, value, and index to my own routine.

If you are handling the SET processing during the COMMIT pass,
then you need to validate the incoming assignment *very* carefully.
The processing during the COMMIT pass must not fail.
(Either because of bad values, or assignments that are inconsistent
with the current state of the system, or other assignments in the same
SET request).
   The normal approach is to handle assignments in the ACTION pass,
and be prepared to reverse these in the UNDO pass.

There's more about this in the AGENT.txt file (which is somewhat old,
and described an earlier form of API, but the underlying multi-pass
model is still valid)

Hope this helps

Dave

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
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