Commands:
 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
   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 //chassis底盤
    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
    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

=============================================================

1
2
3
4
5
6
7
8
9
10
11
12
13
a) raw:傳送一個原始的IPMI請求,並且列印回覆資訊。
b) Lan:配置網路(lan)通道(channel)
c) chassis :檢視底盤的狀態和設定電源
d) event:向BMC傳送一個已經定義的事件(event),可用於測試配置的SNMP是否成功
e) mc: 檢視MC(Management Contollor)狀態和各種允許的項
f) sdr:列印感測器倉庫中的所有監控項和從感測器讀取到的值。
g) Sensor:列印詳細的感測器資訊。
h) Fru:列印內建的Field Replaceable Unit (FRU)資訊
i) Sel: 列印 System Event Log (SEL)
j) Pef: 設定 Platform Event Filtering (PEF),事件過濾平臺用於在監控系統發現有event時候,用PEF中的策略進行事件過濾,然後看是否需要報警。
k) Sol/isol:用於配置通過串列埠的Lan進行監控
l) User:設定BMC中使用者的資訊 。
m) Channel:設定Management Controller通道。

ipmitool [-c|-h|-v|-V]-I open <command>
ipmitool [-c|-h|-v|-V]-I lan -H <hostname>
    [-p <port>]
    [-U <username>]
    [-A <authtype>]
    [-L <privlvl>]
    [-a|-E|-P|-f <password>]
    [-o <oemtype>]
    <command>
ipmitool [-c|-h|-v|-V]-I lanplus -H <hostname>
    [-p <port>]
    [-U <username>]
    [-L <privlvl>]
    [-a|-E|-P|-f <password>]
    [-o <oemtype>]
    [-C <ciphersuite>]
    <command>

這個程式能夠使你通過一個kernel裝置驅動或者一個遠端系統,利用IPMIv1.5或IPMIv2.0 來管理本地系統的任何一個智慧平臺管理介面(IPMI)功能。
包括列印FRU(現場可替換裝置)資訊、LAN配置、感測器讀數、以及遠端機架電源控制。
一個本地系統介面的IPMI管理功能需要一個相容IPMI的kernel驅動程式被安裝以及配置。

在Linux中,這個驅動叫做OpenIPMI,他被包括在了標準化分配中。
在Solaris系統中,這個驅動叫做BMC,他被包括在了Solaris 10中。
遠端控制的管理需要授權以及配置IPMI-over-LAN介面。
根據每個系統獨特的需要,它可以通過系統介面來使LAN介面使用 ipmitool。    
    
    
    
#ipmitool -l open shell
ipmitool命令列使用詳解

#service ipmi start
#ipmitool -I open shell
#### 可以直接進入本地BMC shell

#ipmitool -I lan -H -U shell
#### 輸入password,進入IPMI互動模式,當然這裡也可以把shell直接換成bmc命令 , 另外ipmitool支援埠,所以是否可以先做DNAT,然後遠端直接管理內網機器.
#### ipmitool提供的功能要比windows下ipmish提供的功能多得多,用法相對複雜一些
參考下面轉摘的文章來詳細瞭解命令

Ipmitool本地監控使用命令:ipmitool –I open command,其中-I open表示使用OpenIPMI介面,command有以下項:

Ipmitool –I open sensor list命令可以獲取感測器中的各種監測值和該值的監測閾值,包括(CPU溫度,電壓,風扇轉速,電源調製模組溫度,電源電壓等資訊)
Ipmitool –I open sensor get “CPU0Temp”可以獲取ID為CPU0Temp監測值,CPU0Temp是sensor的ID,伺服器不同,ID表示也不同。

1
2
3
4
5
6
7
8
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 chassis bootdev pxe    //開機pxe啟動


Ipmi還可以設定系統啟動boot的裝置,具體見ipmitool幫助文件。

1
2
3
4
Ipmitool –I open mc reset 使BMC重新硬啟動
Ipmitool –I open mc info 檢視BMC硬體資訊
Ipmitool –I open mc getenables 列出BMC所有允許的選項
Ipmitool –I open mc setenables =[on|off],設定bmc相應的允許/禁止選項。

Ipmitool-I open event 1 傳送一個溫度過高的訊息到System Event Log中,可以傳送的Event有:
1 Temperature: Upper Critical: Going High
2 Voltage Threshold: Lower Critical: Going Low
3 Memory: Correctable ECC Error Detected

