Snmp

Net-SNMP 中缺少 CPU 核心

  • March 11, 2022

OEL我有一台執行( ) 6.4的雙 Intel Xeon E5-2667 CPU(6 核 + HT)的伺服器,RHEL由於某種原因,對它的 snmp 查詢顯示只有 1 個 CPU 的核心。

這是輸出sensors命令。

[root@host log]# sensors
coretemp-isa-0000
Adapter: ISA adapter
Physical id 0: +56.0°C  (high = +96.0°C, crit = +102.0°C)
Core 0:        +55.0°C  (high = +96.0°C, crit = +102.0°C)
Core 1:        +50.0°C  (high = +96.0°C, crit = +102.0°C)
Core 2:        +52.0°C  (high = +96.0°C, crit = +102.0°C)
Core 3:        +55.0°C  (high = +96.0°C, crit = +102.0°C)
Core 4:        +52.0°C  (high = +96.0°C, crit = +102.0°C)
Core 5:        +56.0°C  (high = +96.0°C, crit = +102.0°C)

coretemp-isa-0001
Adapter: ISA adapter
Physical id 1: +43.0°C  (high = +96.0°C, crit = +102.0°C)
Core 0:        +43.0°C  (high = +96.0°C, crit = +102.0°C)
Core 1:        +41.0°C  (high = +96.0°C, crit = +102.0°C)
Core 2:        +42.0°C  (high = +96.0°C, crit = +102.0°C)
Core 3:        +41.0°C  (high = +96.0°C, crit = +102.0°C)
Core 4:        +40.0°C  (high = +96.0°C, crit = +102.0°C)
Core 5:        +41.0°C  (high = +96.0°C, crit = +102.0°C)

my/etc/snmp/snmpd.conf具有以下行以允許完全訪問:

view all    included  .1                               80

然而,當我對該伺服器進行 snmpwalk 時,會發生以下情況:

[root@host log]# snmpwalk -c public -v 2c localhost sensor
LM-SENSORS-MIB::lmTempSensorsIndex.1 = INTEGER: 1
LM-SENSORS-MIB::lmTempSensorsIndex.2 = INTEGER: 2
LM-SENSORS-MIB::lmTempSensorsIndex.3 = INTEGER: 3
LM-SENSORS-MIB::lmTempSensorsIndex.4 = INTEGER: 4
LM-SENSORS-MIB::lmTempSensorsIndex.5 = INTEGER: 5
LM-SENSORS-MIB::lmTempSensorsIndex.6 = INTEGER: 6
LM-SENSORS-MIB::lmTempSensorsIndex.7 = INTEGER: 7
LM-SENSORS-MIB::lmTempSensorsIndex.8 = INTEGER: 8
LM-SENSORS-MIB::lmTempSensorsDevice.1 = STRING: Physical id 0
LM-SENSORS-MIB::lmTempSensorsDevice.2 = STRING: Core 0
LM-SENSORS-MIB::lmTempSensorsDevice.3 = STRING: Core 1
LM-SENSORS-MIB::lmTempSensorsDevice.4 = STRING: Core 2
LM-SENSORS-MIB::lmTempSensorsDevice.5 = STRING: Core 3
LM-SENSORS-MIB::lmTempSensorsDevice.6 = STRING: Core 4
LM-SENSORS-MIB::lmTempSensorsDevice.7 = STRING: Core 5
LM-SENSORS-MIB::lmTempSensorsDevice.8 = STRING: Physical id 1
LM-SENSORS-MIB::lmTempSensorsValue.1 = Gauge32: 60000
LM-SENSORS-MIB::lmTempSensorsValue.2 = Gauge32: 44000
LM-SENSORS-MIB::lmTempSensorsValue.3 = Gauge32: 42000
LM-SENSORS-MIB::lmTempSensorsValue.4 = Gauge32: 42000
LM-SENSORS-MIB::lmTempSensorsValue.5 = Gauge32: 42000
LM-SENSORS-MIB::lmTempSensorsValue.6 = Gauge32: 41000
LM-SENSORS-MIB::lmTempSensorsValue.7 = Gauge32: 41000
LM-SENSORS-MIB::lmTempSensorsValue.8 = Gauge32: 44000

如何讓 snmp 報告所有 CPU 上核心的溫度?

似乎有些不對勁,因為您有這條線:

LM-SENSORS-MIB::lmTempSensorsDevice.8 = STRING: Physical id 1

但之後什麼也沒有,好像只有 8 個感測器插槽。有一個雙 Intel Xeon E5-2670(8 核)的錯誤報告,其中最後一個 Device 行是這樣的:

LM-SENSORS-MIB::lmTempSensorsDevice.10 = STRING: Physical id 1

所以那裡有 10 個插槽,同樣只有一個處理器。

一些 Ubuntu 指令成功顯示了 20 個插槽(那裡沒有“物理 id”行),儘管使用完全不同的處理器並使用 miscSensors 類別。他們在那裡說“根據 lm-sensors 安裝頁面,需要 Net-SNMP 5.5 或更高版本”,這是 RedHat 6.4 上的版本。

在任何情況下,您都可以嘗試升級 Net-SNMP 並查看是否可以解決問題。但也許這確實是 MIB 和特定處理器系列的問題,在這種情況下,需要解決該錯誤。

引用自:https://serverfault.com/questions/521656