On 22 March 2010 12:07, maxim maxim <[email protected]> wrote:
> 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);
OK - that's setting the OID of the trap that you wish to send.
> oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 5, 3 };
> size_t objid_snmptrap_len =OID_LENGTH(objid_snmptrap);
Not OK! Why have you changed this OID?
The OID of the object SNMPv2-MIB::snmpTrapOID is 1.3.6.1.3.1.1.4.1
So this second value should be left as
oid objid_snmptrap[] = { 1, 3, 6, 1, 3, 1, 1, 4, 1, 0 };
> I don't understand why the trap is not send. what's wrong here?
The first varbind in the payload specifies which trap you are sending.
This is of the form
snmpTrapOID.0 = {theOIDofMyTrap}
You've changed this to be
theOIDofMyTrap = {theOIDofMyTrap}
which is wrong.
The agent trap-handling code looks for the snmpTrapOID.0 assignment,
and rejects any request where this doesn't appear.
Dave
------------------------------------------------------------------------------
Download Intel® 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