Giter Club home page Giter Club logo

dotnetsnmp's Introduction

DotNetSnmp

Build codecov NuGet

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!

Try the NuGet Package

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 DotNetSnmp.Client;
using DotNetSnmp.Common.Definitions;
using DotNetSnmp.Protocol.V1;
using DotNetSnmp.Transport;
using DotNetSnmp.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
        )
    }
);

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

Output:

1.3.6.1.2.1.1.1.0 = String: SnmpTestAgentContainer
1.3.6.1.2.1.1.3.0 = Timeticks: (471603) 00:01:18:36.02

dotnetsnmp's People

Contributors

mvenditto avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

pemitic

dotnetsnmp's Issues

How to capture incoming snmp v3 traps

Hi there,

I am attempting to capture incoming SNMP v3 traps using a library like this. Do you have any examples of how I could do this using your library?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.