Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在 linux + net-snmp 包中使用 SNMP 获取 CPU 数量(安装了默认的 net-snmp 包 mibs)?
UC Davis SNMP mib提供了很多 CPU 信息,但我没有看到 CPU 数量的对象。
取决于实现,但 HOST-RESOURCES-MIB hrDevice.hrDeviceTable 应该包含 CPU 数量的条目。
OID: .1.3.6.1.2.1.25.3.2
表中匹配的任何设备:
hrDeviceType: .1.3.6.1.2.1.25.3.1.3
表示 CPU/核心/超线程
还有 HOST-RESOURCES::hrDevice.hrProcessorTable 表,它应该指示它们的固件 ID,它应该可以帮助您区分核心/超线程和物理 CPU。