ipmitool工具常用命令汇总

更新时间:2024-06-06 23:07:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

ipmitool工具常用命令汇总

目录

1.工具的安装............................................................................................................. 3 2.命令的help ............................................................................................................ 3 3.查看管理口的IP地址 ............................................................................................. 5 4.管理底盘chassis配置 ........................................................................................... 6 4.1查看底盘配置汇总 ............................................................................................ 6 4.2管理电源 .......................................................................................................... 6 4.3管理时间间隔 ................................................................................................... 7 4.4管理电源恢复策略 ............................................................................................ 7 4.5查看上次重启原因 ............................................................................................ 7 4.6查询上电时间 ................................................................................................... 8 4.7管理启动项 ...................................................................................................... 8 4.8设置启动项的参数 ............................................................................................ 8 5.使用delloem进行管理 ........................................................................................... 9 5.1配置lcd ........................................................................................................... 9 5.2查看MAC地址 ................................................................................................. 10 5.3设置lan的模式 ............................................................................................. 11 5.4设置背板led的状态 ...................................................................................... 11

5.5管理电源监控 ................................................................................................. 12 6.查看传感器数据sensor ........................................................................................ 12 6.1查看当前系统所有的传感器数据 ..................................................................... 13 6.2设置传感器的告警阈值 ................................................................................... 13 6.3查看某一传感器的状态信息 ............................................................................ 13 6.4查看某一个传感器的当前值 ............................................................................ 14 7.管理传感器仓库sdr ............................................................................................. 14 7.1查看传感器仓库中的信息列表 ........................................................................ 15 7.2查看传感器的类型和指定类型的数据 .............................................................. 16 7.3查看指定传感器的配置信息 ............................................................................ 17 7.4查看传感器仓库sdr的配置信息 ..................................................................... 18 8.查看系统事件sel日志 ......................................................................................... 18 8.1查看sel的状态信息 ...................................................................................... 18 8.2查看sel的中的日志信息 ............................................................................... 19

1.工具的安装

yum install -y OpenIPMIipmitool

开启服务

/etc/init.d/ipmi status /etc/init.d/ipmi start

[root@cell83 ~]#ipmitool -V ipmitool version 1.8.18

2.命令的help

明细的命令参考man ipmitool 或者附件ipmitool.help

[root@cell83 ~]#ipmitool -h ipmitool version 1.8.18

usage: ipmitool [options...]

-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 -4 Use only IPv4 -6 Use only IPv6

-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

usb IPMI USB Interface(OEM Interface for AMI Devices)

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 nm Node Manager 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 vita Run a VITA 46.11 extended cmd lan6 Configure IPv6 LAN Channels

3.查看管理口的IP地址

[root@cell83 ~]#ipmitool -I open lan print

[root@cell83 ~]#ipmitool -I open lan print | grep IP IP Address Source : Static Address IP Address : 192.168.0.133

IP Header : TTL=0x40 Flags=0x40 Precedence=0x00 TOS=0x10 Default Gateway IP : 192.168.0.1 Backup Gateway IP : 0.0.0.0

4.管理底盘chassis配置

[root@cell83 ~]#ipmitool -I open chassis help Chassis Commands: status, power, identify, policy, restart_cause, poh, bootdev, bootparam, selftest

4.1查看底盘配置汇总

[root@cell83 ~]#ipmitool -I open chassis status System Power : on Power Overload : false Power Interlock : inactive Main Power Fault : false Power Control Fault : false Power Restore Policy : previous Last Power Event :

Chassis Intrusion : inactive Front-Panel Lockout : inactive Drive Fault : false Cooling/Fan Fault : false

Sleep Button Disable : not allowed Diag Button Disable : allowed Reset Button Disable : not allowed Power Button Disable : allowed Sleep Button Disabled: false Diag Button Disabled : true Reset Button Disabled: false Power Button Disabled: false

4.2管理电源

查看当前电源状态

[root@cell83 ~]#ipmitool -I open chassis power status Chassis Power is on

打开电源

ipmitool -I open chassis power on

