嘘~ 正在从服务器偷取页面 . . .

IPMITOOL命令清单


Usage

ipmitool的所有调用都需要指定要使用的接口,除非希望使用在编译时设置的默认接口。每次调用还必须指定要运行的命令。使用-h选项可以看到支持的列表中的顶级命令列表。

IPMI提供了标准的消息传递接口。
以下概念与此消息传递接口相关:

Channel type     : Communication channel type (SMS/KCS, IPMB, LAN) 
Channel number   : Channel descriptor
Requester        : Address of the requester
Responder        : Address of the responder
NetFN            : The logical function  for the request/response.
Command          : The command number 
Sequence         : An ID identifiying the request/response pair
Message tracking : The ability to match request/response pair.
Direct Command
--------------
The simplest form of communication is a "direct command" using SMS/KCS

Example:
 ipmitool raw 6 4
  55 00

This send raw command 4 (selftest) from netfn 6(application) to KCS, the driver 
takes care of 'message tracking' and provides the answer.

Hopefully, the application also includes a "human readable" instance of the API:
 ipmitool mc selftest
 Selftest: passed
Bridged Command
---------------
One slightly more complicated communication mode is the so-called 
"bridged command" using IPMB. 

Example:
 ipmitool -m 0x94 -t 0x9a raw 6 4
 55 00
 
 or
 
 ipmitool -m 0x94 -t 0x9a mc selftest
 Selftest: passed
 
This still sends the same command  4 (selftest) from netfn 6(application) to the target. However, to do so, the command is 
encapsulated (by the driver) andsent using the command 0x34 (send message) from netfn 6(application) to KCS. Then KCS is polled by 
the driver until a message has been received, then thedriver uses command 0x33 (get message). The driver also tracks the message and 
makes sure the response matches the request. Then it decapsultates themessage and gives the response back to the application.
Dual Bridged Command
--------------------
Things get a little more ugly when the application needs to reach a management controller sitting on an interface (or channel) not 
directly connected to the BMC/IPMC. In the case the application must encapsulate its message itself and request the IPMC to deal with 
message tracking itself.

Its been working well with IPMITOOL on the LAN interface with:
 ipmitool -H  -U  -P  -B 0 -T 0x8a  -m 0x20 -t 0x7a -b 7  
    mc selftest

However, trying to dual bridge commands locally with :
 ipmitool -B 0 -T 0x9a -m 0x94 -t 0x7a -b 7 mc selftest didn't work 
 (it returned the same data as  ipmitool -m 0x20 -t 0x7a -b 7 mc selftest )
 
The reason was that the "openipmi" interface pluging didn't 
encapsulate/decapsulate the message and didn't even detect the intent
to double bridge the request.

 ./src/ipmitool -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7 mc selftest
 
-B    0  : transit channel for first bridge level (channel 0: IPMB-0) 
-T 0x8a  : transit destination address (remote IPMC address)
-m 0x94  : source address (local IPMC address on IPMB-0)
-t 0x7a  : remote target (AMC IPMB-L address)
-b    7  : remote channel (channel 7: IPMB-L)

The transit source address (remote IPMC address on remote channel) is 
automatically assigned by the remote IPMC.
Payload Size Limit
------------------
Because some commands return a lot of data (fru read/get sdr) and because 2 
levels of encapsulation are used, some command will fail.

For instance this works.
ipmitool -H  -U  -P   -B 0 -T 0x8a  -m 0x94 -t 0x7a -b 7 
    mc selftest

but this does not:    
ipmitool -H  -U  -P   -B 0 -T 0x8a  -m 0x94 -t 0x7a -b 7 
    fru print.
usage: ipmitool [options...]  
=============|=====================
-h           | This help
-V           | Show version information
-v           | Verbose (can use multiple times)
-c           | Display output in comma separated format
-C           | Use remote server authentication, integrity, and encryption algorithms for the IPMIv2 lanplus connection.
-I intf      | Interface to use
-H hostname  | Remote host name for LAN interface
-L level     | Remote session privilege level [default=USER]
-A authtype  | Force use of authtype NONE, PASSWORD, MD2 or MD5
-U username  | Remote session username
-P password  | Remote session password
-p port      | Remote RMCP port [default=623]
-f file      | Read remote session password from file
-a           | Prompt for remote password
-E           | Read password from IPMI_PASSWORD environment variable
-m address   | Set local IPMB address
-t address   | Bridge request to remote target address
Interfaces:
=============|=====================
   open      | Linux OpenIPMI Interface [default]
   imb       | Intel IMB Interface
   lan       | IPMI v1.5 LAN Interface
   lanplus   | IPMI v2.0 RMCP+ LAN Interface
