ipmitool常用操作指導書
1、ipmitool工具安裝
方式一:(源碼包安裝方式)
(1)將軟件包ipmitool-1.8.11.tar.gz上傳到Linux OS的/home目錄下
(2)依次執行如下命令進行ipmitool的安裝
# tar -zxvf /home/ipmitool-1.8.11.tar.gz
# cd /home/ipmitool-1.8.11
# ./configure && make && make install
# cp contrib/bmclanconf /usr/local/bin/
方式二:(通過yum源安裝或是rpm包安裝 )
yum install ipmitool
或是
yum localinstall ipmitool*.rpm
# yum源中可能 openipmi 或是freeipmi 的包,可根據需求選擇安裝。
(3)運行命令“ipmitool lan print”查看BMC配置信息,使用時若出現如下提示
Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory
Get Device ID command failed
Unable to open SDR for reading
請依次執行以下命令加載ipmi驅動模塊
# modprobe ipmi_msghandler
# modprobe ipmi_si
# modprobe ipmi_devintf
2、ipmitool常用操作
(1)查看BMC版本信息,使用命令“ipmitool mc info”。
(2)查看BMC配置信息,使用命令“ipmitool lan print”。
(3)重啟BMC,使用命令“ipmitool mc reset <warm|cold>”(分為熱復位和冷復位)。
(4)查看BMC用戶信息,使用命令“ipmitool user list 1”。
(5)設置BMC用戶密碼,使用命令“ipmitool user set password 用戶ID 新密碼”。
(6)設置BMC IP獲取方式,使用命令“ipmitool lan set 1 ipsrc <static|dhcp>”。
(7)設置BMC IP地址,使用命令“ipmitool lan set 1 ipaddr xxx.xxx.xxx.xxx”。
(8)設置BMC掩碼地址,使用命令“ipmitool lan set 1 netmask xxx.xxx.xxx.xxx”。
(9)設置BMC默認網關IP地址,使用命令“ipmitool lan set 1 defgw ipaddr xxx.xxx.xxx.xxx”。
(10)查詢watchdog的狀態,使用命令“ipmitool mc watchdog get”。
(11)查詢單板上電狀態,使用命令“ipmitool chassis power status”(on-上電,off-下電)。
(12)控制單板下電,使用命令“ipmitool chassis power off”。
(13)控制單板上電,使用命令“ipmitool chassis power on”。
(14)控制單板復位,使用命令“ipmitool chassis power <cycle|reset>”。
ipmitool 關於主機幾個狀態的操作
1. 查看開關機狀態:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登錄用戶名) -P (BMC 登錄用戶名的密碼) power status
2. 開機:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登錄用戶名) -P (BMC 登錄用戶名的密碼) power on
3. 關機:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登錄用戶名) -P (BMC 登錄用戶名的密碼) power off
FAQ
-
安裝后執行ipmitool 報錯怎么處理?
報錯信息如下:
Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory
答:
1)、ipmitool 命令執行需要root權限。
2)、解決辦法:需要加載相關模塊
查看先關模塊是否加載(可以看出模塊未加載)
lsmod |grep ^ipmi
加載以下模塊
modprobe ipmi_watchdog
modprobe ipmi_poweroff
modprobe ipmi_devintf
modprobe ipmi_si #加載該模塊如果沒有不影響ipmi的使用(與系統版本有關)
modprobe ipmi_msghandler #加載該模塊如果沒有不影響ipmi的使用
之后就可以正常使用了:
ipmitool lan print 1; #查看本機IPMI地址等信息
3) 如果出現
XXX@ubuntu:~$ sudo modprobe ipmi_si
modprobe: ERROR: could not insert 'ipmi_si': No such device
這是機器上沒有IPMI設備而出現的報錯
====================================================================================================
ipmi命令的幫助信息
[root@server2 monitordata]# ipmitool -h
ipmitool version 1.8.15
usage: ipmitool [options...] <command>
-h This help
-V Show version information
-v Verbose (can use multiple times)
-c Display output in comma separated format
-d N Specify a /dev/ipmiN device to use (default=0)
-I intf Interface to use
-H hostname Remote host name for LAN interface
-p port Remote RMCP port [default=623]
-U username Remote session username
-f file Read remote session password from file
-z size Change Size of Communication Channel (OEM)
-S sdr Use local file for remote SDR cache
-D tty:b[:s] Specify the serial device, baud rate to use
and, optionally, specify that interface is the system one
-a Prompt for remote password
-Y Prompt for the Kg key for IPMIv2 authentication
-e char Set SOL escape character
-C ciphersuite Cipher suite to be used by lanplus interface
-k key Use Kg key for IPMIv2 authentication
-y hex_key Use hexadecimal-encoded Kg key for IPMIv2 authentication
-L level Remote session privilege level [default=ADMINISTRATOR]
Append a '+' to use name/privilege lookup in RAKP1
-A authtype Force use of auth type NONE, PASSWORD, MD2, MD5 or OEM
-P password Remote session password
-E Read password from IPMI_PASSWORD environment variable
-K Read kgkey from IPMI_KGKEY environment variable
-m address Set local IPMB address
-b channel Set destination channel for bridged request
-t address Bridge request to remote target address
-B channel Set transit channel for bridged request (dual bridge)
-T address Set transit address for bridge request (dual bridge)
-l lun Set destination lun for raw commands
-o oemtype Setup for OEM (use 'list' to see available OEM types)
-O seloem Use file for OEM SEL event descriptions
-N seconds Specify timeout for lan [default=2] / lanplus [default=1] interface
-R retry Set the number of retries for lan/lanplus interface [default=4]
Interfaces:
open Linux OpenIPMI Interface [default]
imb Intel IMB Interface
lan IPMI v1.5 LAN Interface
lanplus IPMI v2.0 RMCP+ LAN Interface
serial-terminal Serial Interface, Terminal Mode
serial-basic Serial Interface, Basic Mode
Commands:
raw Send a RAW IPMI request and print response
i2c Send an I2C Master Write-Read command and print response
spd Print SPD info from remote I2C device
lan Configure LAN Channels
chassis Get chassis status and set power state
power Shortcut to chassis power commands
event Send pre-defined events to MC
mc Management Controller status and global enables
sdr Print Sensor Data Repository entries and readings
sensor Print detailed sensor information
fru Print built-in FRU and scan SDR for FRU locators
gendev Read/Write Device associated with Generic Device locators sdr
sel Print System Event Log (SEL)
pef Configure Platform Event Filtering (PEF)
sol Configure and connect IPMIv2.0 Serial-over-LAN
tsol Configure and connect with Tyan IPMIv1.5 Serial-over-LAN
isol Configure IPMIv1.5 Serial-over-LAN
user Configure Management Controller users
channel Configure Management Controller channels
session Print session information
dcmi Data Center Management Interface
sunoem OEM Commands for Sun servers
kontronoem OEM Commands for Kontron devices
picmg Run a PICMG/ATCA extended cmd
fwum Update IPMC using Kontron OEM Firmware Update Manager
firewall Configure Firmware Firewall
delloem OEM Commands for Dell systems
shell Launch interactive IPMI shell
exec Run list of commands from file
set Set runtime variable for shell and exec
hpm Update HPM components using PICMG HPM.1 file
ekanalyzer run FRU-Ekeying analyzer using FRU files
ime Update Intel Manageability Engine Firmware
延伸閱讀:
以下內容轉自:https://blog.csdn.net/iteye_19871/article/details/81832242
- 什么是IPMI? IPMI規范為平台管理子系統定義了標准化的抽象接口。這里的“平台管理(platform management)”用指平台硬件內置的監控和控制功能,以及主要用作監控系統硬件健康狀況的功能。接受監控的元素包括:系統溫度、電壓、風扇、電源、總線錯誤、系統物理安全性等等。IPMI包括自動和手動恢復功能,比如本地或遠程系統重啟、電源開啟/關閉等操作;還包括記錄異常或故障日志,以供以后檢查,在不具備運行時軟件的情況下由平台發出警告的能力;還包括設備清單信息,以幫助識別故障硬件單元。(http://en.wikipedia.org/wiki/IPMI)
- 什么是FreeIPMI? FreeIPMI提供in-band 與out-of-band【注1】的IPMI軟件實現,基於IPMI 1.5/2.0規范。IPMI規范定義了一系列平台管理的結構,並由一些系統管理廠商實現。用戶會對IPMI的傳感器監控、系統事件監控、電源控制、Serial-over-LAN (SOL)【注2】感興趣。FreeIPMI就提供了這些方面的工具。很多可供大型高性能計算或集群的特性也在FreeIPMI中實現。 FreeIPMI和OpenIPMI、Ipmitool、Ipmiuitl都是IPMI規范的開源實現。
- FreeIPMI可在哪些操作系統上運行? FreeIPMI開發於GNU/Linux之上,可在Redhat、Fedora、Suse和Debian上構建成功。並已被移植到FreeBSD、OpenBSD、Solaris、OpenSolaris和Windows(通過Cygwin)之上。
- FreeIPMI與其他IPMI開源項目有哪些不同?
- 支持HPC
- 更多的OEM支持,包括Dell、Fujitsu、Inventec、Sun和Supermicro。
- 更多的靈活性和功能。FreeIPMI將IPMI的各個子部分實現為不同的工具,提供更多靈活性。
- 易於設置:以userspace程序庫方式實現,無需構建、設置、管理任何kernel的模塊和驅動。
- 可移植性
- FreeIPMI包括的工具和程序庫 項目工具:
- Bmc-info:讀取BMC 信息,包括設備版本號、設備支持和GUID。
- Bmc-config:配置一般的BMC【注3】和IPMI信息。支持用戶名、密碼、網絡信息、安全、SOL和其他核心字段的配置。
- Bmc-watchdog:管理BMC watchdog的daemon。通常用作系統超時管理和系統出現崩潰時的自動重啟。
- Ipmi-chassis:管理監控chassis【注4】的工具,比如chassis電源、識別(比如LED控制)和狀態等等。
- Ipmi-fru:從主板和機器中讀取可替換單元FRU(field replaceable unit)信息的工具。
- Ipmi-sel:讀取和管理IPMI系統事件日志(SEL,system event log)的工具。SEL記錄存儲事件信息,對於調試問題有所幫助。
- Ipmi-sensors:讀取IPMI傳感器讀數和傳感器數據存儲庫(sensor data repository, SDR)信息的工具。
- Ipmipower:遠程電源控制。
- Ipmiconsole:SOL控制工具。
- Ipmi-raw:提供IPMI命令16進制輸入輸出的工具。
- Ipmi-locate:探測BMC設備位置信息的工具,比如設備地址。
- Ipmimonitoring:傳感器監控和解釋工具。類似於ipmi-sensors,但是傳感器讀數已經經過分析,並映射到Nominal、Warning和Critical這幾個狀態中。
- Ipmi-pre-config:配置平台事件過濾(Platform Event Filtering,PEF)信息的工具。
- Ipmi-chassis-config:配置IPMI chassis信息。支持啟動設備、電源恢復策略和其他chassis相關單元的配置。
- Ipmi-sensors-config:配置IPMI傳感器,支持傳感器閾值、傳感器事件和其他傳感器相關的信息。
- Ipmi-dcmi:執行數據中心可管理性接口(Data Center Manageability Interface,DCMI) IPMI擴展命令的工具。支持資產管理和電源使用率管理等擴展。
- Bmc-device:執行高階BMC命令的工具。
- Ipmiping:供調試使用的IMPI ping工具。
- Rmcpping:供調試使用的RMCP ping工具。
- Ipmi-oem:執行OEM特定命令的IPMI工具。
- Ipmidetect/Ipmidetected:IPMI節點檢測的工具和daemon。
- Libfreeipmi:C程序庫,包括KCS、SSIF和OpenIPMI Linux、Solaris BMC 驅動、IPMI 1.5、和IPMI 2.0 LAN通信接口、IPMI包構建實用工具、IPMI命令行實用工具、讀取/解釋/管理IMPI實用工具。
- Libimpiconsole:控制台SOL存取程序庫。SOL控制台存取被抽象為文件描述符接口,用戶可以通過文件描述符讀取和寫入控制台數據。
- Libipmimonitoring:傳感器監控和解釋程序庫。傳感器監控和解釋被抽象為帶有迭代器接口的API。
- Libmidetect:IPMI節點檢測程序庫。
注1: 從技術的角度,網絡管理可分為帶外管理(out-of-band)和帶內管理(in-band)兩種管理模式。所謂帶內管理,是指網絡的管理控制信息與用戶網絡的承載業務信息通過同一個邏輯信道傳送;而在帶外管理模式中,網絡的管理控制信息與用戶網絡的承載業務信息在不同的邏輯信道傳送。可參考: http://www.hudong.com/wiki/%E5%B8%A6%E5%86%85%E7%BD%91%E7%AE%A1
注2: Serial-over-LAN機制允許被管理系統的串行端口的輸入和輸入通過IP協議進行轉發。 在有些被管理的系統中,尤其是刀片服務器系統中,受控計算機的串行端口並沒有以傳統方式連接到串行端口socket上。為了允許用戶通過串行端口訪問計算機上的應用,串行端口的輸入和輸出被重定向到網絡中。比如,用戶希望通過串口訪問刀片服務器,並telnet到一個網絡地址完成登錄操作。在刀片服務器 ,登錄會被看作來自串行端口。 SOL在IPMI中以RMCP+(Remote Management Control Protocol+)協議實現。
注3: BMC,baseboard management controller。集成在服務器主板上的專用微控制器,是IPMC架構的核心,管理系統管理軟件和平台硬件之間的接口。系統中不同類型的傳感器都要向BMC報告、提供參數,包括溫度、風扇轉速、電源狀態、操作系統狀態等等。BMC可以通過網絡向系統管理員發出警告。SA也可以遠程與BMC通信,以采取糾正措施。http://en.wikipedia.org/wiki/Baseboard_management_controller
注4: chassis本意為汽車底盤,在計算機領域中,chassis指主板、內存、磁盤等所在的堅硬框架。 說明:本文主要參考FreeIPMI FAQ