Version: 1.2.1.0
Create custom SNMP Manager, Trap and Agent applications for monitoring and controlling network devices. 

Snmp Agent .NET Component

Use the Snmp Agent component to easily build SNMP agents. Provides an easy-to-use interface that handles the details of processing and responding to an SNMP Manager's request. Features include:

  • Agent component generates responses to requests and can also initiate trap messages.
    • An event is raised when each request is received.
    • Default response messages are generated from OID (IID) values the application caches in the Agent.Variables property.
  • Supports SNMP versions 1, 2 and 3.
  • Requires no other system support besides basic Winsock transport.
  • No knowledge of SNMP message formats required.
  • Reads MIB files at design time and generates VB.NET or C# classes.
  • Reads MIB files at run time and generates dynamic classes for interpreting object identifiers.
  • Handles all Get/Set requests and error reporting. Automatically switches between v1, v2 and v3 messages.
  • Build a message by setting properties, adding variables (OIDs) using simple Variable Objects, and sending the message. It doesn't get any easier!

Interface

Public Constructors
Agent Overloaded. Initialize a new instance of the Agent class.
Public Properties
EngineId Used to get and set a byte array that identifies the SNMP engine.
Mib Gets the MibNodes object containing MIB definitions.
Socket Gets the Socket instance being used for network communications.
SynchronizingObject Gets or sets the synchronizing object used for raising events on the UI thread.
Tag Gets or sets any value you wish to associate with the agent.
Users  A table of authorized SNMP version 3 users with associated passwords.
Variables Used to store a list of Variable objects that are used to create a default ResponseMessage for each RequestMessage received.
Public Methods
Close Disables the Agent by releasing communication resources.
Open

Overloaded. Enables the Agent by binding it to a network address. Events will be raised when SNMP packets are received.

Send Overloaded. Send a message to the SNMP manager specified.
Public Events
DiscoverMessageReceived Raised when a version 3 manager is negotiating communications with the agent.
Exception Raised when an unexpected error or exception is found while processing data on the IO completion threat.
GetBulkMessageReceived Raised when an SNMP getbulk request is received.
GetMessageReceived Raised when an SNMP get request is received.
GetNextMessageReceived Raised when an SNMP getnext request is received.
SetMessageReceived Raised when an SNMP set request is received.

Code Example

This example demonstrates how to build a simple SNMP agent.

' VB.NET Example
' Create an Agent, populate with a single Oid, and call Open() to enable operation
Private Sub MainDialog_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
    Handles MyBase.Load
    ' Open using default Agent port of 161
    agent1.Open

    ' Initialize sysDescr OID with "My System Description"
    agent1.Variables.Add(New Variable(New Dart.PowerSNMP.MibObject.sysDescr(), "My System Description"))
End Sub

Private Sub agent1_GetMessageReceived(ByVal sender As Object, _ 
    ByVal e As Dart.PowerSNMP.MessageEventArgs) Handles agent1.GetMessageReceived
    ' For more control over your agent's response, you can inspect and modify e.Response.
    ' If the request is for sysDescr, then e.Response has been inialized with "My System Description"
    ' Otherwise, e.Response has been initialized with a 'NoSuchName' error.
    ' This event will be raised just before the default response is sent.
End Sub

Related Products: