Hi All 
 
        I am new to net-snmp. I am using net-snmp-5.1.2 on a Slackware 9 
box.  I am trying to get an external c program (a sniffer) to send traps. 
I tried to implement notification.c and got the error msg. 
 
        send_trap: no v2 trapOID varbind provided 
 
Here's my code: 
 
    /* here's the OID of my enterprise spcific trap */ 
    oid          all_clear_notification_oid[] =  
                { 1, 3, 6, 1, 4, 1, 14782, 1, 3, 1 }; 
    size_t       all_clear_notification_oid_len =                        
                OID_LENGTH(notification_oid); 
    oid          objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 }; 
    size_t       objid_snmptrap_len = OID_LENGTH(objid_snmptrap); 
 
    /* the list of vars to be sent in the trap */ 
    netsnmp_variable_list *all_clear_notification_vars;   
 
    snmp_enable_stderrlog(); 
 
    snmp_varlist_add_variable(&all_clear_notification_vars, 
                              objid_snmptrap, objid_snmptrap_len, 
                              ASN_OBJECT_ID, 
                              (u_char *) all_clear_notification_oid, 
                              all_clear_notification_oid_len * sizeof(oid)); 
 
    send_v2trap(all_clear_notification_vars); 
 
    snmp_free_varbind(all_clear_notification_vars); 
 
 
Where do I add a varbind? and what, how and where do I add it? 
 
Also 
How do I send other argz in the trap ? 
 
 
David Waller 
 
p5.thanx 
 
 
 
 
Open WebMail Project (http://openwebmail.org) 


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to