安裝配置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的信息 。

另附IR4圖一張:


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章