2009/11/12 Goutham BG <[email protected]>:
> I am using net-snmp to send alarms generated in the system
> as SNMPv2 trap notifications.

Is this a standalone application, a separate subagent,
or a module within the main SNMP agent?

How are you sending the traps?

> As part of this I need a way to configure the trap receiver
> address and the community string from a C/C++ program
> (or a subagent).

If this is part of the main SNMP agent, then the easiest way
would probably be to call
     netsnmp_config("trapsink 10.20.30.40");

That sets up the trap destination, in exactly the same way
as the equivalent line in snmpd.conf would do.


If this is part of a standalone application, then it's up to you
to initialise the netsnmp_session structure used for sending
the trap.  So you can configure the appropriate destination
yourself.


If this is part of an AgentX subagent, then it's not really possible.
At least, not if using the 'sent_trap()' style of call.   The subagent
simply passes the notification off to the master agent, and it's
up to the master agent where these are sent.
   The only sensible approach here would be to send the traps
directly to the required destination.  In which case, this is
effectively a standalone application.   See the previous case.

Dave

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to