Dart.Snmp Namespace : Trap2Message Class |
<SerializableAttribute()> Public Class Trap2Message Inherits StandardMessage
Dim instance As Trap2Message
[Serializable()] public class Trap2Message : StandardMessage
[Serializable()] public __gc class Trap2Message : public StandardMessage
[Serializable()] public ref class Trap2Message : public StandardMessage
Three classes are included that specialize the Trap2Message class to standard NOTIFICATION-OBJECTs that are defined in RFC 1907:
1. Dart.Snmp.Trap2.coldStart
2. Dart.Snmp.Trap2.warmStart
3. Dart.Snmp.Trap2.authenticationFailure
This class replaces the NotificationMessage class in version 4.5 and prior.
Serializable using BinaryFormatter and XmlSerializer.
private void TrapSender_Load(object sender, EventArgs e) { //Set sysObjectId to your enterprise number (for Trap1). agent1.Variables.Add(agent1.Mib.GetByNodeName(NodeName.sysObjectID).GetIid(), agent1.Mib.CreateVariable(NodeName.sysObjectID, "1.3.6.1.4.1.52222")); } private void buttonSendTrap1_Click(object sender, EventArgs e) { //Send an SNMPv1 Trap agent1.Send(new Dart.Snmp.Trap1.warmStart(agent1.Variables[agent1.Mib.GetByNodeName(NodeName.sysObjectID).GetIid()].Value.ToString(), agent1.SysUpTime), myManagerAddress); } private void buttonSendTrap2_Click(object sender, EventArgs e) { //Send an SNMPv2 Trap (for SNMPv3, configure warmStart.Security.User) agent1.Send(new Dart.Snmp.Trap2.warmStart(agent1.SysUpTime), myManagerAddress); }
Private Sub TrapSender_Load(ByVal sender As Object, ByVal e As EventArgs) 'Set sysObjectId to your enterprise number (for Trap1). agent1.Variables.Add(agent1.Mib.GetByNodeName(NodeName.sysObjectID).GetIid(), agent1.Mib.CreateVariable(NodeName.sysObjectID, "1.3.6.1.4.1.52222")) End Sub Private Sub buttonSendTrap1_Click(ByVal sender As Object, ByVal e As EventArgs) 'Send an SNMPv1 Trap agent1.Send(New Dart.Snmp.Trap1.warmStart(agent1.Variables(agent1.Mib.GetByNodeName(NodeName.sysObjectID).GetIid()).Value.ToString(), agent1.SysUpTime), myManagerAddress) End Sub Private Sub buttonSendTrap2_Click(ByVal sender As Object, ByVal e As EventArgs) 'Send an SNMPv2 Trap (for SNMPv3, configure warmStart.Security.User) agent1.Send(New Dart.Snmp.Trap2.warmStart(agent1.SysUpTime), myManagerAddress) End Sub
System.Object
Dart.Snmp.MessageBase
Dart.Snmp.StandardMessage
Dart.Snmp.Trap2Message
Dart.Snmp.Trap2.authenticationFailure
Dart.Snmp.Trap2.coldStart
Dart.Snmp.Trap2.warmStart