ipmitool常用命令總結


IPMITool介紹安裝

IPMItool用於訪問IPMI的功能-智能平台管理接口,該系統接口管理和監視帶外計算機系統。它是一個命令提示符,用於控制和配置IPMI支持的設備。

IPMItool 是一種可用在 linux系統下的命令行方式的 ipmi 平台管理工具,它支持 ipmi 1.5 規范(最新的規范為 ipmi 2.0).IPMI是一個開放的標准,監控,記錄,回收,庫存和硬件實現獨立於主CPU,BIOS,以及操作系統的控制權。 服務處理器(或底板管理控制器,BMC)的背后是平台管理的大腦,其主要目的是處理自主傳感器監控和事件記錄功能。

 

在Linux平台上要配置IPMI需要有 /dev/ipmi0 設備存在,如果缺少該設備, ipmitool 工具就無法工作。此時需要使用如下方法創建設備:

# 安裝    
yum  -y install epel-release    
yum  -y install ipmitool    
yum install OpenIPMI  ipmitool    
# 加載模塊    
modprobe ipmi_watchdog    
modprobe ipmi_poweroff    
modprobe ipmi_devintf    
modprobe ipmi_msghandler    
modprobe ipmi_si    
 

參數  描述  

-h  幫助  

-V  顯示版本信息  

-v  詳細(可以使用多次)  

-c  以逗號分隔格式顯示輸出  

-d  指定要使用的/ dev / ipmiN設備(默認值= 0)  

-I  要使用的接口  

-H  LAN接口的遠程主機名  

-p  遠程RMCP端口[默認= 623]  

-U  遠程會話用戶  

-f  從文件讀取遠程會話密碼  

-z  通信通道(OEM)的尺寸更改大小  

-S  使用本地文件進行遠程SDR緩存  

-D  ttyb[:s]指定要使用的串行設備,波特率並且可選地指定該接口是系統接口  

-a  提示輸入遠程密碼  

-Y  提示用於IPMIv2身份驗證的Kg密鑰  

-e  設置SOL轉義字符  

-C  加密套件將被lanplus接口使用  

-k  使用Kg鍵進行IPMIv2身份驗證  

-y  使用十六進制編碼的Kg密鑰進行IPMIv2身份驗證  

-L  遠程會話權限[默認=管理員] 附加一個’+’以在RAKP1中使用名稱/特權查找  

-A  強制使用auth type NONE,PASSWORD,MD2,MD5或OEM  

-P  遠程會話密碼  

-E  從IPMI_PASSWORD環境變量讀取密碼  

-K  從IPMI_KGKEY環境變量中讀取kgkey  

-m  設置本地IPMB地址  

-b  通道為橋接請求設置目標通道  

-t  將橋接請求發送到遠程目標地址  

-B  為橋接請求設置傳輸通道(雙橋)  

-T  設置橋接請求的傳輸地址(雙橋)  

-l  設置原始命令的目的地lun  

-o  OEM設置(使用’list’查看可用的OEM類型)  

-O  將文件用於OEM SEL事件描述  

-N  指定lan [default = 2] / lanplus [default = 1]接口的超時時間  

-R  設置lan / lanplus接口的重試次數[默認= 4] 

# 首次使用  
ipmitool.exe  
  
No command provided!  
Commands:  
        raw           Send a RAW IPMI request and print response  
        i2c           Send an I2C Master Write-Read command and print response  
        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  
        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  
        shell         Launch interactive IPMI shell  
        exec          Run list of commands from file  
        set           Set runtime variable for shell and exec 

# 查看 FRU 信息  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin fru  
FRU Device Description : Builtin FRU Device (ID 0)  
 Chassis Type          : Rack Mount Chassis  
 Chassis Part Number   : 412008232R2A  
 Chassis Serial        : 520190300001  
 Chassis Extra         : chassis extra 1  
 Chassis Extra         : chassis extra 2  
 Board Mfg             : Fiberhome  
 Board Product         : MB-CIDW16D-2GT  
 Board Serial          : 15088997A002  
 Board Part Number     : 15088997  
 Board Extra           : board extra  
 Product Manufacturer  : FiberHome  
 Product Name          : R2280 V7  
 Product Part Number   : 70475701A001  
 Product Version       : 1  
 Product Serial        : 1001  
 Product Asset Tag     : ....................  
 Product Extra         : product extra  
  
