IPMI官方文档
https://github.com/ipmitool/ipmitool
一、基本连接方式 1 2 3 4 5 6 7 8 ipmitool [command ] ipmitool -I lanplus -H [BMC_IP] -U [username] -P [password] [command ] ipmitool -I lanplus -H [BMC_IP] -U [username] -p [password] [command ]
二、常用命令分类 1. 传感器信息相关 1 2 3 4 5 6 7 8 ipmitool sensor list ipmitool sensor get "CPU Temp" ipmitool sensor thresh "CPU Temp" upper 80 85 90
2. 电源管理 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ipmitool power status ipmitool power on ipmitool power off ipmitool power reset ipmitool power soft ipmitool power cycle
3. FRU(Field Replaceable Unit)信息 1 2 3 4 5 6 7 8 ipmitool fru print ipmitool fru print 0 ipmitool fru read 0 fru_board.bin
4. SEL(System Event Log)管理 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ipmitool sel list ipmitool sel elist ipmitool sel clear ipmitool sel time get ipmitool sel time set "now"
5. BMC配置 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ipmitool lan print ipmitool lan set 1 ipsrc static ipmitool lan set 1 ipaddr 192.168.1.100 ipmitool lan set 1 netmask 255.255.255.0 ipmitool lan set 1 defgw ipaddr 192.168.1.1 ipmitool user list 1 ipmitool user set name 2 newuser ipmitool user set password 2 "newpassword" ipmitool user enable 2 ipmitool channel setaccess 1 2 callin=on ipmi=on link =on privilege=4
6. 远程控制台 1 2 3 4 5 ipmitool -I lanplus -H [BMC_IP] -U [username] -P [password] sol activate
7. 传感器数据记录(SDR) 1 2 3 4 5 6 7 8 9 10 ipmitool sdr list ipmitool sdr elist ipmitool sdr type temperature ipmitool sdr type fan ipmitool sdr type voltage
8. 机箱状态 1 2 3 4 5 6 7 8 9 10 ipmitool chassis status ipmitool chassis policy list ipmitool chassis policy always-on ipmitool chassis policy previous ipmitool chassis policy stay-off
9. 固件管理 1 2 3 4 5 6 7 8 ipmitool mc info ipmitool mc reset cold ipmitool mc reset warm
10. 网络配置 1 2 3 4 5 6 7 ipmitool lan print 1 ipmitool lan set 1 ipaddr <新IP地址> ipmitool lan set 1 netmask <子网掩码> ipmitool lan set 1 defgw ipaddr <网关>
三、高级用法 批量执行命令 1 2 ipmitool -H [BMC_IP] -U [username] -P [password] -b [baud_rate] -t [device_type] < commands.txt
使用加密通道 1 2 ipmitool -I lanplus -H [BMC_IP] -U [username] -P [password] -C 17 [command ]
调试模式 1 2 3 ipmitool -d [debug_level] [command ]
四、注意事项
执行某些命令(如电源控制)需要管理员权限
频繁查询传感器可能会导致BMC负载增加
修改网络配置时要小心,错误的配置可能导致无法远程访问BMC
在生产环境中操作前建议先测试
不同厂商的IPMI实现可能有细微差别,某些命令可能不支持