Hello All,

I want to disable the ifTable and ifXtable implementation in the master agent
and register a private handler for the two oid in my sub-agent to handle the 
two mibs. 

the two oids are:

/*-----------------------------------------------------------*/
static oid aSubagentIfTable_oid[] = {1,3,6,1,2,1,2,2};
size_t aSubagentIfTable_oid_len   = OID_LENGTH(aSubagentIfTable_oid);

/*-----------------------------------------------------------*/
static oid aSubagentIfXTable_oid[] = {1,3,6,1,2,1,31,1,1};
size_t aSubagentIfXTable_oid_len   = OID_LENGTH(aSubagentIfXTable_oid);

At the run time and at the sub-agent handler registration time these errors are 
displayed
on the window where the sub-agent is running in the forground:
registering pdu failed: 263!
registering pdu failed: 263!

I assumed that there is one of these messages for each registeration call I 
have in my sub-agent.
my registration call code for ifXTable is as follow:


 netsnmp_mib_handler* handler = netsnmp_create_handler(
           "aSubagentIfXTable", &aSubagentIfXTable_handler );

   if (!handler)
   {
       snmp_log(LOG_ERR,
       "%s | agent create IfXTable MIB oid handler failed\n", __FUNCTION__);
       return -1;
   }

 regInfo = netsnmp_handler_registration_create( "aSubagentIfXTable", handler,
              aSubagentIfXTable_oid, aSubagentIfXTable_oid_len,
              HANDLER_CAN_RWRITE);

   if (!regInfo)
   {
       snmp_log(LOG_ERR,
       "%s | agent create IfXTable MIB oid handler registration failed\n", 
__FUNCTION__);
       return -1;
   }
 
   retVal = netsnmp_register_handler(regInfo);
   if ( retVal != MIB_REGISTERED_OK ) {
        snmp_log(LOG_ERR,
           "%s |  agent IfXTable handler registration failed \n", __FUNCTION__);
        return -1;

------------------------------------------------------------------------------------

similar code immediately after this is for ifTable oid registration.



I assumed that I have to recompile the master agent with 
--with-out-mib-modules="if-mib ip-mib tunnel" and --disable-mfd-rewrites
options to disable the if-mip and ip-mip implementation from the main agent. 
this resulted in smaller main agent and smaller libnetsnmpmibs.so files.

after restarting both agents only one of the "registering pdu: 263!" message 
was displayed.

In addition and when testing with snmpwalk command the ifTable request is not 
passed to my sub-agent while the ifXTable request is.


Is there anything else left for me to do to have the master (main) agent call 
my ifTable handler for all snmp requests on this mib?

thanks
Bernadette Eyre



 


------------------------------------------------------------------------------
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to