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
-------------------------------------------------------------------------
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/
_______________________________________________
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