My table handler function not getting called for the ifTable oid registration.
"sandeepa cs" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
I am using net-snmp agent with version 5.2.6 .
I am trying to register my own table handler function for the OID 1.3.6.1.2.1.2.2 (ifTable),
so that my table handler will call some other function to give the actual values.
But when i send the request for the oids inside the ifTable for example,
.1.3.6.1.2.1.2.2.1.7 (ifAdminStatus) my handler is not getting called.
I could see the answers coming from the default ifTable handler of Net-snmp.
Please see my below code for doing this.
Netsnmp_Node_Handler my_test_table_handler;
int
my_test_table_handler(netsnmp_mib_handler *handler,
netsnmp_handler_registration *reginfo,
netsnmp_agent_request_info *reqinfo,
netsnmp_request_info *requests)
{
printf("my_test_table_handler called..\r\n");
}
int init_AppReg(void)
{
oid my_table_oid[128] = {1, 3, 6, 1, 2, 1, 2, 2};
len = 8;
char str[512];
netsnmp_handler_registration *my_test;
netsnmp_table_registration_info *table_info;
my_test = netsnmp_create_handler_registration("myTable",
my_test_table_handler,
my_table_oid, len,
HANDLER_CAN_RONLY);
if (!my_test)
return;
table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, ASN_INTEGER, 0);
table_info->min_column = 1;
table_info->max_column = 22;
netsnmp_register_table(my_test, table_info);
printf(" registration done\r\n");
}
Kindly let me know if i need to do something more to take care of all the 22 oids of
ifTable so that my handler will be called instead of the default one.
Thanks and Regards,
Sandeepa CS.
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-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