Commands:
=============|=====================
   raw       | Send a RAW IPMI request and print response
   lan       | Configure LAN Channels
   chassis   | Get chassis status and set power state
   event     | Send pre-defined events to BMC
   bmc       | Print BMC status and configure 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 Evelnt Log
   sol       | Configure IPMIv2.0 Serial-over-LAN 
   user      | Configure BMC users
   channel   | Configure BMC channels
   session   | Print session information
   shell     | Launch interactive IPMI shell
   exec      | Run list of commands from file
   set       | Set runtime variable for shell and exec

IPMITOOL-cheatsheet

本文档旨在为OpenBMC提供一组ipmitool命令。

Power

1. View server status

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power status

2. Server power on

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power on

3. Server power off

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power off

4. Server power reset

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power reset

5. Server power cycle

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power cycle

6. Server power soft

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power soft

7. Send a diagnostic interrupt directly to the processor(not support)

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power diag

Users

1. View information for all users

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user list

2. Display a brief summary of BMC users

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user summary

3. Create a BMC user with a given name

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user set name <userid> <username>

4. Set a given user with a given password

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user set password <userid>[<password>]

5. Disable designated users from accessing BMC

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user disable <userid>

6. Enable the specified user to access BMC

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user enable <userid>

Field-replaceable Unit (FRU)

1. View FRU information

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" fru list

Sensor Data Record (SDR)

1. View SDR information

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sdr
$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sdr info

3. View sensor date records

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sdr list [all|full|compact|event|mcloc|fru|generic]
all     : All SDR records (sensors and positioners)
full    : Complete sensor recording
compact : Simple sensor recording
event   : Event information recorded by the sensor
mcloc   : Manage controller locator records
fru     : FRU (Field Replaceable Unit) locator record
generic : General SDR records

Sensors

1. View sensor information

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sensor list

Management Controller (MC)

1. Instruct the BMC to perform a cold reset

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" mc reset cold

2. Instruct the BMC to perform a warm reset(not supported)

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" mc reset warm

3. View BMC information

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" mc info

4. View the currently available operation options of BMC

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" mc getenables

Channels

1. Display the authentication function about the selected information

channel

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" channel authcap <channel number> <max privilege>

2. Display the information for the selected channel

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" channel info [<channel number>]

3. View channel information

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" channel info

Chassis

1. Display information about the high-level status of the system rack and

power subsystem.

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis status

2. The command will return the power on time

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis poh

3. Query the reason for the last system restart.(not supported)

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis restart_cause

4. Set rack power strategy in case of power failure

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" 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

5. View and change power status

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis power
status : show current status
on     : power on
off    : power off
reset  : power reset
soft   : power soft
cycle  : power cycle

6. Set boot device for next system restart

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device>
Currently supported devices:

| device | function                                                    |
| :----: | ----------------------------------------------------------- |
|  none  | do not change boot device                                   |
|  pxe   | boot from pxe                                               |
|  disk  | boot from BIOS default boot device                          |
|  safe  | boot from BIOS default boot device,but requires a safe mode |
|  diag  | boot from the diagnostic partition                          |
| cdrom  | boot from the CD/DVD                                        |
|  bios  | enter bios settings                                         |

If you want to make your override persistent over reboots use the persistent
option:

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device> options=persistent

If the main host machine is based on the x86 CPU you need also pay attention to
the legacy/EFI mode selector. By default IPMI overrides boot source with the
legacy mode enabled. To set EFI mode use efiboot option:

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device> options=efiboot

You can combine options with a help of ,:

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device> options=persistent,efiboot

To read current boot source override setting:

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootparam get 5

7. Control panel logo light

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis identify <interval>

Local Area Network(LAN)

1. Output the current configuration information of a given channel

 $ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" lan print [<channel number>]

2. Set the given parameters for the given channel

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" lan set <channel> <command> <parameter>
Valid parameter
ipaddr                  : Set ip for this channel
netmask                 : Set netmask for this channel
macaddr       : Set the mac address for this channel
defgw ipaddr            : Set the default gateway IP address
defgw macaddr : Set the mac address of the default gateway
bakgw ipaddr            : Set the IP address of the backup gateway
bakgw macaddr : Set the IP address of the backup gateway
password                   : Set no user password
access                   : Set the LAN channel access mode

System Event Log (SEL)

1. Query the relevant information about SEL and its content in BMC


$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel info

2. Clear the information in SEL,but it cannot be undone.

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel clear

3. Delete a single event

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel delete <number>

4. Display the current time of the SEL clock

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel time get

Session

1. Display session information

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" session info all

Serial Over Lan (SOL)

1. Retrieve Serial-Over-LAN configuration information for the specified

channel.

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol info [<channel number>]

2. Put ipmitool into Serial Over LAN mode

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol activate

3. Disable serial LAN in BMC mode

$ ipmitool -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol deactivate

文章作者: kclouder
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 kclouder !
  目录