On 18/03/2008, Siva Prakash Reddy G <[EMAIL PROTECTED]> wrote: > I have generated SNMP trap code using mib2c.notify.conf file. > Generated code compiled perfectly and executing perfectly but it is not > sending trap I don't Understood why?
Because you are using an agent-only API call in a non-agent application. > I have shown sample code below, please go thru it and help me out > where I'm doing wrong. > send_v2trap (var_list); You can *not* use this call to send the trap. You must use 'snmp_send'. See the code for snmptrap.c for details. > I just won't know How SNMP trap will be sent and how he will get > the > manager ipAddress and port no before sending a trap. Exactly - your application doesn't know where to send the trap. It's trying to use an agent-only call, but without the accompanying modules that provide this information. This is the wrong approach for a client-side application. > When I restart the agent I'm receiving the trap because I have written my > IPAddress in /etc/snmp/snmpd.conf file. How this is working. There is a separate MIB module which handles details of trap destinations for notifications sent by the agent. But this *ONLY* works for the agent. It doesn't work for client-side applications. Dave ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
