This is a discussion on send_v2trap doesn't work for me. within the SNMP Coders forums, part of the Networking and Network Related category; Greetings everyone! I am a newbie to the net-snmp world. I have written a MIB and used mib2c to ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Greetings everyone!
I am a newbie to the net-snmp world. I have written a MIB and used mib2c to generate the corresponding c code (say fooMIB.h and fooMIB.c). The fooMIB.c has declarations to send a trap in a function called send_Foo_Trap() which calls send_v2trap as follows: int send_Foo_trap( void ) { netsnmp_variable_list *var_list = NULL; oid ppSystemStartup_oid[] = { 1,3,6,1,4,1,8707,2,1,1,20 }; snmp_varlist_add_variable(&var_list, snmptrap_oid, OID_LENGTH(snmptrap_oid), ASN_OBJECT_ID, (u_char*)ppSystemStartup_oid, OID_LENGTH(ppSystemStartup_oid)*sizeof(oid)); send_v2trap( var_list ); snmp_free_varbind( var_list ); DEBUGMSGTL(("fooMIB","Sent Foo_trap\n")); return SNMP_ERR_NOERROR; } Now my question is if I have to send the trap from my application code, do I just need to call the send_Foo_trap from within the application? When I do so, I do not see trap being sent out in snmpd.log (I start snmpd with -DALL and I do not even see the fooMIB message (the DEBUGMSGTL in send_Foo_trap())in the snmpd.log) however I do see the fooMIB getting initialized in the snmpd.log. I will appreciate any help offered in this regard. Thanks, Abhinav. |