关闭电源

ipmitool -I open chassis power off

重启电源

ipmitool -I open chassis power cycle

重置电源

ipmitool -I open chassis power reset

其他配置

ipmitool -I open chassis powerdiag ipmitool -I open chassis power soft

4.3管理时间间隔

查询时间间隔:

[root@cell83 ~]#ipmitool -I open chassis identify Chassis identify interval: default (15 seconds)

设置时间间隔:

[root@cell83 ~]#ipmitool -I open chassis identify help chassis identify

default is 15 seconds 0 to turn off

force to turn on indefinitely 4.4管理电源恢复策略

[root@cell83 ~]#ipmitool -I open chassis policy help chassis policy

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

4.5查看上次重启原因

[root@cell83 ~]#ipmitool -I open chassis restart_cause System restart cause: unknown

4.6查询上电时间

[root@cell83 ~]#ipmitool -I open chassis poh

Get Chassis Power-On-Hours failed: Invalid command

4.7管理启动项

[root@cell83 ~]#ipmitool -I open chassis bootdev help bootdev [clear-cmos=yes|no] bootdev [options=help,...]

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

floppy: Force boot from Floppy/primary removable media

4.8设置启动项的参数

[root@cell83 ~]#ipmitool -I open chassis bootparam help bootparam get

bootparam set bootflag [options=...] Legal devices are:

none : No override 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 Legal options are:

help : print this message

PEF : Clear valid bit on reset/power cycle cause by PEF timeout : Automatically clear boot flag valid bit on timeout

watchdog: Clear valid bit on reset/power cycle cause by watchdog reset : Clear valid bit on push button reset/soft reset

power : Clear valid bit on power up via power push button or wake event Any Option may be prepended with no- to invert sense of operation

5.使用delloem进行管理

查看帮助

[root@cell83 ~]#ipmitool -I open delloem help

usage: delloem [option...]

commands: lcd mac lan setled

powermonitor vFlash

For help on individual commands type: delloem help

5.1配置lcd

[root@cell83 ~]#ipmitool -I open delloemlcd help

Generic DELL HW:

lcd set {none}|{default}|{custom }

Set LCD text displayed during non-fault conditions

iDRAC 11g or iDRAC 12g or iDRAC 13g :

lcd set {mode}|{lcdqualifier}|{errordisplay}

Allows you to set the LCD mode and user-defined string.

lcd set mode {none}|{modelname}|{ipv4address}|{macaddress}| {systemname}|{servicetag}|{ipv6address}|{ambienttemp} {systemwatt }|{assettag}|{userdefined}

Allows you to set the LCD display mode to any of the preceding parameters

lcd set lcdqualifier {watt}|{btuphr}|{celsius}|{fahrenheit}

Allows you to set the unit for the system ambient temperature mode.

lcd set errordisplay {sel}|{simple}

Allows you to set the error display.

lcd info

Show LCD text that is displayed during non-fault conditions

lcd set vkvm{active}|{inactive}

Set vKVM active and inactive, message will be displayed on lcd when vKVM is active and vKVM session is in progress

lcd set frontpanelaccess {viewandmodify}|{viewonly}|{disabled} Set LCD mode to view and modify, view only or disabled

lcd status

Show LCD Status for vKVM display

and Front Panel access mode {viewandmodify}|{viewonly}|{disabled}

5.2查看MAC地址

[root@cell83 ~]#ipmitool -I open delloem mac help

mac list

Lists the MAC address of LOMs

mac get

Shows the MAC address of specified LOM. 0-7 System LOM, 8- DRAC/iDRAC.

[root@cell83 ~]#ipmitool -I open delloem mac list

System LOMs

NIC Number MAC Address Status

0 b8:2a:72:db:56:2a Enabled 1 b8:2a:72:db:56:2b Enabled 2 b8:2a:72:db:56:28 Enabled 3 b8:2a:72:db:56:29 Enabled

iDRAC7 MAC Address b0:83:fe:c9:6d:31

5.3设置lan的模式

