1.协议、端口
远程模式下,IPMI使用RMCP,RMCP基于UDP协议实现。
远程监控也就是基于UDP的网络通信。
服务器IPMI使用的端口一般是623.
2.interface
2.1 接口简介
-I interface
open
lan
lanplus
其他
2.2 判断使用何接口
lan及lanplus主要用于远程监控,如果没有-I选项,ipmitool默认使用open,即Linux OpenIPMI,lanplus是lan的增强版
其中lan对应ipmi 1.5版本,lanplus对应ipmi 2.0版本
如果能看到IPMI信息,就说明支持ipmi,比如下面就是pe 2950 的输出,注意Version 是2.0,远程登录时使用lanplus接口
[root@host ~]# dmidecode |sed -n '/IPMI/,+5p'
IPMI Device Information
Interface Type: KCS (Keyboard Control Style)
Specification Version: 2.0
I2C Slave Address: 0x10
NV Storage Device: Not Present
Base Address: 0x0000000000000CA8 (I/O)
或者通过ipmitool在主机上直接获取
[root@localhost ~]# ipmitool mc info
Device ID : 19
Device Revision : 3
Firmware Revision : 1.20
IPMI Version : 2.0
Manufacturer ID : 47196
Manufacturer Name : Unknown (0xB85C)
Product ID : 8192 (0x2000)
Product Name : Unknown (0x2000)
Device Available : yes
Provides Device SDRs : no
Additional Device Support :
2.3 连接时报错
Error: Unable to establish LAN session
可能使用的接口不正确,尝试切换换lan/lanplus
3.远程执行方式
ipmitool -I lan|lanplus -H 服务器地址 -U root -P 密码
eg. ipmitool -I lanplus -U Administrator -P -H 192.168.1.143 list sensor
4.电源控制
power off (硬关机,直接切断电源)
power soft (软关机,即如同轻按一下开机扭)
power on (硬开机)
power reset (硬重启)
power status (获取当前电源状态)
power cycle (注意power cycle 和power reset的区别在于前者从掉电到上电有1秒钟的间隔,而后者是很快上电)
5.用户管理
常见的用户配置命令:
5.1 查看用户清单
root@master:~# ipmitool user list 1
ID Name Callin Link Auth IPMI Msg Channel Priv Limit
1 ADMIN false false true ADMINISTRATOR
5.2 创建用户:
格式: ipmitool user set name 用户ID 用户名
新注册用户Privilege Level 默认为NO ACCESS
root@master:~# ipmitool user set name 3 aaa
root@master:~# ipmitool user list 1
ID Name Callin Link Auth IPMI Msg Channel Priv Limit
3 aaa true false false Unknown (0x00)
5.3 设置密码:
格式: ipmitool user set password 用户ID号 密码
root@master:~# ipmitool user set password 3 123.com
Set User Password command successful (user 3)
5.4 给用户权限
格式:ipmitool channel setaccess 1 用户ID callin=on ipmi=on link=on privilege=值 【on为开启、off为关闭,是该用户对于通道的权限】
privilege的值:
1 callback
2 user
3 operator
4 administrator
5 OEM
eg:
root@master:~# ipmitool channel setaccess 1 3 callin=on ipmi=on link=on privilege=4
Set User Access (channel 1 id 3) successful.
查看 用户id 为3的用户的情况:
root@master:~# ipmitool user list 1
ID Name Callin Link Auth IPMI Msg Channel Priv Limit
1 true false false Unknown (0x00)
2 ADMIN false false true ADMINISTRATOR
3 aaa true true true ADMINISTRATOR
5.5 激活用户
格式:ipmitool user enabled 用户ID
enable后Privilege Level为USER,disable后Privilege Level为NO ACCESS
ipmitool user enabled 1
ipmitool user disable 1
5.7 查看授权:
格式:ipmitool channel getaccess 1 用户ID
root@master:~# ipmitool channel getaccess 1 3
Maximum User IDs : 10
Enabled User IDs : 2
User ID : 3
User Name : aaa
Fixed Name : No
Access Available : callback
Link Authentication : disabled
IPMI Messaging : disabled
Privilege Level : ADMINISTRATOR
6.通道相关命令
6.1 显示通道信息
显示系统默认channelIpmitool channel
ipmitool channel info
6.2 修改通道的优先级别
ipmitool channel authcap channel-number privilege
6.3 通道上用户权限设置
读取用户在通道上的权限
格式Ipmitool channel getaccess channel-number user-id
ipmitool channel getaccess 1 2
设置用户在通道上的权限
Ipmitool channel setacccess channel-number user-id callin=on ipmi=on link=onprivilege=5
ipmitool channel setaccess 1 2 callin=on ipmi=on link=on privilege=4
6.6 通道开关
格式: ipmitool lan set 频道ID access on|off
ipmitool lan set 1 access on
ipmitool lan set 1 access off
6.问题
6.1 注意事项
6.1.1 模块加载
运行是可能找不到ipmi模块,需要加载模块
modprobe ipmi_watchdog
modprobe ipmi_poweroff
modprobe ipmi_devintf
以下模块可能和操作系统相关,看情况加载
modprobe ipmi_si
modprobe ipmi_msghandler
6.1.2 WEB页面上启用 LAN 上的 IPMI
IDRAC设置->网络->IPMI设置->启用LAN上的IPMI
image.png
6.2 系统上运行ipmitool不响应
解决办法:登录远程管理后台重启远程管理模块