--===============0719732159==
Content-Type: multipart/alternative;
boundary="=_063c27521b2aa400668fdf58b37a0daa"

--=_063c27521b2aa400668fdf58b37a0daa
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit

Hi All,          There is a problem I'm facing with informs. Whenever I try sending a trap message using the function call send_v2trap(var_list), the notify request is not reaching master agent. So I tried with sleep for about 5 seconds before I call this function (send_v2trap(var_list)). And I could see the notify request being sent to master. But putting a sleep may cause my system being delayed, which I dont want to happen. So wat could be the reason my notify not being sent if I remove sleep. The notify file which I'm using was got from mib2c and here is code.#include <net-snmp/net-snmp-config.h>#include <net-snmp/net-snmp-includes.h>#include <net-snmp/agent/net-snmp-agent-includes.h>#include "notify.h"static oid      snmptrap_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };intsend_MyNotification_trap(void){    netsnmp_variable_list *var_list = NULL;    oid &nbsp
;           MyNotification_oid[] =        { 1, 3, 6, 1, 4, 1, 1001, 1, 101, 0, 1 };    oid             MyNotifyNum_oid[] =        { 1, 3, 6, 1, 4, 1, 1001, 1, 101, 999, 111, 0 };    oid             MyManagedObject_oid[] =        { 1, 3, 6, 1, 4, 1, 1001, 1, 101, 1000, 112, 0 };    /*     * Set the snmpTrapOid.0 value     */    snmp_varlist_add_variable(&var_list,                               snmptrap_oid, OID_LENGTH(snmptrap_oid),     &
nbsp;                        ASN_OBJECT_ID,                              bsrattributeValueChangeNotification_oid,                               sizeof                              (bsrattributeValueChangeNotification_oid));    /*     * Add any objects from the trap definition     */    snmp_varlist_add_variable(&var_list,       &
nbsp;                      MyNotifyNum_oid,                              OID_LENGTH(MyNotifyNum_oid),                               ASN_COUNTER,                              NULL, 0);    snmp_varlist_add_variable(&var_list,                               MyManagedObject_oid,  &
nbsp;                           OID_LENGTH(MyManagedObject_oid),                               ASN_OBJECT_ID,                              NULL, 0);    /*     * Add any extra (optional) objects here     */    /*     * Send the trap to the list of configured destinations     *  and clean up     */    /*sleep(5);*/      send_v2trap(var_list);    snmp_free_varbind(var_list); &nbsp
;  return SNMP_ERR_NOERROR;}


Regards,
Girish
--=_063c27521b2aa400668fdf58b37a0daa
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi All,

          There is =
a problem I'm facing with informs. Whenever I try sending a trap message us=
ing the function call send_v2trap(var_list), the notify request is not reac=
hing master agent. So I tried with sleep for about 5 seconds before I call =
this function (send_v2trap(var_list)). And I could see the notify request b=
eing sent to master. But putting a sleep may cause my system being delayed,=
which I dont want to happen. So wat could be the reason my notify not bein=
g sent if I remove sleep. The notify file which I'm using was got from mib2=
c and here is code.

#include <net-snmp/net-snmp-config.h><=
br />#include <net-snmp/net-snmp-includes.h>
#include <net-sn=
mp/agent/net-snmp-agent-includes.h>
#include "notify.h"

=
static oid      snmptrap_oid[] =3D { 1, 3, 6, 1, 6=
, 3, 1, 1, 4, 1, 0 };

int
send_MyNotification_trap(void) />{
    netsnmp_variable_list *var_list =3D NULL;

>    oid        &nbs=
p;    MyNotification_oid[] =3D
    =
    { 1, 3, 6, 1, 4, 1, 1001, 1, 101, 0, 1 };
 &nb=
sp;  oid          &n=
bsp;  MyNotifyNum_oid[] =3D
      &=
nbsp; { 1, 3, 6, 1, 4, 1, 1001, 1, 101, 999, 111, 0 };
  &nb=
sp; oid           &n=
bsp; MyManagedObject_oid[] =3D
      &nb=
sp; { 1, 3, 6, 1, 4, 1, 1001, 1, 101, 1000, 112, 0 };

 &nbs=
p;  /*
     * Set the snmpTrapOid.0 value
/>     */
    snmp_varlist_add_vari=
able(&var_list,
        &n=
bsp;           &nbsp=
;         snmptrap_oid, OID_LENGTH(=
snmptrap_oid),
         &=
nbsp;           &nbs=
p;        ASN_OBJECT_ID,
 &nbs=
p;            &=
nbsp;           &nbs=
p;   bsrattributeValueChangeNotification_oid,
  &n=
bsp;           &nbsp=
;            &n=
bsp;  sizeof
        &nbs=
p;            &=
nbsp;        (bsrattributeValueChangeNot=
ification_oid));

    /*
   &n=
bsp; * Add any objects from the trap definition
   &nbs=
p; */
    snmp_varlist_add_variable(&var_list,

>            &n=
bsp;           &nbsp=
;     MyNotifyNum_oid,
    &nb=
sp;            =
             OI=
D_LENGTH(MyNotifyNum_oid),
       &=
nbsp;           &nbs=
p;          ASN_COUNTER,
=
            &nb=
sp;            =
     NULL, 0);
    snmp_varlist_add=
_variable(&var_list,
       &nb=
sp;            =
          MyManagedObject_oid,=

           &nb=
sp;            =
      OID_LENGTH(MyManagedObject_oid),
 =
            &nb=
sp;            =
    ASN_OBJECT_ID,
      =
            &nb=
sp;           NULL, 0); r />
    /*
     * Add any ext=
ra (optional) objects here
     */

&nbs=
p;   /*
     * Send the trap to the list=
of configured destinations
     *  and clean=
up
     */
    /* =3D"font-weight: bold;">sleep(5);*/ 
    s=
end_v2trap(var_list);
    snmp_free_varbind(var_list);<=
br />
    return SNMP_ERR_NOERROR;
}




Regards,

Girish
ding=3D0 style=3D'font-family:Verdana;font-size:11px;line-height:15px;'>
>

iff.com/signature-home.htm/1050715198@Middle5/2031747_2024537/2031627/1?PAR=
TNER=3D3&OAS_QUERY=3Dnull' target=3Dnew > ff.com/cgi-bin/AdWorks/adimage.cgi/2031747_2024537/creative_2031627.gif' a=
lt=3D'Monster' border=3D0>

--=_063c27521b2aa400668fdf58b37a0daa--


--===============0719732159==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
--===============0719732159==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
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/...net-snmp-users

--===============0719732159==--