IPMITOOL 初窥


要使用IPMITOOL工具,首先需要了解怎样获取帮助

# 查看ipmitool的帮助,可以看到如下信息
[root@r720 etc]# ipmitool help 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 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
# 如果要查看上面Command某一个小项目的帮助,使用如下命令,例如查看sdr的使用帮助 [root@r720 etc]# ipmitool 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 get Retrieve the state of a specified sensor 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 fill sensors Creates the SDR repository for the current configuration file <file> Load SDR repository from a file
# 查看Command某一个小项目的帮助可以继续向后面追加,如下 [root@r720 etc]# ipmitool sdr type help 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 Battery Session Audit Version Change FRU State # 例如获取温度信息,可以使用如下命令
[root@r720 etc]# ipmitool sdr type Temperature Inlet Temp
| 04h | ok | 7.1 | 28 degrees C Exhaust Temp | 01h | ok | 7.1 | 26 degrees C Temp | 0Eh | ok | 3.1 | -75 unspecified Temp | 0Fh | ok | 3.2 | -72 unspecified

 

以下内容摘自IPMITOOL Man-page,或者也可以使用man ipmitool查看

LIPMI INTERFACE

The ipmitool lipmi interface uses the Solaris 9 IPMI kernel device driver. It has been superceeded by the bmc interface on Solaris 10. You can tell ipmitool to use this interface by specifying it on the command line.

ipmitool -I lipmi <expression 

LAN INTERFACE

The ipmitool lan interface communicates with the BMC over an Ethernet LAN connection using UDP under IPv4. UDP datagrams are formatted to contain IPMI request/response messages with a IPMI session headers and RMCP headers.

IPMI-over-LAN uses version 1 of the Remote Management Control Protocol (RMCP) to support pre-OS and OS-absent management. RMCP is a request-response protocol delivered using UDP datagrams to port 623.

The LAN interface is an authenticatiod multi-session connection; messages delivered to the BMC can (and should) be authenticated with a challenge/response protocol with either straight password/key or MD5 message-digest algorithm. ipmitool will attempt to connect with administrator privilege level as this is required to perform chassis power functions.

You can tell ipmitool to use the lan interface with the -I lan option:

 

ipmitool -I lan -H <hostname> [-U <username>] [-P <password>] <command>

A hostname must be given on the command line in order to use the lan interface with ipmitool. The password field is optional; if you do not provide a password on the command line, ipmitool will attempt to connect without authentication. If you specify a password it will use MD5 authentication if supported by the BMC and straight password/key otherwise, unless overridden with a command line option.  

LANPLUS INTERFACE

Like the lan interface, the lanplus interface communicates with the BMC over an Ethernet LAN connection using UDP under IPv4. The difference is that the lanplus interface uses the RMCP+ protocol as described in the IMPI v2.0 specification. RMCP+ allows for improved authentication and data integrity checks, as well as encryption and the ability to carry multiple types of payloads. Generic Serial Over LAN support requires RMCP+, so the ipmitool sol activate command requires the use of the lanplus interface.

RMCP+ session establishment uses a symmetric challenge-response protocol called RAKP (Remote Authenticated Key-Exchange Protocol) which allows the negotiation of many options. ipmitool does not yet allow the user to specify the value of every option, defaulting to the most obvious settings marked as required in the v2.0 specification. Authentication and integrity HMACS are produced with SHA1, and encryption is performed with AES-CBC-128. Role-level logins are not yet supported.

ipmitool must be linked with the OpenSSL library in order to perform the encryption functions and support the lanplus interface. If the required packages are not found it will not be compiled in and supported.

You can tell ipmitool to use the lanplus interface with the -I lanplus option:

 

ipmitool -I lanplus -H <hostname> [-U <username>] [-P <password>] <command>

A hostname must be given on the command line in order to use the lan interface with ipmitool. With the exception of the -A and -C options the rest of the command line options are identical to those available for the lan interface.

The -C option allows you specify the authentication, integrity, and encryption algorithms to use for for lanplus session based on the cipher suite ID found in the IPMIv2.0 specification in table 22-19. The default cipher suite is 3 which specifies RAKP-HMAC-SHA1 authentication, HMAC-SHA1-96 integrity, and AES-CBC-128 encryption algorightms.  

EXAMPLES

Example 1: Listing remote sensors

> ipmitool -I lan -H 1.2.3.4 -f passfile sdr list 
Baseboard 1.25V | 1.24 Volts | ok 
Baseboard 2.5V | 2.49 Volts | ok 
Baseboard 3.3V | 3.32 Volts | ok

Example 2: Displaying status of a remote sensor

> ipmitool -I lan -H 1.2.3.4 -f passfile sensor get "Baseboard 1.25V" 
Locating sensor record... 
Sensor ID : Baseboard 1.25V (0x10) 
Sensor Type (Analog) : Voltage 
Sensor Reading : 1.245 (+/- 0.039) Volts 
Status : ok 
Lower Non-Recoverable : na 
Lower Critical : 1.078 
Lower Non-Critical : 1.107 
Upper Non-Critical : 1.382 
Upper Critical : 1.431 
Upper Non-Recoverable : na

Example 3: Displaying the power status of a remote chassis

> ipmitool -I lan -H 1.2.3.4 -f passfile chassis power status 
Chassis Power is on

Example 4: Controlling the power on a remote chassis

> ipmitool -I lan -H 1.2.3.4 -f passfile chassis power on 
Chassis Power Control: Up/On         

posted @ 2012-07-30 17:30  DanielXLee  阅读(4333)  评论(0编辑  收藏  举报