如何用python实现net-snmp中的mib模块?

发布于 2024-08-28 06:10:58 字数 250 浏览 2 评论 0原文

在常见问题解答中,我读到了“..代理还可以支持在 perl 或(从 5.4 开始)python 中实现的 MIB 模块”。 我已经构建了支持 python 的 net-snmp,但目前还不清楚如何使用 python 实际实现我自己的 MIB 模块。我在 python 目录中看到的 python 脚本与实现 snmp 客户端相关,而不是与 snmp 代理相关。也许我只是错过了某个地方的要点。有人可以给我一个关于如何开始使用这个的提示吗?

谢谢,

汤姆

in the faq, i read this "..the agent can also support MIB modules implemented in perl or (from 5.4) python."
I have built net-snmp with python support, but it's not clear yet how to actually implement my own MIB module with python now. The python scripts i see in the python directory are related to implementing an snmp client, not an snmp agent. Probably i just miss the point somewhere. Can someone give me a hint on how to get started with this?

Thanks,

Tom

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怪我鬧 2024-09-04 06:10:58

不幸的是,net-snmp 尚不支持在 python 中创建代理。如果您查看 net-snmp 源代码树的 python 目录中的自述文件,它会显示:

“netsnmp”模块提供功能齐全的三语言 SNMP(SNMPv3、SNMPv2c、SNMPv1)客户端 API。

看起来他们已经更新了常见问题解答并删除了任何提到蟒蛇。

如果您决定使用 python,则可以查看 PySNMP 作为替代方案。我对此没有任何个人经验,但该项目处于活动状态(最近一次更新是在今年 1 月),并且它看起来具有除 AgentX 支持之外的大多数功能(因此您无法创建连接到 snmpd 的子代理) )。

Unfortunately, net-snmp does not yet include support for agent creation in python. If you look at the README in the python directory of the net-snmp source tree, it says,

The 'netsnmp' module provides a full featured, tri-lingual SNMP (SNMPv3, SNMPv2c, SNMPv1) client API.

It looks like they've updated the FAQ and removed any mention of python.

If you are set on using python, you can checkout PySNMP as an alternative. I don't have any personal experience with it but the project is active (the most recent update was in January of this year) and it looks to have most features except AgentX support (so you can't create a subagent that connects to snmpd).

下雨或天晴 2024-09-04 06:10:58

pip 中有一个 AgentX pip 库,用于编写 Python SNMP 子代理。

There is an AgentX library in pip for writing Python SNMP sub-agents.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文