在CentOS系统中使用IPMITOOL时,经常会遇到一些问题。
例如,想要查看电源状态,可以执行下面的命令:
ipmitool -H 192.168.1.2 -U username -P password chassis power status
然后,可能会出现以下几种报错:
1. Authentication type NONE not supported
2. Error: Unable to establish LAN session
这两种错误的解决办法是加一个参数:“-I open/lan/lanplus”,具体选其中哪个,根据实际情况而定,例如:
ipmitool -I lanplus -H 192.168.1.2 -U username -P password chassis power status
3. Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory
4. FATAL: Module ipmi_si not found
5. FATAL: Module ipmi_devintf not found
6. FATAL: Module ipmi_msghandler not found
导致这四种错误的原因是当前系统没有加载IPMI所需模块,可以执行:
lsmod | grep ipmi
查看系统是否已经加载IPMI模块。如果结果如下:
ipmi_si 42401 0
ipmi_devintf 8049 0
ipmi_msghandler 35992 2 ipmi_si,ipmi_devintf
说明所有模块都已经加载,可以正常使用。如果其中有某个模块没有加载,还需要加载相应的模块,可以执行下面的命令:
modprobe ipmi_msghandler
modprobe ipmi_devintf
modprobe ipmi_si
7. FATAL: Error inserting ipmi_si (/lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/char/ipmi/ipmi_si.ko): No such device
导致这种错误的原因是当前系统运行在虚拟机而非物理机上,只有运行在物理机上的CentOS系统才能用这个模块。
导致这种错误的另外一种原因可能是当前系统版本是CentOS 6.4,只有低于CentOS 6.3的版本才可以用这个模块。执行cat /etc/redhat-release命令可以查看当前CentOS系统的版本。
8. 通过源代码安装IPMITOOL时,首先需要运行configure脚本配置IPMITOOL,具体要配置什么内容,可以执行:
./configure -h
查看。例如,需要安装lanplus,需要执行:
./configure --enable-intf-lanplus=yes
执行完这条configure命令后,会输出结果:
ipmitool 1.8.13
Interfaces
lan : yes
lanplus : no
open : yes
free : no
imb : yes
bmc : no
lipmi : no
serial : yes
Extra tools
ipmievd : yes
ipmishell : no
正常情况下,成功执行后,
应该是lanplus : yes,如果lanplus : no,可能的原因是没用安装openssl和openssl-devel的相关包,需要先安装:yum install openssl openssl-devel
然后执行下列命令,安装
IPMITOOL:
./configure --enable-intf-lanplus=yes
./configure
make
make install
9. 如果需要安装IPMITOOL的Shell,需要先执行:
./configure --enable-ipmishell=yes
此时,可能出现如下错误:
configure: error: ** Unable to find curses required by ipmishell
解决办法是,先安装下列包:
yum install ncurses ncurses-devel ncurses-term readline readline-devel