On Sat, 03 Jun 2006 09:18:32 +0000 Anurag wrote:
AV> In this context,  I have a table with dynamic row that can potentially
AV> have CREATE-WAIT set by the manager .  As per SNMP protocol, set for
AV> columns can comes in different SNMP PDU.   Let's say only column1 and col
AV> 2 is set and it comes in one PDU. Then col3 can come in different PDU. In
AV> addition, these columns are mandatory ( I don't wont to make them part of
AV> the index for the table). Unless all the mandatory parameter are received,
AV> I cannot call my backend API to create a row.
AV> 
AV> I would like the subagent to handle this SNMP specific stuff without the 
AV> backend knowing about all this.  So, ideally I would want subagent to 
AV> collect all columns set for a particular row and then call my API to
AV> create a row with all columns received.

As Wes said, this can be done. The code generated by the MFD handler can do
this.

AV> 1) In latest version of net-snmp, I read that there is a something called  
AV> row-context data structure. Does it handle the issue I have mentioned
AV> above ? I understand that there are two API that is generated per table.
AV> One to create a row context and other to commit it (either add/remove). I
AV> can understand that row context creation can happen when my RowStatus is
AV> set to createAndWait, but when will the commit function be called ? Is
AV> there anyway I can add a logic in subagent that once I received all 3
AV> columsn, then I call the commit function inside which in turn will  call
AV> my backend API ?

The commit function will be called for each PDU. You have to put code in the
commit routine to verify that all columns have acceptable values, and you
would only call the backend API when all columns are present and the row is
set to active. Again, the MFD helper generates templates to help with all this.

AV> 2) Is there any concept of caching out the cached data if for some reason
AV> I did not receive set for all mandatory columns I am  expecting. This
AV> might happen let say col1 and col2 is set and came in one PDU, however,
AV> for some reason col3 in second PDU did not arrive at the agent.
AV> ( say manager got disconnected), then in that case will that cached data
AV> be flushed out by the subagent.

This could easily be done by setting a timer callback when the row is
created/modified.

-- 
NOTE: messages sent directly to me, instead of the lists, will be deleted
      unless they are requests for paid consulting services.

Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
  • Re: Robert Story
    • Re: Dave Shield
      • Re: Wes Hardaker

Reply via email to