Hello all,
I am experiencing a strange problem. I have written a simple common
handler for MOD_GET a MOD_GETNEXT.
The handler seems to work fine but certain SNMP requests are not passed to
the handler.
Example:
snmpget -v 1 -c public localhost .1.3.6.1.2.1.1.1.1 is passed.
snmpget -v 1 -c public localhost .1.3.6.1.2.1.4.1.1 is NOT passed.
The handler is registered for 1.3.6.
It does not matter if I run the agent as main agent or subagent, behaviour
is the same.
Would somebody give me a hint what I am doing wrong? Obviously, I am
missing something.
Thanks for your help.
Milan
int agentx_subagent = 0;
static oid root_oid[] = { 1, 3, 6 };
/* we're an agentx subagent? */
if (agentx_subagent) {
/* make us a agentx client. */
netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_ROLE, 1);
}
/* initialize tcpip, if necessary */
SOCK_STARTUP;
/* initialize the agent library */
init_agent("ippc_agent");
/* ippc agent will be used to read ippc_agent.conf files. */
init_snmp("ippc_agent");
/* If we're going to be a snmp master agent, initial the ports */
if (!agentx_subagent) {
init_master_agent(); /* open the port to listen on (defaults to
udp:161) */
}
netsnmp_mib_handler *handler =
netsnmp_create_handler("common_handler", &common_handler );
handler_reg = netsnmp_handler_registration_create( "common_handler",
handler,
root_oid,
OID_LENGTH(root_oid),
0);
netsnmp_register_handler(handler_reg);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
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