FRU Device Description : PSU2 FRU (ID 4)  
 Unknown FRU header version 0x00  
  
FRU Device Description : PSU1 FRU (ID 3)  
 Product Manufacturer  : GREAT WALL  
 Product Name          : CRPS1300D  
 Product Part Number   : CRPS1300D  
 Product Version       : 01  
 Product Serial        : 2L070023532  
 Power Supply Record  
  Capacity                   : 1300 W  
  Peak VA                    : 65535 VA  
  Inrush Current             : 255 A  
  Inrush Interval            : 0 ms  
  Input Voltage Range 1      : 90-132 V  
  Input Voltage Range 2      : 180-264 V  
  Input Frequency Range      : 0-63 Hz  
  A/C Dropout Tolerance      : 10 ms  
  Flags                      : 'Power factor correction' 'Autoswitch voltage' 'Hot swap'  
  Peak capacity              : 4095 W  
  Peak capacity holdup       : 0 s  
  Combined capacity          : not specified  
 DC Output Record  
  Output Number              : 2  
  Standby power              : Yes  
  Nominal voltage            : 12.20 V  
  Max negative deviation     : 11.60 V  
  Max positive deviation     : 12.80 V  
  Ripple and noise pk-pk     : 120 mV  
  Minimum current draw       : 0.100 A  
  Maximum current draw       : 3.000 A  

sensor操作

# 查看傳感器讀取信息 , 由於輸出內容太多就不展示   
ipmitool sensor list  
# 設置傳感器的告警閾值  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin sensor thresh help  
sensor thresh <id> <threshold> <setting>  
   id        : name of the sensor for which threshold is to be set  
   threshold : which threshold to set  
                 unr = upper non-recoverable  
                 ucr = upper critical  
                 unc = upper non-critical  
                 lnc = lower non-critical  
                 lcr = lower critical  
                 lnr = lower non-recoverable  
   setting   : the value to set the threshold to  
  
sensor thresh <id> lower <lnr> <lcr> <lnc>  
   Set all lower thresholds at the same time  
  
sensor thresh <id> upper <unc> <ucr> <unr>  
   Set all upper thresholds at the same time  

# 單獨獲取某一個傳感器的狀態信息  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin sensor get CPU_TEMP_01  
Locating sensor record...  
Sensor ID              : CPU_TEMP_01 (0x3)  
 Entity ID             : 3.1  
 Sensor Type (Analog)  : Temperature  
 Sensor Reading        : 42 (+/- 1) degrees C  
 Status                : ok  
 Lower Non-Recoverable : na  
 Lower Critical        : na  
 Lower Non-Critical    : na  
 Upper Non-Critical    : 91.000  
 Upper Critical        : 93.000  
 Upper Non-Recoverable : na  
 Assertion Events      :  
 Assertions Enabled    : unc+ ucr+  
 Deassertions Enabled  : unc+ ucr+  

# 單獨獲取某一個傳感器的當前值  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin sensor reading CPU_TEMP_01  
CPU_TEMP_01      | 42  

sdr操作

# 查看sdr的配置信息  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin sdr info  
SDR Version                         : 0x51  
Record Count                        : 379  
Free Space                          : 8241 bytes  
Most recent Addition                : 01/01/1970 07:59:59  
Most recent Erase                   :  
SDR overflow                        : no  
SDR Repository Update Support       : non-modal  
Delete SDR supported                : no  
Partial Add SDR supported           : yes  
Reserve SDR repository supported    : yes  
SDR Repository Alloc info supported : no  

# 傳感器倉庫sdr  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin sdr help  
SDR Commands:  list | elist [all|full|compact|event|mcloc|fru|generic]  
                     all        All SDR Records  
                     full       Full Sensor Record  
                     compact    Compact Sensor Record  
                     event      Event-Only Sensor Record  
                     mcloc      Management Controller Locator Record  
                     fru        FRU Locator Record  
                     generic    Generic Device Locator Record  
               type [sensor type]  
                     list       Get a list of available sensor types  
               info  
                     Display information about the repository itself  
               entity <id>[.<instance>]  
                     Display all sensors associated with an entity  
               dump <file>  
                     Dump raw SDR data to a file  

