On Wed, Dec 9, 2009 at 12:16 PM, Goutham BG <bggout...@gmail.com> wrote:

>
>
> On Tue, Dec 8, 2009 at 9:00 PM, Goutham BG <bggout...@gmail.com> wrote:
>
>>
>> On Tue, Dec 8, 2009 at 8:52 PM, Dave Shield 
>> <d.t.shi...@liverpool.ac.uk>wrote:
>>
>>> 2009/12/8 Goutham BG <bggout...@gmail.com>:
>>> > 9. // Open a SNMP session
>>> >    ss = snmp_add(&session,netsnmp_transport_open_client("snmptrap",
>>> >                session.peername), NULL, NULL);
>>>
>>>
>>> > What value does session.peername actually have?
>>> > Try something like    "udp:127.0.0.1"
>>>
>>>
>>> >Thanks. I will try that.
>>
>> >session.peername is set to IP address:port number.
>> >For example --- 47.152.236.77:159*
>> *
>>
>>
>
> >I tried with session.peername set to udp:47.152.236.77:159. But no
> success. As earlier, it is able to send trap for the 1st time. >After that
> snmp_add fails throwing an error "*No support for any checked transport
> domain*".
>
> >Please suggest any solution (may be any procedure call to re-initialize
> the transport domain? ) for this problem.
>
>

I have found a solution to this problem.

Solution:
------------
If I comment out snmp_shutdown from the steps that I have mentioned before,
the trap will be sent properly all the time.
That is, if snmp_shutdown() is not called after sending trap, then
snmp_add() doesn' t throw any error the 2nd time an attempt is made to send
another trap. Looks like snmp_shutdown() was doing something nasty which was
preventing the session from opening again.

But I am not sure whether not calling snmp_shutdown() after sending the
trap(and closing the session using snmp_close() ) is the right thing to do.

Can anyone please let me know whether there will be any side effects (memory
leaks etc) if we dont call snmp_shutdown() at the end of the application? Is
invoking snmp_close() enough to do all the clean up?

Thanks
Goutham B G
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to