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

List:       net-snmp-users
Subject:    Re: Not getting specific trap
From:       Dave Shield <D.T.Shield () liverpool ! ac ! uk>
Date:       2010-10-19 7:34:54
Message-ID: AANLkTin0cxo5NBw22rww9bhvJZPTJggcmRasUdrYZv0+ () mail ! gmail ! com
[Download RAW message or body]

On 18 October 2010 09:06, yogesh m <heart_manrao@yahoo.com> 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
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