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

Code Examples

These code snippets can be copied and pasted into your project.



General Examples

Code Snippet Description
Non-blocking Operation Use Start and Marshal to work asynchronously in a Windows Forms application
Logging Requests Logging requests sent and responses received using the EncodedMessage property
Logging Messages Logging messages using the Log event
Sending Informs Sending an Inform message
Sending SNMPv3 Requests Sending a Secure SNMPv3 request
Adding SNMPv3 users Demonstrates adding a v3 user to an agent's Authoritative Engine, the process is identical for the manager component.


Agent Examples

Code Snippet Description
Basic Agent Operation Starting an agent that receives and responds to SNMP queries (sets, gets, etc)
Adding Variables to the Agent Adding variables to an agent's Variables collection
Responding to Requests Responding to a Get request for a value maintained outside of Agent.Variables
Populating a Table Populating a specific table with a pre-defined method
Populating a Table from an Array Populating an arbitrary table from a 2d string array on a local agent
Sending Traps Sending Traps
Sending MIB Defined Traps Sending a Trap defined in a loaded MIB


Manager Examples

Code Snippet Description
Listening for Notifications Listening for notifications (traps and informs), and responding to informs
Sending a Get Request Sending a Get request and receiving the response
Sending a Set Request Sending a Set request and receiving the response
Get Request Using MibNodes Sending a Get request for an object defined in a MIB loaded at runtime
Get Request Using Mib Code Files Sending a Get request for an object defined in a Mib code file
Single-threaded Get Requests Sending a Get request in a single-threaded application (demonstrates basics of single-threaded use)
Discovering Agents Discovering agents on your network with a broadcast Get request
Sending GetNext Requests Sending a GetNext request and receiving the response
Sending GetBulk Requests Sending a GetBulk request and receiving the response
GetTable Using GetNext Requests Getting an SNMP table using the GetTable method utilizing GetNext requests
GetTable Using GetBulk Requests Getting an SNMP table using the GetTable method utilizing GetBulk requests
Populating a Table Remotely Populating an arbitrary table from a 2d string array on a remote agent from a manager
Walk an Agent Walking an agent from a specified OID
Manually Walk an Agent Manually walk an agent using GetNext requests


Sample Projects

Samples are working applications demonstrating SNMP for .NET components in C#, VB.NET, C++/CLI and PowerShell. Source code included.

 

Sample Name Sample Description
Agent  Demonstrates responding to SNMP requests and sending trap and inform messages.
Manager  Demonstrates getting and setting Agent variables, sending and receiving inform messages, retrieving tables, and receiving traps.
Manager Task Async  Uses the Manager Component to build a simple manager. Supports queries for basic variables, either by discovery or specific address. Also shows how to set values. Uses GetResponseTaskAsync to retrieve variable values and send informs.
Trap Catcher  Demonstrates receiving and processing trap messages.
MIB Treeview  Demonstrates displaying mibs in a tree structure and on-demand mib parsing. Also demonstrates mib compilation into code files.
MIB Walker  Demonstrates discovering and retrieving variables supported by an agent under a specified OID.
SNMP Poll  Demonstrates simultaneous high-performance polling of numerous variables.
Web Manager (ASP.NET)  Demonstrates getting Agent variable values in a web application.
Web Service Manager Demonstrates getting Agent variable values in a web service application. Includes example consumer app.
WCF Service Manager Demonstrates getting Agent variable values in a Windows Communication Foundation (WCF) service application. Includes example consumer app.
WPF Simple Manager Demonstrates using the Manager component to build a simple manager in WPF
Agent Console Demonstrates a simple blocking Agent in a console application.
Trap Console Demonstrates a simple blocking trap catcher using the Manager component in a console application.
Agent Service Uses the Agent Component to build an agent as a windows service.
Trap Service Demonstrates a simple trap catcher using the Manager component in a windows service.

Application Projects

Applications are more sophisticated than samples and demonstrate more comprehensive functionality.

Application Name Application Description
Free SNMP Manager  Demonstrates a fully functional SNMP Manager application. WinForms C# source.

 

 Download SNMP Sample Projects