Geeks With Blogs

Lance's TextBox
By default, the IPWorks SNMPAgent component automatically sends certain variable bindings with an SNMPv2 or SNMPv3 trap: sysUpTime ( equal to SNMPAgent1.SysUpTime snmpTrapOID ( equal to TrapOID passed to the SendTrap method (i.e., "" which is coldstart) These are required in v2 and v3 traps. If you need to send more objects with your trap, and you modify the ObjId/ObjType/ObjValue variables, then you're responsible for setting ALL of the object ID's for the trap itself (e.g. the sysUptime and the snmpTrapOID). This means that the first two objects you add should be those mentioned above, like so:
SNMPAgent1.ObjCount = 4;

//add the sysUpTime:
SNMPAgent1.ObjId[1] = "";
SNMPAgent1.ObjValue[1] = SNMPAgent1.SysUpTime;
SNMPAgent1.ObjType[1] = otTimeTicks;

//add the snmpTrapOID
SNMPAgent1.ObjId[2] = "";
SNMPAgent1.ObjValue[2] = ""; //warmstart
SNMPAgent1.ObjType[2] = otObjectId;

//now add additional objects:
SNMPAgent1.ObjId[3] = ...
SNMPAgent1.ObjId[4[ = ...
Posted on Thursday, June 9, 2005 4:29 PM Programming | Back to top

Comments on this post: Sending SNMPv2/v3 Traps with additional variable bindings

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Lance Robinson | Powered by: