creating a table-based subagent
Dana Heath <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I've successfully deployed my sub-agent which is based on a mib table.
However, the mib does not define an index for the table which is causing
an error during a request.
The generated code from mib2c is as follows:
void initialize_table_builtInPointingDeviceTable(void) {
netsnmp_table_registration_info *table_info;
if (my_handler) {
snmp_log(LOG_ERR,
"initialize_table_builtInPointingDeviceTable_handler
called again\n");
return;
}
memset(&cb, 0x00, sizeof(cb));
/** create the table structure itself */
table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
my_handler =
netsnmp_create_handler_registration("builtInPointingDeviceTable",
netsnmp_table_array_helper_handler,
builtInPointingDeviceTable_oid,
builtInPointingDeviceTable_oid_len,
HANDLER_CAN_RONLY);
if (!my_handler || !table_info) {
snmp_log(LOG_ERR, "malloc failed in "
"initialize_table_builtInPointingDeviceTable_handler\n");
return; /** mallocs failed */
}
/***************************************************
* Setting up the table's definition
*/
/*
* TODO: add any external indexes here.
*/
table_info->min_column = builtInPointingDeviceTable_COL_MIN;
table_info->max_column = builtInPointingDeviceTable_COL_MAX;
/***************************************************
* registering the table with the master agent
*/
cb.get_value = builtInPointingDeviceTable_get_value;
cb.container =
netsnmp_container_find("builtInPointingDeviceTable_primary:"
"builtInPointingDeviceTable:"
"table_container");
DEBUGMSGTL(("initialize_table_builtInPointingDeviceTable",
"Registering table builtInPointingDeviceTable "
"as a table array\n"));
netsnmp_table_container_register(my_handler, table_info, &cb,
cb.container, 1);
}
So my question... do table rows absolutely require an index or is there
a way to get around the absence of one? Thanks in advance,
Dana Heath
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
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