send_v2trap doesn't work for me.

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 ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-09-2006
abhinav.cs@gmail.com
 
Posts: n/a
Default send_v2trap doesn't work for me.

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.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:51 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0