tablesnmpwalk on table not working via subagent - need help please
"Joan Landry" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <A9FCB77F97940A418A61FD9BB71E4170A1C672@dexbe012-6.exch012.intermedia.net> |
The documentation indicates that the following is obsolete: table_dataset - Helps you implement a table with automatted storage. This helper is obsolete. If you are writing a new module, please consider using the table_dataset2 helper instead. I have found no information about table_dataset2 helper. Does this exist? Can anyone clarify for me which code in net-snmp works for the purpose of implementing a table. Thanks, Joan Landry ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of Joan Landry Sent: Monday, April 21, 2008 11:44 AM To: [email protected] Subject: snmpwalk on table not working via subagent - need help please All, I sent a question on the snmp walk/get next issue last week. I have not had any replies. So I am not sure what that implies. Has anyone ever used these functions in a subagent? netsnmp_create_table_data_set netsnmp_table_set_add_indexes netsnmp_table_set_multi_add_default_row etc Does anyone know if these functions work for a table - besides a simple get/set of an object? I am having no success with using any of the mib2c generated code for the purpose of being able to do a get next or a walk on a simple table. I have tried all the different variations of mib2c using the many different .conf files. Nothing works for getting a get next or walk of a table to operate correctly. The details are in the original email that was sent out and pasted below. Should I be using the old style code such as: REGISTER_MIB("abc", abc_variables, variable4, variables_oid); Thanks for any help you can give - as I am really stuck. Joan ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of Joan Landry Sent: Thursday, April 17, 2008 2:18 PM To: [email protected] Subject: snmpwalk on table not working via subagent I have created the following table subagent code. I am able to walk objects in the table, but if I walk the entire table starting at the top of the table I get no data returned. Also, do the functions below work or should I be using the old style code: REGISTER_MIB("abc", abc_variables, variable4, variables_oid); So far I have spent days trying to get a mib walk to work with a very simple table, using the many different variations of mib2c and nothing I have done so far works. Please tell me what I could possibly doing wrong with this setup: table_set = netsnmp_create_table_data_set("sysORTable"); table_set->allow_creation = 0; netsnmp_table_set_add_indexes(table_set, ASN_INTEGER, 0); netsnmp_table_set_multi_add_default_row(table_set, COLUMN_SYSORINDEX, ASN_INTEGER, 0, NULL, 0, COLUMN_SYSORID, ASN_OBJECT_ID, 0, NULL, 0, COLUMN_SYSORDESCR, ASN_OCTET_STR, 0, NULL, 0, COLUMN_SYSORUPTIME, ASN_TIMETICKS, 0, NULL, 0, 0); table_set->table->store_indexes = 1; netsnmp_register_table_data_set(netsnmp_create_handler_registration ("sysORTable", NULL, sysORTable_oid, OID_LENGTH(sysORTable_oid), HANDLER_CAN_RONLY), table_set, NULL); row = netsnmp_create_table_data_row(); sysORIndex = 1; netsnmp_table_row_add_index(row, ASN_INTEGER, &sysORIndex, sizeof(sysORIndex)); netsnmp_set_row_column(row, COLUMN_SYSORID, ASN_OBJECT_ID, (u_char *)sysOidSpec[0].id, sysOidSpec[0].len); netsnmp_set_row_column(row, COLUMN_SYSORDESCR, ASN_OCTET_STR, sysOidSpec[0].sysOidDesc, strlen(sysOidSpec[0].sysOidDesc)); netsnmp_set_row_column(row, COLUMN_SYSORUPTIME, ASN_TIMETICKS, ptr, sizeof(long)); netsnmp_table_dataset_add_row(table_set, row); sysORIndex = 2; row = netsnmp_create_table_data_row(); netsnmp_table_row_add_index(row, ASN_INTEGER, &sysORIndex, sizeof(sysORIndex)); netsnmp_set_row_column(row, COLUMN_SYSORID, ASN_OBJECT_ID, (u_char *)sysOidSpec[1].id, sysOidSpec[1].len); netsnmp_set_row_column(row, COLUMN_SYSORDESCR, ASN_OCTET_STR, sysOidSpec[1].sysOidDesc, strlen(sysOidSpec[1].sysOidDesc)); netsnmp_set_row_column(row, COLUMN_SYSORUPTIME, ASN_TIMETICKS, ptr, sizeof(long)); netsnmp_table_dataset_add_row(table_set, row); this creates 2 rows - and if I walk sysORDesc I get both rows, if I start the walk at sysOrEntryTable I get nothing. Any help would be appreciated. Thanks, Joan Overture Networks Inc. The information contained in this message is privileged, confidential, and non-binding and is intended for use by the intended recipient or entity. All other uses, including distribution to third parties, are prohibited. Please notify the sender if you have received this message in error. Thank You, Overture Networks. Overture Networks Inc. The information contained in this message is privileged, confidential, and non-binding and is intended for use by the intended recipient or entity. All other uses, including distribution to third parties, are prohibited. Please notify the sender if you have received this message in error. Thank You, Overture Networks. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ 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