Hello,
I needed a table having 256 rows and 42 columns.
I got value from 1~256, but set function is not able to do over 129. The
response is "no such instance".
Could you give me a tip?
====function==============================================================================
{
netsnmp_table_row *row;
int value,k;
static netsnmp_table_data_set *ruRauTableSet;
static oid ruRauTable_oid[]= { 1,3,6,1,4,1,10000,20,3,2 };// RU-RAU Table
ruRauTableSet = netsnmp_create_table_data_set("ruRauTable");
ruRauTableSet->allow_creation = 1;
netsnmp_table_dataset_add_index(ruRauTableSet, ASN_OCTET_STR);
netsnmp_table_set_multi_add_default_row(ruRauTableSet,
1, ASN_INTEGER, 0, NULL, 0,// index
2, ASN_INTEGER, 0, NULL, 0,
3, ASN_INTEGER, 1, NULL, 0,
0);
netsnmp_register_table_data_set(netsnmp_create_handler_registration
("ruRauTable", handle_table, ruRauTable_oid, OID_LENGTH(ruRauTable_oid),
HANDLER_CAN_RWRITE),
ruRauTableSet, NULL);
for(k=0;k<256;k++)
{
row = netsnmp_create_table_data_row();
row->indexes->index;
value = 1+k;
netsnmp_table_row_add_index(row, ASN_INTEGER, (int *)&value, sizeof(int));
value =0;
netsnmp_set_row_column(row, 2, ASN_INTEGER, (u_char *)&value, sizeof(int));
netsnmp_set_row_column(row, 3, ASN_INTEGER, (u_char *)&value, sizeof(int));
netsnmp_mark_row_column_writable(row, 3, 1);
netsnmp_table_dataset_add_row(ruRauTableSet, row);
}
netsnmp_register_auto_data_table(ruRauTableSet, NULL);
}
======================================================================================
Pardon me, I have a poor skill in English.
Best regards,
*Edward Lee*
//
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
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