[root@cell83 ~]#ipmitool -I open delloemlan help

lan set

sets the NIC Selection Mode : on iDRAC12g OR iDRAC13g :

dedicated, shared with lom1, shared with lom2,shared with lom3,shared

with lom4,shared with failover lom1,shared with failover lom2,shared

with failover lom3,shared with failover lom4,shared with Failover all

loms, shared with Failover None). on other systems :

dedicated, shared, shared with failover lom2, shared with Failover all loms.

lan get

on iDRAC12g or iDRAC13g :

returns the current NIC Selection Mode (dedicated, shared with lom1, shared

with lom2, shared with lom3, shared with lom4,shared with failover lom1,

shared with failover lom2,shared with failover lom3,shared with failover

lom4,shared with Failover all loms,shared with Failover None). on other systems :

dedicated, shared, shared with failover, lom2, shared with Failover all loms.

lan get active

returns the current active NIC (dedicated, LOM1, LOM2, LOM3, LOM4).

5.4设置背板led的状态

[root@cell83 ~]#ipmitool -I open delloemsetled help

setled

Set backplane LED state

b:d.f = PCI Bus:Device.Function of drive (lspci format) state = present|online|hotspare|identify|rebuilding|

fault|predict|critical|failed 5.5管理电源监控

[root@cell83 ~]#ipmitool -I open delloempowermonitor help

powermonitor

Shows power tracking statistics

powermonitor clear cumulativepower Reset cumulative power reading

powermonitor clear peakpower Reset peak power reading

powermonitorpowerconsumption

Displays power consumption in

powermonitorpowerconsumptionhistory Displays power consumption history

powermonitorgetpowerbudget

Displays power cap in

powermonitorsetpowerbudget

Allows user to set the power cap in

powermonitorenablepowercap To enable set power cap

powermonitordisablepowercap To disable set power cap

6.查看传感器数据sensor

[root@cell83 ~]#ipmitool -I open sensor help Sensor Commands: list thresh get reading

6.1查看当前系统所有的传感器数据

[root@cell83 ~]#ipmitool -I open sensor list

6.2设置传感器的告警阈值

[root@cell83 ~]#ipmitool -I open sensor thresh help sensor thresh

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 lower Set all lower thresholds at the same time

sensor thresh upper

Set all upper thresholds at the same time

6.3查看某一传感器的状态信息

[root@cell83 ~]#ipmitool -I open sensor get help sensor get ... [id]

id : name of desired sensor

查看温度传感器

[root@cell83 ~]#ipmitool -I open sensor get Temp Locating sensor record...

Sensor ID : Temp (0xe) Entity ID : 3.1

Sensor Type (Threshold) : Temperature

Sensor Reading : 48 (+/- 1) degrees C Status : ok Lower Non-Recoverable :na

Lower Critical : 3.000 Lower Non-Critical : 8.000

Upper Non-Critical : 79.000 Upper Critical : 84.000 Upper Non-Recoverable :na

Positive Hysteresis : 1.000 Negative Hysteresis : 1.000 Assertion Events : Assertions Enabled :

6.4查看某一个传感器的当前值

[root@cell83 ~]#ipmitool -I open sensor reading help sensor reading ... [id]

id : name of desired sensor

查看温度传感器

[root@cell83 ~]#ipmitool -I open sensor reading Temp Temp | 47

7.管理传感器仓库sdr

[root@cell83 ~]#ipmitool -I open sdr help usage: sdr [options]

list | elist [option]

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 [option]

Retrieve the state of specified sensor. Sensor_Type can be specified either as

a string or a hex value.

list Get a list of available sensor types

get

Retrieve state of the first sensor matched by Sensor_ID

info

Display information about the repository itself

entity [.]

Display all sensors associated with an entity

dump

Dump raw SDR data to a file

fill

sensors Creates the SDR repository for the current configuration

nosat Creates the SDR repository for the current

configuration, without satellite scan file Load SDR repository from a file

range Load SDR repository from a provided list or range. Use ',' for list or '-' for range, eg. 0x28,0x32,0x40-0x44