# 查看sdr所有的信息,list和elist的格式上略有不同  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin sdr list  
INPUT_TEMP       | 25 degrees C      | ok  
OUTPUT_TEMP      | 29 degrees C      | ok  
CPU_TEMP_01      | 42 degrees C      | ok  
CPU_TEMP_02      | 50 degrees C      | ok  
PCH_TEMP         | 45 degrees C      | ok  
MEM_TMP_ABCD_P1  | no reading        | ns  
MEM_TMP_EFGH_P1  | no reading        | ns  
MEM_TMP_ABCD_P2  | no reading        | ns  
MEM_TMP_EFGH_P2  | no reading        | ns  
VR_TEMP_P1       | 41 degrees C      | ok  
VR_TEMP_P2       | 47 degrees C      | ok  
MB_INPUT_TEMP    | 28 degrees C      | ok  
MB_OUTPUT_TEMP   | 32 degrees C      | ok  
TControl_P1      | 8 degrees C       | ok  
TControl_P2      | 8 degrees C       | ok  
  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin sdr elist  
INPUT_TEMP       | 01h | ok  |  7.1 | 25 degrees C  
OUTPUT_TEMP      | 02h | ok  |  7.2 | 29 degrees C  
CPU_TEMP_01      | 03h | ok  |  3.1 | 42 degrees C  
CPU_TEMP_02      | 04h | ok  |  3.5 | 50 degrees C  
PCH_TEMP         | 05h | ok  |  3.3 | 44 degrees C  
MEM_TMP_ABCD_P1  | 06h | ns  | 32.1 | No Reading  
MEM_TMP_EFGH_P1  | 07h | ns  | 32.5 | No Reading  
MEM_TMP_ABCD_P2  | 08h | ns  | 32.9 | No Reading  
MEM_TMP_EFGH_P2  | 09h | ns  | 32.13 | No Reading  
VR_TEMP_P1       | 0Ah | ok  |  3.8 | 41 degrees C  
VR_TEMP_P2       | 0Bh | ok  |  3.9 | 47 degrees C  
MB_INPUT_TEMP    | 0Ch | ok  |  7.3 | 28 degrees C  
MB_OUTPUT_TEMP   | 0Dh | ok  |  7.4 | 32 degrees C  
TControl_P1      | 30h | ok  |  3.3 | 8 degrees C  
TControl_P2      | 31h | ok  |  3.7 | 8 degrees C  
P12V             | 40h | ok  |  7.1 | 12.10 Volts  
P12V_AUX         | 41h | ok  |  7.19 | 12.10 Volts  
# 查看傳感器數據  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin sdr elist full  
INPUT_TEMP       | 01h | ok  |  7.1 | 25 degrees C  
OUTPUT_TEMP      | 02h | ok  |  7.2 | 29 degrees C  
CPU_TEMP_01      | 03h | ok  |  3.1 | 41 degrees C  
CPU_TEMP_02      | 04h | ok  |  3.5 | 49 degrees C  
PCH_TEMP         | 05h | ok  |  3.3 | 45 degrees C  
MEM_TMP_ABCD_P1  | 06h | ns  | 32.1 | No Reading  
MEM_TMP_EFGH_P1  | 07h | ns  | 32.5 | No Reading  
MEM_TMP_ABCD_P2  | 08h | ns  | 32.9 | No Reading  
MEM_TMP_EFGH_P2  | 09h | ns  | 32.13 | No Reading  
...................................  

# 查看傳感器有哪些類型  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin sdr type list  
Sensor Types:  
        Temperature                 Voltage  
        Current                     Fan  
        Physical Security           Platform Security  
        Processor                   Power Supply  
        Power Unit                  Cooling Device  
        Other                       Memory  
        Drive Slot / Bay            POST Memory Resize  
        System Firmwares            Event Logging Disabled  
        Watchdog                    System Event  
        Critical Interrupt          Button  
        Module / Board              Microcontroller  
        Add-in Card                 Chassis  
        Chip Set                    Other FRU  
        Cable / Interconnect        Terminator  
        System Boot Initiated       Boot Error  
        OS Boot                     OS Critical Stop  
        Slot / Connector            System ACPI Power State  
        Watchdog                    Platform Alert  
        Entity Presence             Monitor ASIC  
        LAN                         Management Subsystem Health  

