Re: Query on accessing table data set values

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 30/01/2008, Namburi, Srivastava (IE10)
<[email protected]> wrote:
> netsnmp_table_set_multi_add_default_row(table_set,
>      COLUMN_PKTSTXD, ASN_INTEGER, 0, NULL, 0,
>      COLUMN_PKTSRXD, ASN_INTEGER, 0, NULL, 0,
>      COLUMN_PKTSDROPPED, ASN_INTEGER, 0, NULL, 0,
   0);

You seem to be missing the final '0' parameter, to mark the end
of the list.   You are also not providing a default value for any of
these column objects.


>     for(Counter=0;Counter<ROWNUM;Counter++)
>     {
>         row[Counter] = netsnmp_create_table_data_row();
>         netsnmp_table_row_add_index(row[Counter],
>              ASN_INTEGER, (char *)&tmp[Counter],sizeof(int));
>         netsnmp_table_dataset_add_row(table_set, row[Counter]);
>     }

So you have created various rows in the table, but not set any
column values in those rows.


>    when query the individual columns of this table, I do not get the data

But there isn't any data for you to get.
None of the columns have default values, and you haven't set values
explicitly.  So no, you won't get anything from this table.


Have a look at 'agent/mibgroup/examples/data_set.c'  for one way to
populate the table.   Or else consider providing a default value instead
of the "NULL, 0"  parameters when setting up the default row.

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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.