Re: Not getting specific trap
Dave Shield <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On 18 October 2010 09:06, yogesh m <[email protected]> wrote: > In this i am trying to generate my Trap for first system status of first > row. > /** Initializes the telecrbt module */ > void init_telecrbt(void) > { > initialize_table_teleSysResourceTable(); > send_mySysDown_trap(); > } I wouldn't try to send the trap directly from the module initialisation routine. It's very unlikely that the trap destinations will have been set up at this point, since this routine is called *before* the config files are processed. Instead, register a callback routine, to be invoked after the config files have been read in: snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_POST_READ_CONFIG, send_mySysDown_callback, NULL); And invoke the 'send_mySysDown_trap()' routine from there. Although if this is a sysDOWN trap, rather than a sysUP trap, you might actually be better off registering the callback as snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_SHUTDOWN, send_mySysDown_callback, NULL); so the trap is sent when the agent shuts down, not when it's just started up. Dave ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ 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