# 查看指定類型的數據  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin sdr type Temperature  
INPUT_TEMP       | 01h | ok  |  7.1 | 25 degrees C  
OUTPUT_TEMP      | 02h | ok  |  7.2 | 29 degrees C  
CPU_TEMP_01      | 03h | ok  |  3.1 | 42 degrees C  
CPU_TEMP_02      | 04h | ok  |  3.5 | 49 degrees C  
PCH_TEMP         | 05h | ok  |  3.3 | 45 degrees C  
MEM_TMP_ABCD_P1  | 06h | ns  | 32.1 | No Reading  
MEM_TMP_EFGH_P1  | 07h | ns  | 32.5 | No Reading  
MEM_TMP_ABCD_P2  | 08h | ns  | 32.9 | No Reading  
MEM_TMP_EFGH_P2  | 09h | ns  | 32.13 | No Reading  
........................  

# 查看電源的個數,有一個電源  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin sdr type "Power Unit"  
POWER_STATUS     | E8h | ok  | 19.1 |  

# 查看指定sdr的配置信息  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin sdr get PCH_TEMP  
Sensor ID              : PCH_TEMP (0x5)  
 Entity ID             : 3.3 (Processor)  
 Sensor Type (Analog)  : Temperature  
 Sensor Reading        : 45 (+/- 1) degrees C  
 Status                : ok  
 Nominal Reading       : 32.000  
 Normal Minimum        : -16.000  
 Normal Maximum        : 75.000  
 Upper critical        : 95.000  
 Upper non-critical    : 93.000  
 Positive Hysteresis   : Unspecified  
 Negative Hysteresis   : Unspecified  
 Minimum sensor range  : -16.000  
 Maximum sensor range  : Unspecified  
 Event Message Control : Per-threshold  
 Readable Thresholds   : unc ucr  
 Settable Thresholds   : unc ucr  
 Threshold Read Mask   : unc ucr unr  
 Assertion Events      :  
 Assertions Enabled    : unc+ ucr+  
 Deassertions Enabled  : unc+ ucr+  

lan參數

# 可選參數    
ipmitool.exe -I lanplus -H <ip地址> -U <用戶名> -P <密碼> lan help    
LAN Commands:    
                   print [<channel number>]    
                   set [<channel number>]    
                   alert [<channel number>]    
                   stats get [<channel number>]    
                   stats clear [<channel number>]   

ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin lan print 1  
Set in Progress         : Set Complete  
Auth Type Support       :  
Auth Type Enable        : Callback :  
                        : User     :  
                        : Operator :  
                        : Admin    :  
                        : OEM      :  
IP Address Source       : Static Address  
IP Address              : 10.41.82.228  
Subnet Mask             : 255.255.252.0  
MAC Address             : 2c:f0:12:14:26:96  
SNMP Community String   : P@ssw0rd  
IP Header               : TTL=0x40 Flags=0x40 Precedence=0x00 TOS=0x10  
BMC ARP Control         : ARP Responses Enabled, Gratuitous ARP Disabled  
Gratituous ARP Intrvl   : 1.0 seconds  
Default Gateway IP      : 10.41.80.254  
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,6,7,8,11,12,15,16,17  
Cipher Suite Priv Max   : caaaaaaaaaaaXXX  
                        :     X=Cipher Suite Unused  
                        :     c=CALLBACK  
                        :     u=USER  
                        :     o=OPERATOR  
                        :     a=ADMIN  
                        :     O=OEM  