7.1查看传感器仓库中的信息列表

[root@cell83 ~]#ipmitool -I open sdrelist help

usage: sdrelist [all|full|compact|event|mcloc|fru|generic]

=>查看仓库中所有的信息:elist和list的格式内容上略有不同 [root@cell83 ~]#ipmitool -I open sdrelist all [root@cell83 ~]#ipmitool -I open sdr list all

=>查看传感器的数据

[root@cell83 ~]#ipmitool -I open sdrelist full Fan1 RPM | 30h | ok | 7.1 | 6240 RPM Fan2 RPM | 31h | ok | 7.1 | 6240 RPM Fan3 RPM | 32h | ok | 7.1 | 6240 RPM Fan4 RPM | 33h | ok | 7.1 | 6120 RPM Fan5 RPM | 34h | ok | 7.1 | 6240 RPM Fan6 RPM | 35h | ok | 7.1 | 6240 RPM Inlet Temp | 04h | ok | 7.1 | 35 degrees C Exhaust Temp | 01h | ok | 7.1 | 40 degrees C Temp | 0Eh | ok | 3.1 | 47 degrees C Temp | 0Fh | ok | 3.2 | 46 degrees C

Current 1 | 6Ah | ok | 10.1 | 0.80 Amps Current 2 | 6Bh | ns | 10.2 | No Reading Voltage 1 | 6Ch | ok | 10.1 | 236 Volts Voltage 2 | 6Dh | ns | 10.2 | No Reading PwrConsumption | 77h | ok | 7.1 | 168 Watts

说明:

Fan ----表示风扇

Inlet Temp ----进口温度 Exhaust Temp ----出口温度 Temp ----CPU的温度 Current --电流 Voltage ---电压 Pwr Consumption ----功率

7.2查看传感器的类型和指定类型的数据

查看传感器有哪些类型

[root@cell83 ~]#ipmitool -I open sdr type list Sensor Types:

Temperature (0x01) Voltage (0x02) Current (0x03) Fan (0x04) Physical Security (0x05) Platform Security (0x06) Processor (0x07) Power Supply (0x08) Power Unit (0x09) Cooling Device (0x0a) Other (0x0b) Memory (0x0c) Drive Slot / Bay (0x0d) POST Memory Resize (0x0e) System Firmwares (0x0f) Event Logging Disabled (0x10)

Watchdog1 (0x11) System Event (0x12) Critical Interrupt (0x13) Button (0x14) Module / Board (0x15) Microcontroller (0x16) Add-in Card (0x17) Chassis (0x18) Chip Set (0x19) Other FRU (0x1a) Cable / Interconnect (0x1b) Terminator (0x1c) System Boot Initiated (0x1d) Boot Error (0x1e) OS Boot (0x1f) OS Critical Stop (0x20) Slot / Connector (0x21) System ACPI Power State (0x22) Watchdog2 (0x23) Platform Alert (0x24) Entity Presence (0x25) Monitor ASIC (0x26) LAN (0x27) Management Subsys Health (0x28) Battery (0x29) Session Audit (0x2a) Version Change (0x2b) FRU State (0x2c)

查看指定传感器的数据 如查看温度:

[root@cell83 ~]#ipmitool -I open sdr type Temperature Inlet Temp | 04h | ok | 7.1 | 35 degrees C Exhaust Temp | 01h | ok | 7.1 | 40 degrees C Temp | 0Eh | ok | 3.1 | 46 degrees C Temp | 0Fh | ok | 3.2 | 47 degrees C

如查看电源的个数1:有一个电源

[root@cell83 dvd]#ipmitool -I open sdr type \PS Redundancy | 74h | ns | 7.1 | No Reading

Status | 62h | ok | 10.1 | Presence detected Status | 63h | ns | 10.2 | Disabled

如查看电源的个数2:有四个电源

[root@db04 ~]#ipmitool -I open sdr type \PS Redundancy | 74h | ok | 7.1 | Redundancy Lost Status | 62h | ok | 10.1 | Presence detected

