通过 SNMP 检索硬件信息
我正在尝试从一系列设备检索硬件信息,到目前为止,我使用 snmpget/snmpwalk 和以下 OID 1.3.6.1.2.1.25.3.2.1
但它返回的信息很少,例如我通过 Windows 操作系统在我的计算机上运行此程序,我得到了这些 CPU:
未知处理器
未知处理器
未知处理器
未知处理器
相反,如果我从 Debian 运行命令,我会得到正确的值:
正版英特尔:Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz
猜测有一个浮点协处理器
我知道 Windows 和 Linux 以完全不同的方式填充 MIB,但是,例如,它们的机器人似乎完全忘记其他设备,例如显卡或鼠标/键盘。 Windows 可以正确显示键盘,而 Linux 则不能。它们根本不显示显卡和声卡。该问题是否与我必须设置的某些选项有关?
如果我想获取更多信息(例如CPU频率)怎么办?
I am trying to retrieve hardware informations from a series of devices, so far I used snmpget/snmpwalk with the following OID 1.3.6.1.2.1.25.3.2.1
but it returns very few informations, for example if I run this on my computer from a Windows OS I get those CPUs:
Unknown Processor
Unknown Processor
Unknown Processor
Unknown Processor
Instead if I run the command from Debian I get the correct value:
Genuine Intel: Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz
Guessing that there's a floating point co-processor
I understand that Windows and Linux fill MIBs in a completely different way but, for istance, bot of them seem to completely forget about other devices such as video card or mouse/keyboard. Windows shows the keyboard correctly, Linux does not. Both of them don't show video card and sound card at all. Is the problem related to some options I have to set?
And what if I want to obtain MORE informations such as CPU frequency?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
HOST-RESOURCES-MIB,即上述 OID 所在的位置,实际上将描述有关系统上硬件的大量信息。但是:
对于 Linux 情况,您始终可以继续处理代码并将补丁提交回原始包(对于 Linux 来说当然是 Net-SNMP 包)。
还有 ENTITY-MIB,它旨在更好地对系统硬件进行建模,但我不知道 linux(或 windows)是否支持它。
最后,如果 Windows 计算机没有返回正确的结果,您始终可以在 Windows 计算机上运行不同的 SNMP 代理。 IE,我听说(但我自己不使用 Windows)Net-SNMP 代理在 Windows 上提供了比本机 SNMP 代理更优越的功能。
The HOST-RESOURCES-MIB, which is where the above OID lies, will in deed describe a fair amount about the hardware on the system. But:
For the linux case, you could always go work on the code and submit patches back to the original package (which for linux is certainly the Net-SNMP package).
There is also the ENTITY-MIB which is designed to model a system's hardware better, but I don't know of linux (or windows) support for it.
Finally, you could always run a different SNMP agent on the windows machine if it's not returning the right result. IE, I have heard (but don't use windows myself) that the Net-SNMP agent provides superior functionality on windows compared to the native SNMP agent.