在 IPMI 中,使用 ipmitool sensor thresh 修改传感器的阈值时,不同传感器的可修改范围和生效方式可能不同,并不完全一致。以下是关键点分析:
并非所有传感器都允许修改阈值
CPU Status、PSU Status)是状态型传感器,无法修改阈值。ipmitool sensor list 查看传感器的 Threshold Readable 字段(若为 Yes 则可修改)。不同厂商的 BMC 实现可能不同
Inlet Temp 允许修改,但 CPU Temp 可能被锁定。lnr/lcr/uncr/ucr)的差异ipmitool sensor thresh 支持的阈值类型:
| 阈值缩写 | 全称 | 说明 |
|---|---|---|
| lnr | Lower Non-Recoverable | 低于此值 → 不可恢复错误 |
| lcr | Lower Critical | 低于此值 → 严重错误 |
| uncr | Upper Non-Critical | 高于此值 → 警告(非严重) |
| ucr | Upper Critical | 高于此值 → 严重错误 |
uncr/ucr,但可能不支持 lnr/lcr。立即生效 vs. 重启生效
持久化问题
ipmitool raw 调用 OEM 专有命令)。bash# 修改 Inlet Temp 的 Upper Non-Critical 阈值
ipmitool sensor thresh "Inlet Temp" uncr 40
✅ 通常成功,且立即生效。
bash# 尝试修改风扇转速阈值(可能失败)
ipmitool sensor thresh "Fan1" uncr 5000
❌ 可能返回错误:Unable to set sensor threshold(厂商可能锁定风扇控制)。
bash# 尝试修改 PSU 状态阈值(无意义)
ipmitool sensor thresh "PSU Status" uncr 1
❌ 返回错误:Sensor does not support thresholds.
查看传感器属性
bashipmitool sensor get "Inlet Temp"
Threshold Readable 和 Threshold Settable 是否为 Yes。尝试修改并检查返回值
bashipmitool sensor thresh "Inlet Temp" uncr 40
查询修改后的值
bashipmitool sensor get "Inlet Temp" | grep -i non-critical
权限问题
ipmitool 的用户有足够权限(通常需要 root 或 ipmi 组权限)。取值范围
0-100 摄氏度),超出范围会报错。OEM 差异
racadm、ilorest)。ipmitool sensor get 提前验证。本文作者:sea-whales
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!