通过SNMP检索硬件信息

编程入门 行业动态 更新时间:2024-10-11 13:28:50
本文介绍了通过SNMP检索硬件信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试从一系列设备中检索硬件信息,到目前为止,我使用了带有以下OID 1.3.6.1.2.1.25.3.2.1 的snmpget / snmpwalk。它返回的信息很少,例如,如果我是从Windows操作系统在计算机上运行的,则会得到以下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

未知处理器

未知处理器

未知处理器

相反,如果我从Debian运行命令,则会得到正确的值:

Instead if I run the command from Debian I get the correct value:

正品Intel:Intel(R)CoreTM i3 CPU M 330 @ 2.13GHz

Genuine Intel: Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHz

猜测有一个浮点协处理器

Guessing that there's a floating point co-processor

我了解Windows和Linux以完全不同的方式填充MIB,但就其本身而言,它们的机器人似乎完全忘记了其他诸如视频卡或鼠标/键盘之类的设备。 Windows可以正确显示键盘,Linux则不能。他们两个都根本不显示视频卡和声卡。问题是否与我必须设置的某些选项有关?

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?

如果我想获取更多信息(例如CPU频率)怎么办?

And what if I want to obtain MORE informations such as CPU frequency?

推荐答案

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

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:

  • 系统确实需要支持它。您已经证明Windows SNMP代理显然没有列出正确的内容,并且功能已损坏。
  • 即使在Linux上,也没有列出系统中的每个组件,因为MIB
  • 对于Linux案例,您不应该列出这些类型的组件或未编写使它起作用的代码。

    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).

    还有ENTITY-MIB,其目的是更好地模拟系统的硬件,但我不知道linux(或Windows)

    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.

    最后,如果未返回正确的结果,则始终可以在Windows计算机上运行其他SNMP代理。 IE,我听说过(但我自己不使用Windows),与本地SNMP代理相比,Net-SNMP代理在Windows上提供了优越的功能。

    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.

    更多推荐

    通过SNMP检索硬件信息

    本文发布于:2023-11-06 08:30:09,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1563197.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:硬件   信息   SNMP

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!