ipmitool lan set 1 ipsrc dhcp # 設置 ipmi 通過dhcp獲取IP    
ipmitool lan print 1    
ipmitool lan set 1 ipsrc static # 設置 ipmi 配置靜態 ip    
ipmitool lan set 1 ipaddress 10.1.0.10 # 設置 ipmi 的 ip 為 10.1.0.10    
ipmitool lan set 1 netmask 255.255.255.0 # 設置 ipmi 的掩碼    
ipmitool lan set 1 defgw ipaddr 10.1.0.1 # 設置 ipmi 的默認網關    
ipmitool lan set 2 defgw macaddr 00:0e:0c:aa:8e:13  
ipmitool lan set 2 arp respond on  
ipmitool lan set 2 auth ADMIN MD5  
ipmitool lan set 2 access on 

# 設置channel 1 上snmp的community為public。  
ipmitool.exe -I lanplus -H <IP地址> -U admin -P admin lan set 1 snmp public  
Setting LAN SNMP Community String to public  
  
# 驗證查看  
ipmitool.exe -I lanplus -H <IP地址> -U admin -P admin lan print 1  
......................  
SNMP Community String   : public  
....................  

# 打印trap信息  
ipmitool.exe -I lanplus -H <IP地址> -U ADMIN -P ADMIN lan alert print 1  
  
# 設置trap  
ipmitool.exe -I lanplus -H <IP地址> -U ADMIN -P ADMIN lan alert set 1 1 help  
  
usage: lan alert set <channel> <alert> <command> <option>  
  
  ipaddr <x.x.x.x>               Set alert IP address  
  macaddr <x:x:x:x:x:x>          Set alert MAC address  
  gateway <default|backup>       Set channel gateway to use for alerts  
  ack <on|off>                   Set Alert Acknowledge on or off  
  type <pet|oem1|oem2>           Set destination type as PET or OEM  
  time <seconds>                 Set ack timeout or unack retry interval  
  retry <number>                 Set number of alert retries  

user設置

ipmitool.exe  user  
Not enough parameters given.  
User Commands:  
               summary      [<channel number>]  
               list         [<channel number>]  
               set name     <user id> <username>  
               set password <user id> [<password> <16|20>]  
               disable      <user id>  
               enable       <user id>  
               priv         <user id> <privilege level> [<channel number>]  
                     Privilege levels:  
                      * 0x1 - Callback  
                      * 0x2 - User  
                      * 0x3 - Operator  
                      * 0x4 - Administrator  
                      * 0x5 - OEM Proprietary  
                      * 0xF - No Access  
  
               test         <user id> <16|20> [<password]>  
  
ipmitool.exe  user summary 1  # 查看用戶匯總信息  
Maximum IDs         : 10  
Enabled User Count  : 5  
Fixed Name Count    : 2  

ipmitool user list     # 查看用戶信息      
ipmitool user set name <user id> <username>  #增加用戶      
ipmitool user set password <user id> <password>  # 設置密碼      
ipmitool user priv <user id> <privilege level> [ChannelNo]  # 設置用戶權限      
ipmitool user enable/disable <user id> #  啟用/禁用用戶    
# 模擬登錄    
ipmitool.exe -I lanplus -H <IP地址> -U <賬號> -P <密碼> user test 2 16 ADMIN    
# 查詢概要信息      
ipmitool.exe -I lanplus -H <ip地址> -U <賬號> -P <密碼> user summary     
  
# 案例一:修改ID 2 root的密碼    
ipmitool -I lanplus -H <IP地址> -U root -P admin123456 user set password 2 yxctyun@123456      
      
# 案例二:在UID為5的位置添加ironic用戶。設置密碼vAy96gymdzP。管理員權限      
ipmitool -I lanplus -H <IP地址> -U ADMIN -P ADMIN user set name 5 ironic      
ipmitool -I lanplus -H <IP地址> -U ADMIN -P ADMIN user set password 5 vAy96gymdzP    
# 設置用戶權限    
ipmitool -I lanplus -H <IP地址> -U ADMIN -P ADMIN user priv 5 0x4 1      
ipmitool -I lanplus -H <IP地址> -U ADMIN -P ADMIN user priv 5 0x4 8      
# 激活賬號    
ipmitool -I lanplus -H <IP地址> -U ADMIN -P ADMIN user enable 5      
# 設置用戶在通道上的權限   
ipmitool -I lanplus -H <IP地址> -U ADMIN -P ADMIN channel setaccess 1 5 callin=on ipmi=on link=on privilege=4   
  
