遠程控制管理工具ipmitool

IPMI(Intelligent Platform Management Interface)即智能平台管理接口是使硬件管理具備“智能化”的新一代通用接口標準。用戶可以利用IPMI 監視服務器的物理特徵,如溫度、電壓、電扇工作狀態、電源供應以及機箱入侵等。Ipmi 最大的優勢在於它是獨立於CPU BIOS 和OS 的,所以用戶無論在開機還是關機的狀態下,只要接通電源就可以實現對服務器的監控。

IPMI 是一種規範的標準,其中最重要的物理部件就是BMC(Baseboard Management Controller),一種嵌入式管理微控制器,它相當於整個平台管理的“大腦”,通過它ipmi 可以監控各個傳感器的數據並記錄各種事件的日誌。

一般大廠的服務器都支持ipmi功能,比如DELL,HP,IBM。
此實驗選擇的硬件平台Dell R410 無idrac6卡,操作系統CentOS 5.6

1 .服務器啟動後,按'Ctrl + E'進入BMC管理工具界面

2 .設置'IPMI Over LAN'為On,啟用通過LAN方式的IPMI。

3 .選擇'IPMI LAN Channel',進入設置IPMI的網絡屬性,IP Address '10.60.30.29', Netmask '255.255.255.0' , Default Gateway '10.60.30.1',與服務器eth0配置一致即可。

4 .選擇'User Configuration',進入設置IPMI的訪問帳號, 'Admin account'保持'root'不變,'Enter Passwd'與'Confirm Passwd'填入'root'

ipmitool命令使用

http://ipmitool.sourceforge.net/manpage.html

常用顯示本地網絡信息-I open表示接口本地

# ipmitool -I open lan print 1 
Set in Progress          : Set Complete
Auth Type Support        : NONE MD2 MD5 PASSWORD
Auth Type Enable         : Callback : MD2 MD5 
                         : User      : MD2 MD5 
                         : Operator : MD2 MD5 
                         : Admin     : MD2 MD5 
                         : OEM       :  
IP Address Source        : Static Address
IP Address               : 192 . 168 . 0 . 120
Subnet Mask              : 255 . 255 . 255 . 0
MAC Address              :  84 : 2b : 2b : 44 : 18 : a2
SNMP Community String    : public
IP Header                : TTL = 0x40 Flags = 0x40 Precedence = 0x00 TOS = 0x10
Default Gateway IP       : 192 . 168 . 0 . 1
Default Gateway MAC      : 00 : 00 : 00 : 00 : 00 : 00
Backup Gateway IP        : 0 . 0 . 0 . 0
Backup Gateway MAC       : 00 : 00 : 00 : 00 : 00 : 00
802 . 1q VLAN ID           : Disabled
802 . 1q VLAN Priority     :  0 
RMCP + Cipher Suites      :  0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 
Cipher Suite Priv Max    : aaaaaaaaaaaaaaa
                         :      X = Cipher Suite Unused
                         :      c = CALLBACK
                         :      u = USER
                         :      o = OPERATOR
                         :      a = ADMIN
                         :      O = OEM
顯示本地網絡信息-I lan 表示接口遠程

# ipmitool -I lan -H 10.60.30.29 -U root -P root lan print 1 
Set in Progress          : Set Complete
Auth Type Support        : NONE MD2 MD5 PASSWORD
Auth Type Enable         : Callback : MD2 MD5 
                         : User      : MD2 MD5 
                         : Operator : MD2 MD5 
                         : Admin     : MD2 MD5 
                         : OEM       :  
IP Address Source        : Static Address
IP Address               : 10 . 60 . 30 . 29
Subnet Mask              : 255 . 255 . 255 . 0
MAC Address              : a4 : ba : db : 1b : cb : be
SNMP Community String    : public
IP Header                : TTL = 0x40 Flags = 0x40 Precedence = 0x00 TOS = 0x10
Default Gateway IP       : 10 . 60 . 30 . 1
Default Gateway MAC      : 00 : 00 : 00 : 00 : 00 : 00
Backup Gateway IP        : 0 . 0 . 0 . 0
Backup Gateway MAC       : 00 : 00 : 00 : 00 : 00 : 00
802 . 1q VLAN ID           : Disabled
802 . 1q VLAN Priority     :  0 
RMCP + Cipher Suites      :  0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 
Cipher Suite Priv Max    : aaaaaaaaaaaaaaa
                         :      X = Cipher Suite Unused
                         :      c = CALLBACK
                         :      u = USER
                         :      o = OPERATOR
                         :      a = ADMIN
                         :      O = OEM
