Linux/ipmitool

ipmitool
ipmitool - utility for controlling IPMI-enabled devices
 * http://sourceforge.net/projects/ipmitool/

Configuring IPMI under Linux using ipmitool - Thomas-Krenn-Wiki - https://www.thomas-krenn.com/en/wiki/Configuring_IPMI_under_Linux_using_ipmitool

Installation
Easy way: yum install ipmitool apt-get install ipmitool

yum install freeipmi apt-get install freeipmi-tools
 * 1) for ipmipower tool:

Harder way (source code): (http://sourceforge.net/projects/ipmitool/) yum install gcc make compat-glibc-headers wget http://downloads.sourceforge.net/project/ipmitool/ipmitool/1.8.14/ipmitool-1.8.14.tar.bz2 tar -jvxf ipmitool-1.8.14.tar.bz2 ipmitool-1.8.14 ./configure make clean make && make install

Load kernel module
modprobe ipmi_devintf   # CentOS 6.5 module name

Should create: /dev/ipmi0

Usage
References:
 * Configuring IPMI under Linux using ipmitool - Thomas-Krenn-Wiki - https://www.thomas-krenn.com/en/wiki/Configuring_IPMI_under_Linux_using_ipmitool

Get Power Status
$ ipmipower -h 10.10.10.10 -u ADMIN -p ADMIN -s

10.10.10.10: on

10.10.10.10: off

Get BIOS Status
For Supermicro

ipmitool -H 10.10.10.10 -U ADMIN -P ADMIN raw 0x30 0x2a

aa / fe - ok finished bios (depending on model) 72 - off 91 - Stuck at "DXE--BIOS PCI Bus Enumeration..." 94 - Stuck at "?" ...many other codes... - system in various states of bios loading

Reboot System
ipmitool -H 10.10.10.10 -U ADMIN -P ADMIN power on

ipmitool -H 10.10.10.10 -U ADMIN -P ADMIN power off

ipmitool -H 10.10.10.10 -U ADMIN -P ADMIN power cycle

ipmipower -h 10.10.10.10 -u ADMIN -p ADMIN --on # -n

ipmipower -h 10.10.10.10 -u ADMIN -p ADMIN --off # -f

ipmipower -h 10.10.10.10 -u ADMIN -p ADMIN --cycle # -c

ipmipower -h 10.10.10.10 -u ADMIN -p ADMIN -r # --reset

ipmipower -h i-mynode -u ADMIN -p ADMIN -r --on-if-off

Note: ipmipower is part of the freeipmi-tools package

ipmi network address
ipmitool lan print ipmitool lan print | grep "IP Address"

Change to Static Address: ipmitool lan set 1 ipsrc static ipmitool lan set 1 ipaddr 10.10.10.10 ipmitool lan set 1 netmask 255.255.255.0 ipmitool lan set 1 defgw ipaddr 10.10.10.1

Change to Dynamic Address: ipmitool lan set 1 ipsrc dhcp ipmitool mc reset cold
 * 1) reset firmware:

Ref:

Sensor Data
sdr command - Print Sensor Data Repository entries and readings P0 Temp         | 36 degrees C      | ok P1 Temp          | 36 degrees C      | ok P0 TjMax         | 86 degrees C      | ok P1 Tjmax         | 86 degrees C      | ok ...
 * 1) ipmitool sdr

sensor command - Print detailed sensor information P0 Temp         | 37.000     | degrees C  | ok    | na        | na        | na        | na        | 84.000    | na P1 Temp          | 36.000     | degrees C  | ok    | na        | na        | na        | na        | 84.000    | na P0 TjMax         | 86.000     | degrees C  | ok    | na        | na        | na        | na        | na        | na P1 Tjmax         | 86.000     | degrees C  | ok    | na        | na        | na        | na        | na        | na ...
 * 1) ipmitool sensor

IPMI Reboot
ipmitool mc reset cold ipmitool mc reset warm

Control Remote BMC
ipmitool -I lanplus -H [BMC_ADDRESS] -U USERID -P [PASSWORD] sensor

Note, my configuration was incorrect and this would timeout: Error: Unable to establish IPMI v2 / RMCP+ session Get Device ID command failed Unable to open SDR for reading
 * 1) ipmitool -I lanplus -H i-myserver -U USERID -P mypassword sensor

i2c access
If you know the bus and address of a target i2c device: (server/device specific)

usage: i2c [bus=public|# [chan=#] [write data]

Example: (temperature sensor, there is a conversion required to get to C) 38 00111000
 * 1) ipmitool i2c bus=1 0x3e 1 1

User List
ipmitool user list [CHANNEL_NUMBER]

ID Name             Callin  Link Auth  IPMI Msg   Channel Priv Limit 1                   true    false      true       USER 2  USERID           true    false      true       ADMINISTRATOR 3  root             true    false      false      ADMINISTRATOR
 * 1) ipmitool user list 1

Password
ipmitool user list
 * 1) ipmitool user set password  [PASSWORD]

Add admin user: ipmitool user list ipmitool user set name 3 ADMIN ipmitool user set password 3 # enter 'ADMIN' ipmitool channel setaccess 1 3 link=on ipmi=on callin=on privilege=4 ipmitool user enable 3

Password is too long (> 20 bytes)

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    : Chassis Intrusion   : inactive Front-Panel Lockout : inactive Drive Fault         : false Cooling/Fan Fault   : false Sleep Button Disable : not allowed Diag Button Disable : not allowed Reset Button Disable : allowed Power Button Disable : allowed Sleep Button Disabled: false Diag Button Disabled : false Reset Button Disabled: false Power Button Disabled: false
 * 1) ipmitool chassis status

Chassis Power
chassis power Commands: status, on, off, cycle, reset, diag, soft
 * 1) ipmitool chassis power

Chassis Power is on
 * 1) ipmitool chassis power status


 * 1) ipmitool chassis reset

FRU
Field Replaceable Units (FRU) information:

fru command - Print built-in FRU and scan SDR for FRU locators FRU Device Description : Builtin FRU Device (ID 0) Chassis Type                   : Rack Mount Chassis Chassis Serial                 : XXXXXXXXXXXXX Chassis Extra                  : XXXXXXXXXXXXX Chassis Extra                  : XXXXXXXXXXXXX Board Mfg Date       : Wed May 28 11:53:00 2014 Board Mfg            : XXX Board Product        : XXX Board Serial         : XXXXXXXXXXXXX Board Part Number    : XXXXXXXXXXXXX Board Extra          : XXX Product Manufacturer : XXX Product Name         : XXX Product Part Number  : XXXXXXXXXXXXX Product Asset Tag    : XXX Product Extra        : XXX Product Extra        : PVT Product Extra        : 2014-05-28 15:53:46
 * 1) ipmitool fru

XXX - removed info as this sample is from a prototype server, not released

shell
Interactive shell (same as running commands from command line) ipmitool> help ...
 * 1) ipmitool shell

Commands
No command provided! 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
 * 1) ipmitool

Get IPMI Address from ESXi Shell
~ # enum_instances OMC_IPMIIPProtocolEndpoint root/cimv2 | grep IPv4Address IPv4Address = 10.10.10.100

Ref:

Issues
Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory
 * 1) ipmitool lan print

Driver not loaded, or system does not support. If driver was just not loaded, try this (sometimes happens after initial install): modprobe ipmi_devintf