ipmitool Operations: Sensors, SEL, SOL and Power - 夜莺博客

ipmitool Operations: Sensors, SEL, SOL and Power

The BMC is the only part of a server that keeps working when the operating system is dead, which makes ipmitool the tool you reach for at exactly the moments when everything else has failed. It reads hardware sensors without an agent, shows the event log that survives a power loss, opens a serial console over the network, and can cycle power without asking the OS for permission. This guide covers the operations worth knowing on any vendor's hardware.

Connecting: local and remote

# On the host itself (kernel device)
ipmitool sensor list

# Against a remote BMC, in-band-independent
ipmitool -I lanplus -H 10.0.10.25 -U admin -P 'password' sensor list

# Store credentials in a file instead of the command line
echo 'password' > ~/.ipmi_pass && chmod 600 ~/.ipmi_pass
ipmitool -I lanplus -H 10.0.10.25 -U admin -f ~/.ipmi_pass sdr list

Use -I lanplus (IPMI 2.0 with RAKP-HMAC authentication, default cipher suite 17) for anything on a network. The older -I lan driver is IPMI 1.5 and should be considered legacy.

Reading sensors and the SDR

ipmitool sensor list
ipmitool sdr list
ipmitool sdr type Temperature
ipmitool sensor get "Baseboard 1.25V"
Baseboard Temp    | 30h | ok  |  7.1 | 28 degrees C
Processor1 Temp   | 98h | ok  |  3.1 | 57 degrees C
PS 2T Fan Fault   | 72h | ok  | 10.2 |

sensor list gives values with thresholds in one wide table — the fastest way to spot an inlet temperature creeping towards non-critical, or a power supply that has dropped into a redundant-loss state. sdr type Temperature filters the repository by sensor type, which is useful on dense hardware with a hundred sensors.

The event log that survives everything

ipmitool sel info
ipmitool sel list
ipmitool sel elist | tail -40
ipmitool sel time get
ipmitool sel time set "09/19/2026 03:20:00"

The SEL lives in BMC storage and is independent of the OS, so it still contains the record of a thermal trip, a power fault or a DIMM error that happened before the host died. Two habits: keep the SEL clock synced (otherwise correlating with application logs is guesswork) and clear it deliberately after a repair, not by reflex — cleared evidence cannot be reviewed later.

ipmitool sel clear          # irreversible

Chassis power and boot control

ipmitool chassis power status
ipmitool chassis power on
ipmitool chassis power off          # hard off
ipmitool chassis power cycle        # hard cycle
ipmitool chassis power soft         # ACPI soft shutdown request
ipmitool chassis restart_cause
ipmitool chassis bootdev pxe
ipmitool chassis bootdev disk options=persistent

Prefer power soft when the OS is healthy and power cycle only when it is not. chassis restart_cause answers a question logs frequently cannot: did the machine lose power, or was it reset by the BMC?

Serial-over-LAN: the console you keep for emergencies

# Check SOL configuration and payload access
ipmitool sol info 1
ipmitool sol payload status 1

# Open the console
ipmitool -I lanplus -H 10.0.10.25 -U admin -f ~/.ipmi_pass sol activate
# Escape sequence to disconnect: ~.  (or Ctrl-E then q, per your terminal)
ipmitool -I lanplus -H 10.0.10.25 -U admin -f ~/.ipmi_pass sol deactivate

SOL only shows output if the target OS is configured to send its console to the serial device (Linux: console=ttyS1,115200n8 on the kernel command line). That means enabling it must be a build-time decision, not an incident-time one — if you only test SOL when the server is down, you will discover the missing console redirection at the worst moment.

Firmware, users and inventory

ipmitool mc info                     # BMC firmware version
ipmitool mc guid
ipmitool sdr list fru | head
ipmitool fru print 1
ipmitool user list 1                 # channel 1 users
ipmitool user set password 3
ipmitool lan print 1                 # network configuration of the BMC
ipmitool mc reset cold               # last resort: BMC reboot (kills remote console)

Run mc info and fru print during commissioning and store the output: firmware version, board serial and MAC addresses from the FRU are what vendors ask for when a case is opened.

Operations checklist

  1. Store BMC credentials in a file with restrictive permissions, not in shell history.
  2. Poll sensor list and sel elist from your monitoring system — the BMC normally has no alerting of its own unless you configure PEF.
  3. Keep the SEL clock synchronised; note that clearing the SEL before setting the time is the documented order on many platforms.
  4. Verify SOL works during commissioning, not during an outage.
  5. Never run mc reset cold or chassis power cycle without confirming nobody is mid-migration.

Agents, SSH and monitoring all depend on a running OS. The BMC does not. That is why these dozen commands belong in every ops runbook.

Related Reading on This Site

原文链接:https://man.archlinux.org/man/extra/ipmitool/ipmitool.1.en (Arch Linux manual - ipmitool(1))