PHP MIB 到 OID 解析
我在谷歌上搜索了几天,找不到用于从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您安装了 net-snmp,并且可以从 PHP 脚本执行程序,则可以使用
snmptranslate
将名称转换为 mib:此工具取决于您设置的 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: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.)