網絡配置

# ipmitool -I lan -H 10.60.30.29 -U root -P root lan set 1 ipsrc static ip靜態指定
# ipmitool -I lan -H 10.60.30.29 -U root -P root lan set 1 ipaddr 10.60.30.29 
# ipmitool - I lan -H 10.60.30.29 -U root -P root lan set 1 netmask 255.255.255.0 
# ipmitool -I lan -H 10.60.30.29 -U root -P root lan set 1 defgw ipaddr 10.60.30.1 
# ipmitool -I lan - H 10.60.30.29 -U root -P root lan set 1 ipsrc dhcp ip自動分配
建立新用戶ipmi 密碼passwd 用戶信息

# ipmitool -I lan -H 10.60.30.29 -U root -P root user set name 3 ipmi 
# ipmitool -I lan -H 10.60.30.29 -U root -P root user set password 3 passwd
 
# ipmitool -I lan -H 10.60.30.29 -U root -P root user list
ID Name Enabled Callin Link Auth IPMI Msg Channel Priv Limit
2    root true true true true ADMINISTRATOR
 3    ipmi false true false false NO ACCESS
改變服務器引導方式

# ipmitool -I lan -H 10.60.30.29 -U root -P root chassis bootdev pxe
Set Boot Device to pxe
# ipmitool -I lan -H 10.60.30.29 -U root -P root chassis bootdev disk 
# ipmitool -I lan -H 10.60.30.29 -U root -P root chassis bootdev cdrom
服務器電源管理

# ipmitool -I lan -H 10.60.30.29 -U root -P root chassis power off關機
# ipmitool -I lan -H 10.60.30.29 -U root -P root chassis power reset重啟 
Chassis Power Control : Reset
 # ipmitool -I lan -H 10.60.30.29 -U root -P root chassis power on開機
# ipmitool -I lan -H 10.60.30.29 -U root -P root chassis power status電源狀態 
Chassis Power is on
配置流程
安裝ipmi工具,如yum install - y ipmitool
在本地運行ipmitool - I open相關命令配置BMC

幾個想法
BMC的IP地址目前是靜態指定,如果要實現機房無人值守的話,需要使用DHCP,可能每台服務器需要佔用多個IP網卡ip + BMCip
目前實現硬件監控依靠操作系統級別,有了BMC​​,是不是實現硬件級別?

另外 RHEL & CentOS提供的ipmi工具freeipmi.x86_64,不是太熟悉,如果想安裝ipmitool的話,HP & ​​Dell的開源庫均有提供。

# yum info freeipmi.x86_64 
Loaded plugins : rhnplugin , security
Available Packages
Name        : freeipmi
Arch        : x86_64
Version     : 0 . 5 . 1
Release     :  6 . el5
Size        :  1.0 M
Repo        : rhel - x86_64 - server - 5 
Summary     : FreeIPMI
License     : GPLv2 + 
Description : The FreeIPMI project provides "Remote-Console"  ( out - of - band )  and 
           :  "System Management Software"  ( in - band ) based on Intelligent
            : Platform Management Interface specification . 
           :  
           : This package contains a Technology Preview for FreeIPMI . Please visit
            : http :// www . redhat . com / support / service /  for details on the Red Hat support
            : policies .

# ipmi 
ipmi - chassis ipmiconsole ipmi - fru ipmi - locate ipmiping ipmi - raw ipmi - sensors ipmi_ui         
ipmicmd ipmidetect ipmilan ipmimonitoring ipmipower ipmi - sel ipmish

留言

這個網誌中的熱門文章

Json概述以及python對json的相關操作

Docker容器日誌查看與清理