Hi,

I intended to implement a subagent with all tables in a MIB (ENTITY-MIB)
using handlers for each separately. Up on requesting a particualr table
data, net-snmp is triggering handlers for other tables also in that MIB
which are not wanted. How to avoid such unncessary handler triggers ? The
problem exists even if each table is implemented in separate subagent
processes.


    reg = netsnmp_create_handler_registration(
              "entPhysicalTable",     entPhysicalTable_handler,
              entPhysicalTable_oid, entPhysicalTable_oid_len,
              HANDLER_CAN_RWRITE
              );
    table_info->min_column = COLUMN_ENTPHYSICALDESCR;
    table_info->max_column = COLUMN_ENTPHYSICALURIS;
    iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info );
    iinfo->get_first_data_point = entPhysicalTable_get_first_data_point;
    iinfo->get_next_data_point  = entPhysicalTable_get_next_data_point;
    iinfo->table_reginfo        = table_info;
    netsnmp_register_table_iterator2( reg, iinfo );

similarly other 4 tables in ENTITY-MIB are also initialized in the
subagent.

Now, an snmp request for one table data is triggering get_first,get_next &
handlers of other table registrations as well which is wrong.

===master is running ====
sudo snmpd -f -Lo  -C --rwcommunity=public --master=agentx
Turning on AgentX master support.
NET-SNMP version 5.7.3

===== snmp request from user =====
snmptable -v 2c -c public -M+. -Ci localhost ENTITY-MIB::entPhysicalTable

===== debug prints from my subagent code ========
sreek : ------------ subagent_entityMIB in while loop
sreek : entPhysicalTable_get_first_data_point ---
sreek : entPhysicalTable_handler @@@  MODE_GET inclu=0
sreek : ------------ subagent_entityMIB in while loop
sreek : entPhysicalTable_get_first_data_point ---
.......
......

sreek : entLogicalTable_get_first_data_point ---
sreek : entLogicalTable_handler @@@  MODE_GET inclu=0
sreek : entLPMappingTable_get_first_data_point ---
.......
sreek : entLPMappingTable_handler @@@  MODE_GET inclu=0
sreek : ------------ subagent_entityMIB in while loop
.......
sreek : entAliasMappingTable_get_first_data_point ---
sreek : entAliasMappingTable_handler @@@  MODE_GET inclu=0
.......
sreek : entPhysicalContainsTable_get_first_data_point ---
sreek : entPhysicalContainsTable_handler @@@  MODE_GET inclu=0


Thanks,
Sreek
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to