Hi,
I have a table which has been defined & created in the following way.
Table initialization code snippet is as given below
table_set = netsnmp_create_table_data_set("myStatsTable");
table_set->allow_creation = 1;
netsnmp_table_set_add_indexes(table_set, ASN_INTEGER, 0);
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);
netsnmp_register_table_data_set(netsnmp_create_handler_registration
("myStatsTable ",
myStatsTable _handler,
myStatsTable _oid,
myStatsTable _oid_len,
HANDLER_CAN_RWRITE), table_set,
NULL);
/*
* Populated temp variable data to avoid having same index
*/
for(Counter=0;Counter<ROWNUM;Counter++)
{
tmp[Counter]=Counter+1;
}
/*
* create rows for the table, and add the data
*/
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]);
}
IN the Table handler Method, I get the oid indexes as given below
table_info = netsnmp_extract_table_info(requests);
and when query the individual columns of this table, I do not get the
data and also when I print
table_info->index_oid[0], the value will be zero.
If my understanding is correct, it has to be a non-zero value. But I am
not able to understand why it is not so.
Upon restarting the master-agent or sub-agent, the values can be fetched
properly and table_info->index_oid[0] also shows the appropriate values
of the table indices queried.
Is this an issue due to the improper registration of the sub-agent???
Please help me if anyone has encountered such problem and have found a
solution for that.
Regards,
Sri.
-------------------------------------------------------------------------
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