Re: Using NET-SNMP API to Receive Traps

<[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Dave,

Thanks for your help on this. I had already managed to get the 
netsnmp_transport_open_server and snmptrapd_add_session calls working in my 
code for port 162 before your response but it was good to get confirmation 
of this from yourself.

Thanks for your time in replying.

Chris

----- Original Message -----
From: "Dave Shield" <[email protected]>
To: <[email protected]>
Cc: <[email protected]>
Sent: Sunday, November 25, 2007 8:01 PM
Subject: Re: Using NET-SNMP API to Receive Traps

> On 22/11/2007, [email protected] <[email protected]> 
> wrote:
>> I can see two functions that I think might be of use:
>>
>> netsnmp_transport_open_server and snmptrapd_add_session
>>
>> Are these the ones I need to be looking at?
>
> netsnmp_transport_open_server  and snmp_add (or snmp_open) yes.
> Those are the basic calls for setting up the listening ports.
> (snmptrapd_add_session is just a wrapper round snmp_add)
>
>>                     If so how do I just add a
>> session to just monitor traps on port 162 of my IP address?
>
>    transport = netsnmp_transport_open_server("snmptrap", "udp:162");
>    ss = snmptrapd_add_session(transport);
>
>
> This will then call the routine "snmp_input" whenever a request is 
> received.
>
> Dave
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> 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
>
> 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.