[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-users
Subject:    Re: Using NET-SNMP API to Receive Traps
From:       <chrispdraycott () hotmail ! com>
Date:       2007-11-26 13:37:48
Message-ID: BAY124-DS165FE9A1742779F4E4036DE750 () phx ! gbl
[Download RAW message or body]

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" <D.T.Shield@liverpool.ac.uk>
To: <chrispdraycott@hotmail.com>
Cc: <net-snmp-users@lists.sourceforge.net>
Sent: Sunday, November 25, 2007 8:01 PM
Subject: Re: Using NET-SNMP API to Receive Traps

> On 22/11/2007, chrispdraycott@hotmail.com <chrispdraycott@hotmail.com> 
> 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
> Net-snmp-users@lists.sourceforge.net
> 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
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic