通过 SNMP 检索硬件信息

发布于 2024-12-20 13:07:07 字数 532 浏览 0 评论 0原文

我正在尝试从一系列设备检索硬件信息,到目前为止,我使用 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 技术交流群。

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

发布评论

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

评论(1

纵性 2024-12-27 13:07:07

HOST-RESOURCES-MIB,即上述 OID 所在的位置,实际上将描述有关系统上硬件的大量信息。但是:

  1. 系统确实需要支持它。您已经表明 Windows SNMP 代理显然没有列出正确的内容并且功能已损坏。
  2. 即使在 Linux 上,也不是系统中的每个组件都列出来,因为 MIB 不应该列出这些类型的组件,或者没有编写代码来使其工作。

对于 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:

  1. the system would indeed need to support it. You've shown that the windows SNMP agent clearly doesn't list the right things and is functionally broken.
  2. Not every component in the system is listed there even on linux, because either the MIB shouldn't be listing those types of components or the code wasn't written to make it work.

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.

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