On Sat, 11 Dec 2004, Wes Hardaker wrote:

> >>>>> On Tue, 16 Nov 2004 18:37:56 +0530 (IST), madanagopal <[EMAIL 
> >>>>> PROTECTED]> said:
>
> If it is the case, can i do the following steps to send a v3 trap with
> different contexts:
>
> 1. Create a session using snmp_sess_init(session) and fill the v3
>    parameters(securityName,contextName etc.).
>
> 2. call setup_engineID(NULL,NULL)
>
> 3. open session using snmp_open(&session)
>
> 4. create a pdu using snmp_pdu_create(SNMP_MSG_TRAP)
>
> 5. add the varbinds to the pdu using snmp_add_var(......)
>
> 6. send the pdu using snmp_send(session, pdu)
>
> I want to know whether step 2 is correct. Specifically i want to send 
the
> trap with the agent's engine ID.
>
> Since i am doing this in my module which is part of the main agent, i 
will
> remove the trapsink lines from snmpd.conf and have everything read from 
my
> own conf file.
 
> madanagopal> 2. call setup_engineID(NULL,NULL)
> 
> You shouldn't ever have to call this (if you do it's likely that
> you're doing stuff you shouldn't or should be very careful about since
> you're messing with the internals of the library).
> 
> madanagopal> I want to know whether step 2 is correct. Specifically i
> madanagopal> want to send the trap with the agent's engine ID.
> 
> SNMPv3 INFORMs ***MUST*** use the security engineID of the receiving
> notification collector.  TRAPs ***MUST*** use the security engineID of
> the agent.  This is specified in the SNMPv3 specs and can't be changed
> without breaking interoperability.
> 

Ok. I will not do step 2. Since i am going to do all this as a module part 
of agent, should i create a new session and open it everytime for sending 
a new trap. All my traps are destined to one destination only. But my 
traps will have different context names. So can i create a session at the 
startup and change contextnames and create new pdu for every trap to be 
sent (or) should i create a new session with appropriate contextname for 
every trap to be sent?


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to