如何在 C# 中编写 SNMP 代理或 SNMP 扩展代理 DLL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/136206/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 15:03:59  来源:igfitidea点击:

How can I write an SNMP agent or SNMP extension agent DLL in C#

提问by zvikara

I need to write an SNMP agent for my application.

我需要为我的应用程序编写一个 SNMP 代理。

I read the CodeProject articleon how to write an SNMP extension agent DLL using win32, but would like to know if it is possible to do it with managed code.

我阅读了关于如何使用 win32 编写 SNMP 扩展代理 DLL的CodeProject 文章,但想知道是否可以使用托管代码来完成。

Also, is it possible to write my own SNMP agent in managed code and run it along windows SNMP service? windows SNMP service is required to run on my server to provide the basic operating system management info.

另外,是否可以在托管代码中编写我自己的 SNMP 代理并沿着 Windows SNMP 服务运行它?Windows SNMP 服务需要在我的服务器上运行以提供基本的操作系统管理信息。

What C# SNMP library would you recommend? I found a few C# SNMP protocol implementations, but could not find sample code on how to implement an SNMP agent - most samples are only about querying other agents or sending traps.

您会推荐什么 C# SNMP 库?我找到了一些 C# SNMP 协议实现,但找不到关于如何实现 SNMP 代理的示例代码 - 大多数示例只是关于查询其他代理或发送陷阱。

回答by shiva

  1. the best library I have used in 8 years of NMS development - adventnet
  2. you can write your own, but you need to understand ASN. Good luck with that.
  3. SNMP agents do 2 things: query for data, send and receive traps. What else you want them to do? wash your laundry?! (sorry couldn't resist that! :) ).
  1. 我在 NMS 开发 8 年中使用过的最好的库 - adventnet
  2. 您可以自己编写,但您需要了解ASN。祝你好运。
  3. SNMP 代理做两件事:查询数据、发送和接收陷阱。你还想让他们做什么?洗衣服?!(对不起,无法抗拒!:))。

What are you trying to do with your SNMP agent?! Does you app need to send traps?! or query for data from a node?!

你想用你的 SNMP 代理做什么?!你的应用程序需要发送陷阱吗?!或从节点查询数据?!

回答by mabra

If you would like to use the SNMP protocol from the .Net Framework, regard this library: #SNMP.

如果您想使用 .Net Framework 中的 SNMP 协议,请考虑以下库:#SNMP

It seems possibly to write your own SNMP server with it. But the standard SNMP Agent archictecture is not based on .Net und so - I assume - you cannot use the mentioned library to extend it. You must write your own and this looks possible with the mentioned library.

似乎可以用它编写自己的 SNMP 服务器。但是标准的 SNMP 代理架构不是基于 .Net und 所以 - 我假设 - 你不能使用提到的库来扩展它。您必须自己编写,并且使用提到的库可以实现这一点。

Hope this help.

希望这有帮助。

br--mabra

br--马布拉