SNMP Enterprise-specific Traps
To send an enterprise specific trap using SNMPAgent/SNMPTCPAgent, you must first set the TrapEnterprise configuration setting. By default, it has a value of 1.3.6.1.6.3.1.1.5 (i.e., SNMPv2-MIB::snmpTraps). After you set the TrapEnterprise setting, you set the trapOID parameter of the SendTrap method based on the kind of trap you want to send.
Sending a Generic SNMP Trap
If you simply want to send one of the generic SNMP traps, you can set trapOID to one of the trap name strings or full trap OIDs from the table below. For example:
C#
agent.Config("TrapEnterprise=1.3.6.1.4.1.42");
agent.SendTrap("RemoteHost", "coldStart");
Trap Name | Full Trap OID |
coldStart | 1.3.6.1.6.3.1.1.5.1 |
warmStart | 1.3.6.1.6.3.1.1.5.2 |
linkDown | 1.3.6.1.6.3.1.1.5.3 |
linkUp | 1.3.6.1.6.3.1.1.5.4 |
authenticationFailure | 1.3.6.1.6.3.1.1.5.5 |
egpNeighborLoss | 1.3.6.1.6.3.1.1.5.6 |
enterpriseSpecific | 1.3.6.1.6.3.1.1.5.7 |
Sending an Enterprise-specific Trap
If you want to send an enterprise-specific trap, you can set trapOID to a string that follows the format "6.x", where x is the enterprise-specific trap type (6 is the generic type that indicates an enterprise-specific trap). For example, if you wanted to send an enterprise-specific trap of type 5000:
C#
agent.Config("TrapEnterprise=1.3.6.1.4.1.42");
agent.SendTrap("RemoteHost", "6.5000");
We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at kb@nsoftware.com.