Status | 63h | ok | 10.2 | Presence detected, Power Supply AC lost Status | 52h | ok | 10.3 | Presence detected, Config Error, Power Supply Inactive

Status | 53h | ok | 10.4 | Presence detected, Config Error, Power Supply Inactive

7.3查看指定传感器的配置信息

[root@cell83 ~]#ipmitool -I open sdr get Temp Sensor ID : Temp (0xe)

Entity ID : 3.1 (Processor)

Sensor Type (Threshold) : Temperature (0x01) Sensor Reading : 47 (+/- 1) degrees C Status : ok

Nominal Reading : 23.000 Normal Minimum : 11.000 Normal Maximum : 69.000 Upper critical : 83.000 Upper non-critical : 77.000 Lower critical : 3.000 Lower non-critical : 8.000 Positive Hysteresis : 1.000 Negative Hysteresis : 1.000

Minimum sensor range : Unspecified Maximum sensor range : Unspecified

Event Message Control : Per-threshold Readable Thresholds : No Thresholds Settable Thresholds : No Thresholds Assertion Events : Assertions Enabled :

7.4查看传感器仓库sdr的配置信息

[root@cell83 ~]#ipmitool -I open sdr info SDR Version : 0x51 Record Count : 170

Free Space : 1836 bytes

Most recent Addition : 02/07/2106 06:28:15 Most recent Erase : 02/07/2106 06:28:15 SDR overflow : no SDR Repository Update Support : modal Delete SDR supported : no Partial Add SDR supported : no Reserve SDR repository supported : yes SDR Repository Alloc info supported : no

8.查看系统事件sel日志

[root@cell83 ~]#ipmitool -I open sel help

SEL Commands: info clear delete list elist get add time save readrawwriteraw interpret

8.1查看sel的状态信息

[root@cell83 ~]#ipmitool -I open sel info help SEL Information

Version : 1.5 (v1.5, v2 compliant) Entries : 740

Free Space : 4544 bytes Percent Used : 72%

Last Add Time : 08/27/2018 08:48:29 Last Del Time : 09/13/2014 11:16:12 Overflow : false

Supported Cmds : 'Reserve'

8.2查看sel的中的日志信息

ipmitool -I open sel list | elist

When this command is invoked without arguments, the entire contents of the System Event Log are displayed. If invoked as elist (extended list) it will also use the Sensor Data Record entries to display the sensor ID for the sensor that caused each event. Note this can take a long time over the system interface.

| first

Displays the first count (least-recent) entries in the SEL. If count is zero, all entries are displayed.

last

Displays the last count (most-recent) entries in the SEL. If count is zero, all entries are displayed. 查看前5条

[root@cell83 ~]#ipmitool -I open selelist first 5 1 | 09/13/2014 | 11:16:12 | Event Logging Disabled SEL | Log area reset/cleared | Asserted

2 | 10/15/2014 | 13:42:04 | Physical Security Intrusion | General Chassis intrusion () | Asserted

3 | 10/15/2014 | 13:42:09 | Physical Security Intrusion | General Chassis intrusion () | Deasserted

4 | 10/16/2014 | 12:08:20 | Physical Security Intrusion | General Chassis intrusion () | Asserted

5 | 10/16/2014 | 12:08:49 | Physical Security Intrusion | General Chassis intrusion () | Deasserted

查看后5条

[root@cell83 ~]#ipmitool -I open selelist last 5

2e0 | 08/02/2018 | 01:45:10 | Physical Security Intrusion | General Chassis intrusion () | Deasserted

2e1 | 08/04/2018 | 04:11:34 | OS Boot | Installation started | Asserted 2e2 | 08/04/2018 | 04:21:03 | OS Boot | Installation completed | Asserted 2e3 | 08/27/2018 | 08:48:24 | Physical Security Intrusion | General Chassis intrusion () | Asserted

2e4 | 08/27/2018 | 08:48:29 | Physical Security Intrusion | General Chassis intrusion () | Deasserted

本文来源:https://www.bwwdw.com/article/z3f6.html

Top