ipmitool -I lanplus -H <IP地址> -U ADMIN -P ADMIN channel setaccess 8 5 callin=on ipmi=on link=on privilege=4    
# -----------------------------------------   

注解:

[privilege=level] 配置參數可以在 ipmitool channel setaccess 輸出看到:

Possible privilege levels are:
   1   Callback level
   2   User level
   3   Operator level
   4   Administrator level
   5   OEM Proprietary level
  15   No access

所以設置值為 4 就是管理員級別

channel參數

# 查看支持命令    
ipmitool.exe -I lanplus -H <ip地址> -U <用戶名> -P <密碼> channel help    
Channel Commands: authcap   <channel number> <max privilege>    
                  getaccess <channel number> [user id]    
                  setaccess <channel number> <user id> [callin=on|off] [ipmi=on|off] [link=on|off] [privilege=level]    
                  info      [channel number]    
                  getciphers <ipmi | sol> [channel]    
    
# 獲取通道信息     
ipmitool.exe -I lanplus -H <ip地址> -U <用戶名> -P <密碼> channel info    
    
# 獲取用戶通道權限信息    
ipmitool.exe -I lanplus -H <ip地址> -U <用戶名> -P <密碼> channel getaccess 1    
    
# 設置用戶通道權限    
ipmitool -I lanplus -H <ip地址> -U <用戶名> -P <密碼> channel setaccess 1 5 callin=on ipmi=on link=on privilege=4       
    
# 獲取通道認證鑒權能力    
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> channel authcap <channel number> <max privilege>    
    
# 獲取通道的加密法套件    
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> channel getciphers <ipmi|sol> <channel>  

sel操作

# 查看sel的狀態信息  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin sel info  
SEL Information  
Version          : 1.5 (v1.5, v2 compliant)  
Entries          : 9  
Free Space       : 65341 bytes  
Percent Used     : 0%  
Last Add Time    : 10/08/2022 22:15:31  
Last Del Time    : Not Available  
Overflow         : false  
Supported Cmds   : 'Delete' 'Partial Add' 'Reserve' 'Get Alloc Info'  
# of Alloc Units : 3448  
Alloc Unit Size  : 19  
# Free Units     : 3439  
Largest Free Blk : 3439  
Max Record Size  : 13  

ipmitool sel list  # 查看 BMC 事件日志   
ipmitool sel elist   # 顯示所有系統事件日志    
ipmitool sel clear   # 刪除所有系統時間日志    
ipmitool sel delete ID     # 刪除第ID條SEL    
ipmitool sel time get     # 顯示當前BMC的時間    
ipmitool sel time set  XXX   # 設置當前BMC的時間  

event模擬告警命令

# 模擬服務器告警  
ipmitool.exe event 1  
ipmitool.exe event 2  
ipmitool.exe event 3  
  
usage: event <num>  
   Send generic test events  
   1 : Temperature - Upper Critical - Going High  
   2 : Voltage Threshold - Lower Critical - Going Low  
   3 : Memory - Correctable ECC  

chassis操作

# 支持參數  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin chassis  
Chassis Commands:  status, power, identify, policy, restart_cause, poh, bootdev, selftest  

# 查看底盤狀態,其中包括了底盤電源信息,底盤工作狀態等  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin chassis status  
System Power         : on  
Power Overload       : false  
Power Interlock      : inactive  
Main Power Fault     : false  
Power Control Fault  : false  
Power Restore Policy : always-on  
Last Power Event     : ac-failed  
Chassis Intrusion    : inactive  
Front-Panel Lockout  : inactive  
Drive Fault          : false  
Cooling/Fan Fault    : false  
Sleep Button Disable : allowed  
Diag Button Disable  : allowed  
Reset Button Disable : allowed  
Power Button Disable : allowed  
Sleep Button Disabled: true  
Diag Button Disabled : true  
Reset Button Disabled: true  
Power Button Disabled: true  

