Thank you Dave,I will try this now and write feedback later.
  
 my mostly problems can got solved in this list. It is make me very 
happy,Dave,you answered my many questions,and the answers are quite 
useful,thank you very much!
   
 Alex
  
  ------------------ Original ------------------
  From:  "Dave Shield"<d.t.shi...@liverpool.ac.uk>;
 Date:  Tue, Jul 27, 2010 05:16 PM
 To:  "Alexander King"<new...@foxmail.com>; 
 Cc:  "net-snmp-users"<net-snmp-users@lists.sourceforge.net>; 
 Subject:  Re: When I want to send trap the routine cannot run

  
On 27 July 2010 09:58, Alexander King <new...@foxmail.com> wrote:
> In my project ,I want to call sendtempJBODTempTrap() in init_uit()
No - I don't think you can send traps quite so early as that.
Remember that the individual module init_xxx routines are
called *before* the config files are read in (since this is where
per-module config directives are registered).
The trap destinations are typically set up via the config files,
so you can't start sending traps until after this is finished.
Instead there's a callback chain which is invoked after the
config files have been processed.   Try registering a routine
using
snmp_register_callback(SNMP_CALLBACK_LIBRARY,
SNMP_CALLBACK_POST_READ_CONFIG,
sent_temp_trap_callback, NULL);
and move the code to send the trap into this callback routine.
See (e.g.) mibII/vacm_conf.c  for an example of this callback in use.
Dave
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/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
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/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

Reply via email to