sending trap from subagent
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hello:
I only need sending trap support to the list configured in conf file (Dont need support for get/set atleast not yet)Version I am using: 5.4.2.1I have started snmpd from my bootup script as follows:/usr/sbin/snmpd -f -C -D -Dagentx -p /var/run/snmpd_m.pid -c /etc/snmp/snmpd_m.conf &>>/tmp/snmpd_m.log
Contents of snmpd_m.conf :trap2sink x.x.x.x public 162master agentxagentxsocket tcp:localhost:705rocommunity public
My process (has subagent code):
main() {
snmp_enable_stderrlog();
/* make us a agentx client. */ ret = netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, 1); ERROR("func %s set_boolean ret=%d\n", __func__, ret); if (ret != 0) { goto handle_error; }
/* initialize the agent library */ ret = init_agent(daemon_name); ERROR("func %s init_agent ret=%d\n", __func__, ret); if (ret != 0) { goto handle_error; }
/* example-demon will be used to read example-demon.conf files. */ init_snmp(daemon_name); while (..) { ... if (condition) send_example_trap(); }
}
send_example_trap() is defined in a library:{ // regular stuff followed by call to v2 trap /* * Send the trap to the list of configured destinations * and clean up */ send_v2trap( var_list ); snmp_free_varbind( var_list );
return SNMP_ERR_NOERROR;}
I need this kind of support because several of my processes would need to send traps. And the trap destination is set in the snmpd_m.conf file (and can be changed via configuration apis provided)
>From my daemon (acting as subagent) when send_example_trap is called I am doubting if the request is making to the snmpd acting as master agent. Any suggestions on what could be going wrong.
Thanks for the help.
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
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