# 修改啟動順序  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin chassis bootdev <device>  
bootdev <device> [clear-cmos=yes|no]  
  none  : Do not change boot device order  
  pxe   : Force PXE boot  
  disk  : Force boot from default Hard-drive  
  safe  : Force boot from default Hard-drive, request Safe Mode  
  diag  : Force boot from Diagnostic Partition  
  cdrom : Force boot from CD/DVD  
  bios  : Force boot into BIOS Setup  

# 設置啟動項的參數  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin chassis bootparam  
bootparam get <param #>  
bootparam set bootflag <flag>  
  force_pxe   : Force PXE boot  
  force_disk  : Force boot from default Hard-drive  
  force_safe  : Force boot from default Hard-drive, request Safe Mode  
  force_diag  : Force boot from Diagnostic Partition  
  force_cdrom : Force boot from CD/DVD  
  force_bios  : Force boot into BIOS Setup  

# 管理電源恢復策略    
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin chassis policy    
chassis policy <state>    
   list        : return supported policies    
   always-on   : turn on when power is restored    
   previous    : return to previous state when power is restored    
   always-off  : stay off after power is restored   

# 查看上次重啟的原因  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin chassis restart_cause  
System restart cause: chassis power control command  
 
ipmitool chassis power on  # 用此命令可以遠程開機  
ipmitool chassis power off   # 用此命令可以遠程關機  
ipmitool chassis power reset  # 實現硬重啟,用此命令可以遠程開機  

# 查詢上電時間  
ipmitool.exe -I lanplus -H 10.41.82.228 -U admin -P admin chassis poh  
POH Counter  : 509 hours total (21 days, 5 hours)  

mc操作

# MC可選參數    
ipmitool.exe -H <IP地址> -I lanplus -U <用戶名> -P <密碼> mc    
MC Commands:    
  reset <warm|cold>    
  info    
  selftest    
  getenables    
  setenables <option=on|off> ...    
    recv_msg_intr         Receive Message Queue Interrupt    
    event_msg_intr        Event Message Buffer Full Interrupt    
    event_msg             Event Message Buffer    
    system_event_log      System Event Logging    
    oem0                  OEM 0    
    oem1                  OEM 1    
    oem2                  OEM 2    
  
#列出BMC所有允許的選項    
ipmitool.exe -H <IP地址> -I lanplus -U <用戶名> -P <密碼> mc getenables    
Receive Message Queue Interrupt          : enabled    
Event Message Buffer Full Interrupt      : disabled    
Event Message Buffer                     : disabled    
System Event Logging                     : enabled    
OEM 0                                    : disabled    
OEM 1                                    : disabled    
OEM 2                                    : disabled    
  
# 設置bmc相應的允許/禁止選項。  
ipmitool.exe -H <IP地址> -I lanplus -U <用戶名> -P <密碼> mc setenables =[on|off]   
  
ipmitool mc reset cold   # BMC 冷啟動  
ipmitool mc reset warm   # BMC 熱啟動  
# 查詢BMC自測試結果      
ipmitool.exe -H <IP地址> -I lanplus -U <用戶名> -P <密碼> mc selftest     
# 查詢BMC GUID信息    
ipmitool.exe -I lanplus -H <IP地址> -U <用戶名> -P <密碼> mc guid    
# 控制前插板指示燈亮(定位燈)    
ipmitool.exe -I lanplus -H <IP地址> -U <用戶名> -P <密碼> chassis identify   

 pef參數

# 設置 Platform Event Filtering (PEF),事件過濾平台用於在監控系統發現有event時候,用PEF中的策略進行事件過濾,然后看是否需要報警。 
# 打印Platform Event Filtering (pef)信息      
  
ipmitool.exe -H <IP地址> -I lanplus -U <用戶名> -P <密碼> pef info      
  
# 查看Platform Event Filtering (pef)狀態      
  
ipmitool.exe -H <IP地址> -I lanplus -U <用戶名> -P <密碼> pef status      
  
# 查看Platform Event Filtering (pef)策略設置      
  
ipmitool.exe -H <IP地址> -I lanplus -U <用戶名> -P <密碼> pef policy  

sol參數

SOL需要IPMI2.0支持,使用lanplus進行遠程連接。

