天天看點

安裝配置IPMI

本來是要安裝iDRAC6的,但是按說明插上iDRAC6後開機按ctrl+E後 并沒有預想的那樣進入iDRAC6配置界面,而是進入了IPMI的配置界面,後來聯系戴爾工程師後才知道 我們的伺服器是R200,是不支援iDRAC6的,R200是戴爾9-10代伺服器,支援iDRAC4,如果是10代可以支援iDRAC5  11代出來iDRAC6 ,是以,沒辦法隻能配置IPMI作為遠端管理接口了。

安裝配置IPMI

一、ipmitool

該工具可以用于設定ipmi的ip等。

1、環境檢測

# dmidecode |sed -n '/IPMI/,+5p'

如果能看到IPMI資訊,就說明支援ipmi,比如下面DELL R200的輸出,Version為1.5

IPMI Device Information

   Interface Type: KCS (Keyboard Control Style)

   Specification Version: 1.5

   I2C Slave Address: 0x10

   NV Storage Device: Not Present

   Base Address: 0x0000000000000CA8 (I/O)

2.安裝ipmitool

wget http://downloads.sourceforge.net/project/ipmitool/ipmitool/1.8.11/ipmitool-1.8.11.tar.gz

tar -xvzf ipmitool-1.8.11.tar.gz

./configure

make

make install

3、設定本機的IPMI還需要啟動ipmi服務

yum install OpenIPMI

service ipmi start

4、LAN configuration

一共有16個channel,找到所使用的channel

for i in `seq 1 14`; do ipmitool lan print $i 2>/dev/null | grep -q ^Set && echo Channel $i; done

ipmitool -I open lan print 1                           顯示BMC通道的資訊,如果不知道BMC使用的是哪個通道,請使用下面的指令确認:

ipmitool -I open channel info 1

ipmitool -I open lan set 1 ipsrc static                設定本地BMC位址為靜态,才能設定IP

ipmitool -I open lan set 1 ipaddr 10.53.11.113         設定本地BMC的IP位址

ipmitool -I open lan set 1 netmask 255.255.255.0       子網路遮罩,别忘了設

ipmitool -I open lan set 1 defgw ipaddr 10.53.11.254   網關,可設可不設,不過一定要確定監控它的機器位于同一路由

ipmitool user list 1     檢視BMC的使用者清單

ipmitool user set name 1 username 對BMC的1号使用者設定使用者名username

ipmitool user set password 1 123456 對BMC的1号使用者設定密碼123456

關于lan:

lan用于遠端通路,電源管理等。

open用于本地通路。

lanplus用于sol

5、一旦設定好ip,就可以通過遠端伺服器來更改ipmi的配置了。但是遠端伺服器需先安裝ipmitool

ipmitool -I lan -U root -P wowcool321??? -H 210.77.146.102 power status

關于debug

ipmitool -vv -I lanplus -U ipmiuser -P password -H 172.168.6.3 power status

二、ipmitool 常用指令

# ipmitool -I lan -H 172.168.6.3 -U root -P 密碼 power off (硬關機,直接切斷電源)

# ipmitool -I lan -H 172.168.6.3 -U root -P 密碼 power soft (軟關機,即如同輕按一下開機扭,對于linux,伺服器将halt,power status 為off)

# ipmitool -I lan -H 172.168.6.3 -U root -P 密碼 power on (硬開機)

# ipmitool -I lan -H 172.168.6.3 -U root -P 密碼 power reset (硬重新開機)

# ipmitool -I lan -H 172.168.6.3 -U root -P 密碼 power status ( 擷取目前電源狀态)

# ipmitool -I lanplus -U root -P "password" -H 172.168.6.3 sensor get "Ambient Temp"| /bin/grep -i "Sensor Reading"|/bin/cut -c 26-28 //擷取機箱溫度.

ipmitool -I lanplus -U root -P "wowcool321???" -H 210.77.146.102 sensor get "Ambient Temp"| /bin/grep -i "Sensor Reading"|/bin/cut -c 26-28

具體的指令自己去查,這裡隻講關鍵的:

ipmitool -I open sensor thresh   配置ID值等于id的監測項的各種限制值。

ipmitool -I open chassis status  檢視主機闆狀态,其中包括了主機闆電源資訊,主機闆工作狀态等

ipmitool -I open chassis restart_cause  檢視上次系統重新開機的原因

ipmitool -I open chassis policy list  檢視支援的底盤電源相關政策。

ipmitool -I open chassis power on 啟動底盤,用此指令能夠遠端開機

ipmitool -I open chassis power off 關閉底盤,用此指令能夠遠端關機

ipmitool -I open chassis power reset實作硬重新開機,用此指令能夠遠端重新開機

ipmitool -I open mc reset 使BMC重新硬啟動

ipmitool -I open mc info 檢視BMC硬體資訊

ipmitool -I open mc setenables =[on|off],配置bmc相應的允許/禁止選項。

ipmitool -I open mc getenables 列出BMC任何允許的選項

ipmitool -I open lan print 1 列印現咱channel 1的資訊 。