1
2
3
4
5
6
7
8
9
Ipmitool -I open event命令可以用測試配置的IPMI中的snmp功能是否成功。
Ipmitool -I open lan print 1 列印現我們channel 1的資訊 。
Ipmitool -I open lan set 1 ipaddr 10.10.113.95設定channel 1 的地址為10.10.113.95
Ipmitool -I open lan set 1 snmp public設定channel 1 上snmp的community為public
Ipmitool -I open lan set 1 access on設定channel 1允許訪問。
Ipmitool -I open pef info列印Platform Event Filtering (pef)資訊
Ipmitool -I open pef status檢視Platform Event Filtering (pef)狀態
Ipmitool -I open pef policy檢視Platform Event Filtering (pef)策略設定
Ipmitool -I open sdr list fru 讀取fru資訊並顯示。

常用方法:
一、開關機,重啟
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
4. 重啟:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) power reset
 
二、使用者管理
說明:[ChannelNo] 欄位是可選的,ChannoNo為1或者8;BMC預設有2個使用者:user id為1的匿名使用者,user id為2的ADMIN使用者;<>欄位為必選內容;<privilege level>:2為user許可權,3為Operator許可權,4為Administrator許可權;
1. 檢視使用者資訊:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) user list [ChannelNo]
2. 增加使用者:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) user set name <user id> <username>
3. 設定密碼:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) user set password <user id> <password>
4. 設定使用者許可權:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) user priv <user id> <privilege level> [ChannelNo]
5. 啟用/禁用使用者:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) user enable/disable <user id>
 
三、IP網路設定
說明:[ChannelNo] 欄位是可選的,ChannoNo為1(Share Nic網路)或者8(BMC獨立管理網路);設定網路引數,必須首先設定IP為靜態,然後再進行其他設定;

1
2
3
4
5
6
7
8
9
10
1. 檢視網路資訊:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) lan print [ChannelNo]
2. 修改IP為靜態還是DHCP模式:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) lan set <ChannelNo> ipsrc <static/dhcp>
3. 修改IP地址:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) lan set <ChannelNo> ipaddr <IPAddress>
4. 修改子網掩碼:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) lan set <ChannelNo> netmask <NetMask>
5. 修改預設閘道器:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) lan set <ChannelNo> defgw ipaddr <預設閘道器>

 
四、SOL功能
說明:<9.6/19.2/38.4/57.6/115.2>其中115.2代表115200,即*1000是表示的波特率。
1. 設定SOL串列埠波特率:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) sol set volatile-bit-rate <9.6/19.2/38.4/57.6/115.2>
2. 開啟SOL功能:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) sol activate
3. 關閉SOL功能:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) sol deactivate
 
五、SEL日誌檢視
1. 檢視SEL日誌:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) sel list
 
六、FRU資訊檢視
1. 檢視FRU資訊:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) fru list
 
七、SDR,Sensor資訊檢視
1. 檢視SDR Sensor資訊:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) sdr
2. 檢視Sensor資訊:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) sensor list
 
八、mc(管理單元BMC)狀態和控制
1. 重啟動BMC:
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) mc reset <warm/cold>
 
九、設定BMC的iptables防火牆
1. 設定某一段IP可以訪問BMC

1
2
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) raw 0x32 0x76 0x01 0x01 ip1(0xa 0xa 0xa 0xa) ip2(0xb 0xb 0xb 0xb)
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) raw 0x32 0x76 0x09

2. 設定某個IP可以訪問BMC

1
2
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) raw 0x32 0x76 0x00 0x01 ip1(0xa 0xa 0xa 0xa)
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) raw 0x32 0x76 0x09

3. 取消設定

1
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) raw 0x32 0x76 0x08

4.獲取防火牆設定

1
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) raw 0x32 0x77 0x01 0x00

5. 阻止/開啟某個埠

1
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) raw 0x32 0x76 0x02 0x00/0x01 0x00 (portno)0x22 0x00

6. 取消某個埠的設定(6是5的對應取消操作)

1
ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登入使用者名稱) -P (BMC 登入使用者名稱的密碼) raw 0x32 0x76 0x06 0x00/0x01 0x00 (portno)0x22 0x00
















本文轉自MT_IT51CTO部落格,原文連結:http://blog.51cto.com/hmtk520/1980737,如需轉載請自行聯絡原作者