Hello, Dave Thanks for your reply. I may not specify clearly for the trap vaule :) The trap information should be: Trap OID <var name, var value> If the agent send out a trap, for example: OID, <sysLocation.0, "office"> My application want to receive the <name(sysLocation.0), value(office)>
Per your suggestion, is it better to have snmptrapd to call some program for this trap OID, and forward this <name, value> to my application? Thanks a lot! -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of ext Dave Shield Sent: Wednesday, January 06, 2010 5:50 PM To: Lv, Bo (EXT-Other - CN/Hangzhou) Cc: net-snmp-coders.org Subject: Re: Receive of snmp Trap 2010/1/6 Lv, Bo (EXT-Other - CN/Hangzhou) <[email protected]>: > the trap message sent from agent seems are the encoded message, Yes > I have to decode the message in my application for the trap information Correct. Use 'snmp_read()' to do this > it seems I need to implement the snmptrapd logic agian If you are writing a trap receiver then yes, you will effectively need to duplicate the functionality of snmptrapd. You might find it easier to let snmptrapd receive the trap, parse it, and pass the information off to your application. > the application need get the trap > information(trap name, trap value ) from the agent. What do you mean by "trap value"? A notification will typically include an OID (to identify which trap it is), and optionally, one or more varbinds (name/value pairs). But there is no single value associated with the trap itself. Dave ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