Serial Over LAN (SOL) 功能非常有用。SOL 通過 IPMI 會話重定向本地串行接口,允許遠程訪問 Windows 的緊急事件管理控制台 (EMS) 特殊管理控制台 (SAC),或訪問 LINUX 串行控制台。

# 可選參數    
ipmitool.exe -I lanplus -H <IP地址> -U <用戶名> -P <密碼> sol help    

SOL Commands: info [<channel number>]    

              set <parameter> <value> [channel]    

              activate    

              deactivate    

              looptest [<loop times>] [<loop interval(in ms)>]   

# 顯示SOL參數配置信息  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol info  

# 建立SOL會話  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol activate  

# 關閉SOL會話  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol deactivate  

# 設置SOL通道1使能狀態  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol set enabled <true|false> <channel>
  

# 可選參數    
ipmitool.exe -I lanplus -H <ip地址> -U <用戶名> -P <密碼> sol set    

SOL set parameters and values:    

  set-in-progress             set-complete | set-in-progress | commit-write    

  enabled                     true | false    

  force-encryption            true | false    

  force-authentication        true | false    

  privilege-level             user | operator | admin | oem    

  character-accumulate-level  <in 5 ms increments>    

  character-send-threshold    N    

  retry-count                 N    

  retry-interval              <in 10 ms increments>    

  non-volatile-bit-rate       serial | 9.6 | 19.2 | 38.4 | 57.6 | 115.2    

  volatile-bit-rate           serial | 9.6 | 19.2 | 38.4 | 57.6 | 115.2   

# 設置SOL參數狀態  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol set set-in-progress <set-complete|set-in-progress|commit-write>  

# 設置SOL負載是否強制加密  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol set force-encryption <true|false>  

# 設置SOL負載是否強制認證  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol set force-authentication <true|false>  

# 設置建立SOL會話的最低權限級別  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol set privilege-level <user|operator|admin|oem>  

# 設置SOL字符發送間隔,一個單位為5 ms  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol set character-accumulate-level <level>  

# 設置SOL字符門限(32字節)  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol set character-send-threshold <bytes>  

# 設置SOL重發次數  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol set retry-count <count>  

# 設置SOL重發時間間隔(一個單位為10 ms)  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol set retry-interval <interval>  

# 設置用戶對負載的訪問權限(和命令參數名不一致)  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol payload <enable|disable> <channel> <用戶ID>  

# SOL連接壓力測試  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼> sol looptest <loop-times> <loop-interval>  
  
# 設置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>  

lan6參數

ipmitool.exe -I lanplus -H 192.168.2.100 -U admin -P admin lan6  
  help [command]  
  save <channel> [<parameter> [<set_sel> [<block_sel>]]]  
  set <channel> [nolock] <parameter> [<set_sel> [<block_sel>]] <values...>  
  print <channel> [<parameter> [<set_sel> [<block_sel>]]]  
  lock <channel>  
  commit <channel>  
  discard <channel>  
# 查看IPv6地址  
ipmitool.exe -I lanplus -H 10.41.83.111 -U yfadmin -P yfadmin lan6 print 1  
  
ipmitool.exe -I lanplus -H 10.41.83.111 -U yfadmin -P yfadmin lan6 set  
  set <channel> [nolock] <parameter> [<set_sel> [<block_sel>]] <values...>  
  
   available parameters:  
    enables {ipv4|ipv6|both}  
    traffic_class <value>  
    static_hops <value>  
    flow_label <value>  
    static_addr <set_sel> {enable|disable} <addr> <pfx_len>  
    static_duid <set_sel> <block_sel> <data>  
    dynamic_duid <set_sel> <block_sel> <data>  
    dhcp6_cfg <set_sel> <data> <data>  
    rtr_cfg {static|dynamic|both}  
    static_rtr <set_sel> <addr> <macaddr> <prefix> <prefix_len>  
    ndslaac_cfg <set_sel> <data>  

其他參數用法

# 從文件中讀取命令  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼>  exec <filename>

# 交互式執行命令  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼>  shell  

# 獲取目前有活動會話  
ipmitool -H <IP地址> -I lanplus -U <用戶名> -P <密碼>  session info <active>  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM