linux下安装Ipmi工具,调整服务器CPU风扇速度.

发布时间 2023-06-21 16:27:27作者: 埋头撸代码

安装ipmi工具

yum -y install ipmitool

加载模块

modprobe ipmi_si && modprobe ipmi_devintf && modprobe ipmi_msghandler

查看模块

lsmod |grep ipmi

开启风扇控制

设置风扇为手动模式

ipmitool raw 0x30 0x30 0x01 0x00

00 为手动模式 01为自动模式

设置CPU风扇转速

ipmitool raw 0x30 0x30 0x02 0xff 0x0a

编写一个脚本(Ai自动生成的)

#!/bin/bash

ipmitool raw 0x30 0x30 0x01 0x00

# 将输入的百分比转换为十六进制数
hex_value=$(printf '0x%02x' $1)

# 运行 ipmitool 命令
ipmitool raw 0x30 0x30 0x02 0xff $hex_value

保存为cpufanspeed.sh 文件.

chmod a+x cpufanspeed.sh
./cpufanspeed.sh 50

这样就可以设置风扇速度为50%的转速.