PHP MIB 到 OID 解析

发布于 2024-09-24 20:07:03 字数 328 浏览 2 评论 0原文

我在谷歌上搜索了几天,找不到用于从 MIB 名称解析 OID 以及从 OID 解析 MIB 的明确方法/库。

我发现很少有网站拥有大型 MIB 数据库、搜索功能,即。但与他们通信需要 cURL/socket 连接和结果的正则表达式(或在某些情况下 eval)

我尝试自己解析 MIB 文件,但这又回到了在 php 女巫中编写语言解析器,是“疯狂”;)

我有存储/缓存机制工作得很好,每个 MIB 锁定只需完成一次,但是这一次锁定必须快速可靠

[编辑]呵呵,忘记了清除点,有没有什么工具/lib/method 快速可靠地锁定 MIB 和 OID?

I'm googling around for a couple of days, and can't find clear method/lib for resolving OID from MIB name, and MIB from OID.

I've found few sites that have a large MIB database, search functions ie. but communicate with them needs cURL/socket connectivity and regexp of results (or eval in some cases)

I've tried to parse MIB files myself, but this is returning to writing language parser in php witch, is "madness" ;)

I have storage/cache mechanism witch work well, and every MIB lockup has to be done only once, but this one lockup must be fast and reliable

[EDIT] heh and forgot about clearing the point, is there any tool/lib/method fast and reliable to lockup MIBs and OIDs?

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

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

发布评论

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

评论(1

戏剧牡丹亭 2024-10-01 20:07:03

如果您安装了 net-snmp,并且可以从 PHP 脚本执行程序,则可以使用 snmptranslate 将名称转换为 mib:

snmptranslate -IR sysName.0

此工具取决于您设置的 MIBDIRS 和 MIBS 环境变量,或提供适当的命令参数。 (有关环境变量和/或参数的详细信息,请参阅 man snmpcmd 。)

If you have net-snmp installed, and you can execute programs from your PHP script, you can use snmptranslate to go from a name to a mib:

snmptranslate -IR sysName.0

This tool depends on having your MIBDIRS and MIBS environment variables set, or supplying appropriate command arguments. (See man snmpcmd for details on the env vars and/or args.)

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