SNMP: Sending Enterprise-Specific Traps
To send an enterprise-specific trap using SNMPAgent or SNMPTCPAgent, you must first set the TrapEnterprise configuration setting. By default, it has the value 1.3.6.1.6.3.1.1.5 (i.e., SNMPv2-MIB::snmpTraps). After setting TrapEnterprise, set the trapOID parameter of the SendTrap method based on the kind of trap you want to send.
Sending a Generic SNMP Trap
To send a generic SNMP trap, set trapOID to one of the trap name strings or the full trap OID from the table below.
C# Example
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
To send an enterprise-specific trap, set trapOID to a string in the format "6.x", where x is your enterprise-specific trap type (6 is the generic type indicating an enterprise-specific trap).
C# Example (Enterprise Trap Type 5000)
agent.Config("TrapEnterprise=1.3.6.1.4.1.42");
agent.SendTrap("RemoteHost", "6.5000");
This will send an enterprise-specific SNMP trap of type 5000 to the specified remote host.
We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.