it's my code for sending trap from subagent:

        oid  notification_oid[] ={1, 3, 6, 1, 6, 3, 1, 1, 5, 3};
        size_t notification_oid_len = OID_LENGTH(notification_oid);
        oid  objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 5, 3 };
        size_t  objid_snmptrap_len =OID_LENGTH(objid_snmptrap);
        snmp_varlist_add_variable(&notification_vars, objid_snmptrap,
objid_snmptrap_len,ASN_OBJECT_ID, (u_char *)notification_oid,
notification_oid_len);

send_v2trap(notification_vars); 

I don't understand why the trap is not send. what's wrong here?

B.R.

2010/3/22 Dave Shield <[email protected]>:
> On 22 March 2010 11:10, maxim maxim <[email protected]> wrote:
>> I want to send trap linkDown from subagent ; in the command line i can do it 
>> by
>> snmptrap -v 2c -c public 127.0.0.1 ""  IF-MIB::linkDown
>> or
>> snmptrap -v 2c -c public 127.0.0.1 "" 1.3.6.1.6.3.1.1.5.3
>>
>>
>> For sending this trap from subabagent i based on notification.c (see
>> below). My question is , what should be notification_oid in my case?
>
>    oid  notification_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 5, 3 };
>
> It's the OID of the trap that you want to send.
>
> Remember to add the payload varbinds that are specified
> in the MIB definition.   (i.e. ifIndex, ifAdminStatus and ifOperStatus)
>
> Dave
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to