DotNetSnmp 0.9.7-alpha

.NET 6.0
This is a prerelease version of DotNetSnmp.
dotnet add package DotNetSnmp --version 0.9.7-alpha
NuGet\Install-Package DotNetSnmp -Version 0.9.7-alpha
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DotNetSnmp" Version="0.9.7-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotNetSnmp --version 0.9.7-alpha
#r "nuget: DotNetSnmp, 0.9.7-alpha"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install DotNetSnmp as a Cake Addin
#addin nuget:?package=DotNetSnmp&version=0.9.7-alpha&prerelease

// Install DotNetSnmp as a Cake Tool
#tool nuget:?package=DotNetSnmp&version=0.9.7-alpha&prerelease

SnmpDotNet

Build codecov

SnmpDotNet is a NET 6 SNMP client built ontop of System.Formats.Asn1 BER serialization capabilities.

ℹī¸ The library is in early development stage and subject to frequent api changes! <br> (At the moment it is actually the product of a weekend-project, so be nice 😃

Goals:

  • support for SNMP V1, V2c and V3
  • modern C# implementation with a focus on memory efficiency
  • low level api + higher-level abstractions to ease usage in common use cases

A Sneak peek of the Dispatcher API

using SnmpDotNet.Client;
using SnmpDotNet.Common.Definitions;
using SnmpDotNet.Protocol.V1;
using SnmpDotNet.Transport;
using SnmpDotNet.Transport.Targets;
using System.Net;

var targetAddress = new IPEndPoint(
    IPAddress.Parse("127.0.0.1"), 161);

var dispatcher = new SnmpDispatcher();

var response = await dispatcher.SendPdu(
    new BasicUdpTransport(targetAddress),
    new CommunityTarget("public"), // dafaults to v1
    targetAddress,
    new GetRequestPdu()
    {
        VariableBindings = new(
            "1.3.6.1.2.1.1.1.0", // sysDescr
            "1.3.6.1.2.1.1.3.0"  // sysUptime
        )
    }
) as GetResponsePdu;

foreach(var varBind in response.VariableBindings)
{
    Console.WriteLine(varBind);
}

Output:

1.3.6.1.2.1.1.1.0 = String: NetSnmpTestContainer
1.3.6.1.2.1.1.3.0 = Timeticks: (471603) 00:01:18:36.02
Product Versions
.NET net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.9.7-alpha 59 10/26/2022