I resolve the problem by my self. You are right, i forgot the following lines 
within the iterator function.

snmp_set_var_typed_integer(idx, ASN_INTEGER, entry->moduleIDIndex);
idx = idx->next_variable;

thx for your help

Norman Raedke

-------- Original-Nachricht --------
> Datum: Mon, 14 Feb 2011 15:56:58 +0000
> Von: Dave Shield <d.t.shi...@liverpool.ac.uk>
> An: normanrae...@gmx.de
> CC: net-snmp-users@lists.sourceforge.net
> Betreff: Re: initialize table problem

> On 14 February 2011 15:20,  <normanrae...@gmx.de> wrote:
> > i try to initialize some entries within a table,
> > but every time i get only the last insrted entry from the table.
> > It looks like an table iterator problem. I'm sure there are two entries.
> 
> Well, that's the first thing to check.
> You've got a debug statement within the initialisation block.
> What does this report when you run the agent?
> 
> 
> Then try adding some debugging statements to the
> 'get_first' and 'get_next' routines.
> What do they report when you query the table?
> 
> 
> 
> > netsnmp_variable_list *
> > moduleIDTable_get_next_data_point(void **my_loop_context,
> >                          void **my_data_context,
> >                          netsnmp_variable_list
> *put_index_data,
> >                          netsnmp_iterator_info *mydata)
> > {
> >    struct moduleIDTable_entry *entry = (struct moduleIDTable_entry
> *)*my_loop_context;
> >    netsnmp_variable_list *idx = put_index_data;
> >
> >    if ( entry ) {
> >        *my_data_context = (void *)entry;
> >        *my_loop_context = (void *)entry->next;
> >        return put_index_data;
> >    } else {
> >        return NULL;
> >    }
> > }
> 
> Where's the code to set the index values for this particular row?
> You need to update 'idx' with the current index value.
> 
> Dave

-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
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