Blame README

Packit d14fb6
Packit d14fb6
                              ipmitool
Packit d14fb6
                            Duncan Laurie
Packit d14fb6
                ipmitool-devel@lists.sourceforge.net
Packit d14fb6
Packit d14fb6
Overview
Packit d14fb6
========
Packit d14fb6
ipmitool is a utility for managing and configuring devices that support
Packit d14fb6
the Intelligent Platform Management Interface.  IPMI is an open standard
Packit d14fb6
for monitoring, logging, recovery, inventory, and control of hardware
Packit d14fb6
that is implemented independent of the main CPU, BIOS, and OS.  The
Packit d14fb6
service processor (or Baseboard Management Controller, BMC) is the brain
Packit d14fb6
behind platform management and its primary purpose is to handle the
Packit d14fb6
autonomous sensor monitoring and event logging features.
Packit d14fb6
Packit d14fb6
The ipmitool program provides a simple command-line interface to this BMC.
Packit d14fb6
It features the ability to read the sensor data repository (SDR) and print
Packit d14fb6
sensor values, display the contents of the System Event Log (SEL), print
Packit d14fb6
Field Replaceable Unit (FRU) inventory information, read and set LAN
Packit d14fb6
configuration parameters, and perform remote chassis power control.
Packit d14fb6
Packit d14fb6
Packit d14fb6
Background
Packit d14fb6
==========
Packit d14fb6
I originally wrote ipmitool while between projects and employeed at Sun
Packit d14fb6
Microsystems.  Sun had just embarked on a new line of general-purpose x86
Packit d14fb6
servers that included an OEM Intel board with an IPMIv1.5 BMC on board.
Packit d14fb6
It started with an idea that remote chassis power control would be a handy
Packit d14fb6
feature for my systems in the lab and from there it grew into a multi-
Packit d14fb6
purpose tool that lots of people found useful.  I decided to release it
Packit d14fb6
under a BSD license and give others the chance to make use of it.
Packit d14fb6
Packit d14fb6
ipmitool was not written to provide large-scale (aka Enterprise) management
Packit d14fb6
application functionality.  The functionality that ipmitool proivides is
Packit d14fb6
easily accomplished by sending simple IPMI request messages and parsing
Packit d14fb6
the returned response.  It is intended to be used by system administrators
Packit d14fb6
who like the simplicity and scriptability of command-line utilities, as
Packit d14fb6
well as those debugging or developing their own BMC implementations.
Packit d14fb6
Packit d14fb6
Packit d14fb6
Requirements
Packit d14fb6
============
Packit d14fb6
Obviously the largest requirement is hardware with a service processor
Packit d14fb6
that supports the IPMI specification.  Many x86-based servers are now
Packit d14fb6
comming with IPMI support, check with your preferred hardware vendor
Packit d14fb6
about available prodcuts.
Packit d14fb6
Packit d14fb6
Once you are certain you have the required hardware, you then need to
Packit d14fb6
decide how you want to access the BMC.  The most common case involve
Packit d14fb6
access through the System Interface or over the LAN.  (or serial, but
Packit d14fb6
currently ipmitool does not support the serial interface)
Packit d14fb6
Packit d14fb6
Packit d14fb6
System Interface
Packit d14fb6
----------------
Packit d14fb6
There are multiple types of system interfaces, but they are all similar
Packit d14fb6
enough to allow a single well-designed driver to support them all.  
Packit d14fb6
Different types of system interfaces include Keyboard Controller Style
Packit d14fb6
(KCS), Block Transfer (BT), System Management Interface Chip (SMIC) and
Packit d14fb6
SMBus.  Different hardware vendors will have different preference and
Packit d14fb6
implementations.
Packit d14fb6
Packit d14fb6
On Linux the OpenIPMI kernel driver should support all of these system
Packit d14fb6
interfaces and it should be a simple matter of loading the right
Packit d14fb6
kernel modules and setting up the device node to use it.  The driver
Packit d14fb6
module names vary slightly in different kernel versions, but for all
Packit d14fb6
releases you need these two modules:
Packit d14fb6
Packit d14fb6
  ipmi_msghandler: incoming and outgoing message handler
Packit d14fb6
  ipmi_devintf: character device interface to IPMI driver
Packit d14fb6
Packit d14fb6
For 2.4.x and early 2.6.x kernels you need to choose a module based on
Packit d14fb6
the type of system interface your hardware supports.  For example:
Packit d14fb6
Packit d14fb6
  ipmi_kcs_drv: Keyboard Controller Style driver
Packit d14fb6
Packit d14fb6
More recent 2.6.x kernels have combined these into a single module:
Packit d14fb6
Packit d14fb6
  ipmi_si: a universal IPMI system interface driver
Packit d14fb6
Packit d14fb6
See the documentation that comes with your distribution and/or kernel
Packit d14fb6
for more information on what kernel modules are required.  Once the
Packit d14fb6
required modules are loaded and the driver has found a suitable system
Packit d14fb6
interface to the BMC then you need to ensure the device node at
Packit d14fb6
/dev/ipmi0 is pointing at the correct major number.
Packit d14fb6
Packit d14fb6
This is because OpenIPMI is given a dynamically assigned major number
Packit d14fb6
when it is loaded, but depending on what other modules are present
Packit d14fb6
this number may be anywhere from 254 on down.  The easiest way to tell
Packit d14fb6
is to check the output of /proc/devices and see what major number the
Packit d14fb6
"ipmidev" device is assigned to.
Packit d14fb6
Packit d14fb6
There is a sample script included with ipmitool called ipmi.init that
Packit d14fb6
can be used to automate this process at bootup.
Packit d14fb6
Packit d14fb6
Packit d14fb6
LAN Interface
Packit d14fb6
-------------
Packit d14fb6
This is often referred to as "IPMI-over-LAN" and defines how IPMI messages
Packit d14fb6
can be sent to and from the BMC encapsulated in Remote Management Control
Packit d14fb6
Protocol (RMCP) packets which are then transferred as UDP datagrams.
Packit d14fb6
Packit d14fb6
IPMI-over-LAN is only supported with version 1.5 and higher of the IPMI
Packit d14fb6
specification.  The RMCP packet format is defined by the Alert Standard
Packit d14fb6
Forum, and it has been followed up with the RMCP+ protocol that adds
Packit d14fb6
encryption and payload support.  The IPMIv2 specification was updated
Packit d14fb6
accordingly to to support the RMCP+ protocol and brings with it enhanced
Packit d14fb6
security with encryption as well as support for Serial over LAN.
Packit d14fb6
Packit d14fb6
There are different types of LAN interfaces as well.  Some systems have
Packit d14fb6
shared management networks where the NIC will intercept UDP packets to
Packit d14fb6
port 623 and redirect them to the BMC over SMBUS.  This type of LAN
Packit d14fb6
interface requires that the BMC be configured with the same settings that
Packit d14fb6
the system uses.  It also suffers from an increased security risk just by
Packit d14fb6
the nature of sharing that interface with normal traffic.
Packit d14fb6
Packit d14fb6
I have also seen bugs in some implementations that have rendered the
Packit d14fb6
IPMI-over-LAN feature "dangerous" to enable in some situations.  (in
Packit d14fb6
particular there can be an issue with RPC because it will sometimes choose
Packit d14fb6
to use port 623 and you will lose response packets...)
Packit d14fb6
Packit d14fb6
There is a sample shell script included with ipmitool called bmclanconf
Packit d14fb6
that can be used to simplify the LAN settings configuration process using
Packit d14fb6
the System Interface to configure the settings.  In some cases the
Packit d14fb6
hardware will come with a utility (often a DOS bootable CD) for configuring
Packit d14fb6
enabling the LAN interface as well.
Packit d14fb6
Packit d14fb6
In order to support the IPMIv2.0 interface you must have an OpenSSL library
Packit d14fb6
with the required encrytion functions.  Recent distributions should have
Packit d14fb6
no problems.  The IPMIv1.5 interface will attempt to use OpenSSL for MD5
Packit d14fb6
hash function at compile time but if that is not found it will use an
Packit d14fb6
internal library.
Packit d14fb6
Packit d14fb6
IPMB Dual Bridging in  IPMITOOL
Packit d14fb6
-------------------------------
Packit d14fb6
Packit d14fb6
IPMI offers a standard messaging interface.
Packit d14fb6
Packit d14fb6
The following concepts are related to this messaging interface:
Packit d14fb6
Packit d14fb6
Channel type     : Communication channel type (SMS/KCS, IPMB, LAN) 
Packit d14fb6
Channel number   : Channel descriptor
Packit d14fb6
Requester        : Address of the requester
Packit d14fb6
Responder        : Address of the responder
Packit d14fb6
NetFN            : The logical function  for the request/response.
Packit d14fb6
Command          : The command number 
Packit d14fb6
Sequence         : An ID identifiying the request/response pair
Packit d14fb6
Message tracking : The ability to match request/response pair.
Packit d14fb6
Packit d14fb6
When a communication is issued through any of the channels, an application 
Packit d14fb6
formats a request and expect a response. 
Packit d14fb6
Packit d14fb6
Direct Command
Packit d14fb6
--------------
Packit d14fb6
The simplest form of communication is a "direct command" using SMS/KCS
Packit d14fb6
Packit d14fb6
Example:
Packit d14fb6
 ipmitool raw 6 4
Packit d14fb6
  55 00
Packit d14fb6
Packit d14fb6
This send raw command 4 (selftest) from netfn 6(application) to KCS, the driver 
Packit d14fb6
takes care of 'message tracking' and provides the answer.
Packit d14fb6
Packit d14fb6
Hopefully, the application also includes a "human readable" instance of the API:
Packit d14fb6
 ipmitool mc selftest
Packit d14fb6
 Selftest: passed
Packit d14fb6
Packit d14fb6
Bridged Command
Packit d14fb6
---------------
Packit d14fb6
One slightly more complicated communication mode is the so-called 
Packit d14fb6
"bridged command" using IPMB. 
Packit d14fb6
Packit d14fb6
Example:
Packit d14fb6
 ipmitool -m 0x94 -t 0x9a raw 6 4
Packit d14fb6
 55 00
Packit d14fb6
 
Packit d14fb6
 or
Packit d14fb6
 
Packit d14fb6
 ipmitool -m 0x94 -t 0x9a mc selftest
Packit d14fb6
 Selftest: passed
Packit d14fb6
 
Packit d14fb6
Packit d14fb6
This still sends the same command  4 (selftest) from netfn 6(application) to 
Packit d14fb6
the target. However, to do so, the command is encapsulated (by the driver) and
Packit d14fb6
sent using the command 0x34 (send message) from netfn 6(application) to KCS. 
Packit d14fb6
Then KCS is polled by the driver until a message has been received, then the
Packit d14fb6
driver uses command 0x33 (get message). The driver also tracks the message 
Packit d14fb6
and makes sure the response matches the request. Then it decapsultates the
Packit d14fb6
message and gives the response back to the application.
Packit d14fb6
Packit d14fb6
Dual Bridged Command
Packit d14fb6
--------------------
Packit d14fb6
Things get a little more ugly when the application needs to reach a management
Packit d14fb6
controller sitting on an interface (or channel) not directly connected to the 
Packit d14fb6
BMC/IPMC. In the case the application must encapsulate its message itself and 
Packit d14fb6
request the IPMC to deal with message tracking itself.
Packit d14fb6
Packit d14fb6
Its been working well with IPMITOOL on the LAN interface with:
Packit d14fb6
 ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a  -m 0x20 -t 0x7a -b 7  
Packit d14fb6
    mc selftest
Packit d14fb6
Packit d14fb6
However, trying to dual bridge commands locally with :
Packit d14fb6
 ipmitool -B 0 -T 0x9a -m 0x94 -t 0x7a -b 7 mc selftest didn't work 
Packit d14fb6
 (it returned the same data as  ipmitool -m 0x20 -t 0x7a -b 7 mc selftest )
Packit d14fb6
 
Packit d14fb6
The reason was that the "openipmi" interface pluging didn't 
Packit d14fb6
encapsulate/decapsulate the message and didn't even detect the intent
Packit d14fb6
to double bridge the request.
Packit d14fb6
Packit d14fb6
 ./src/ipmitool -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7 mc selftest
Packit d14fb6
 
Packit d14fb6
-B    0  : transit channel for first bridge level (channel 0: IPMB-0) 
Packit d14fb6
-T 0x8a  : transit destination address (remote IPMC address)
Packit d14fb6
-m 0x94  : source address (local IPMC address on IPMB-0)
Packit d14fb6
-t 0x7a  : remote target (AMC IPMB-L address)
Packit d14fb6
-b    7  : remote channel (channel 7: IPMB-L)
Packit d14fb6
Packit d14fb6
The transit source address (remote IPMC address on remote channel) is 
Packit d14fb6
automatically assigned by the remote IPMC.
Packit d14fb6
Packit d14fb6
Payload Size Limit
Packit d14fb6
------------------
Packit d14fb6
Because some commands return a lot of data (fru read/get sdr) and because 2 
Packit d14fb6
levels of encapsulation are used, some command will fail.
Packit d14fb6
Packit d14fb6
For instance this works.
Packit d14fb6
Packit d14fb6
ipmitool -H <ip> -U <user> -P <password>  -B 0 -T 0x8a  -m 0x94 -t 0x7a -b 7 
Packit d14fb6
    mc selftest
Packit d14fb6
Packit d14fb6
but this does not:
Packit d14fb6
    
Packit d14fb6
ipmitool -H <ip> -U <user> -P <password>  -B 0 -T 0x8a  -m 0x94 -t 0x7a -b 7 
Packit d14fb6
    fru print.
Packit d14fb6
Packit d14fb6
Packit d14fb6
Packit d14fb6
Usage
Packit d14fb6
=====
Packit d14fb6
All invocations of ipmitool require specifying an interface to use, unless
Packit d14fb6
you want to use the default interface as set at compile time.  Each call
Packit d14fb6
must also specify a command to run.  You can see the list of supported
Packit d14fb6
interfaces and which is default as well as a list of top level commands in
Packit d14fb6
the usage output available with the -h option:
Packit d14fb6
Packit d14fb6
usage: ipmitool [options...] <command>
Packit d14fb6
Packit d14fb6
   -h            This help
Packit d14fb6
   -V            Show version information
Packit d14fb6
   -v            Verbose (can use multiple times)
Packit d14fb6
   -c            Display output in comma separated format
Packit d14fb6
   -I intf       Interface to use
Packit d14fb6
   -H hostname   Remote host name for LAN interface
Packit d14fb6
   -p port       Remote RMCP port [default=623]
Packit d14fb6
   -L level      Remote session privilege level [default=USER]
Packit d14fb6
   -A authtype   Force use of authtype NONE, PASSWORD, MD2 or MD5
Packit d14fb6
   -U username   Remote session username
Packit d14fb6
   -P password   Remote session password
Packit d14fb6
   -f file       Read remote session password from file
Packit d14fb6
   -a            Prompt for remote password
Packit d14fb6
   -E            Read password from IPMI_PASSWORD environment variable
Packit d14fb6
   -m address    Set local IPMB address
Packit d14fb6
   -t address    Bridge request to remote target address
Packit d14fb6
Packit d14fb6
Interfaces:
Packit d14fb6
    open         Linux OpenIPMI Interface [default]
Packit d14fb6
    imb          Intel IMB Interface
Packit d14fb6
    lan          IPMI v1.5 LAN Interface
Packit d14fb6
    lanplus      IPMI v2.0 RMCP+ LAN Interface
Packit d14fb6
Packit d14fb6
Commands:
Packit d14fb6
    raw          Send a RAW IPMI request and print response
Packit d14fb6
    lan          Configure LAN Channels
Packit d14fb6
    chassis      Get chassis status and set power state
Packit d14fb6
    event        Send pre-defined events to BMC
Packit d14fb6
    bmc          Print BMC status and configure global enables
Packit d14fb6
    sdr          Print Sensor Data Repository entries and readings
Packit d14fb6
    sensor       Print detailed sensor information
Packit d14fb6
    fru          Print built-in FRU and scan SDR for FRU locators
Packit d14fb6
    sel          Print System Evelnt Log
Packit d14fb6
    sol          Configure IPMIv2.0 Serial-over-LAN
Packit d14fb6
    user         Configure BMC users
Packit d14fb6
    channel      Configure BMC channels
Packit d14fb6
    session      Print session information
Packit d14fb6
    shell        Launch interactive IPMI shell
Packit d14fb6
    exec         Run list of commands from file
Packit d14fb6
    set          Set runtime variable for shell and exec
Packit d14fb6
Packit d14fb6
Packit d14fb6
Commands
Packit d14fb6
========
Packit d14fb6
More help on the supported commands can be found by running them with the
Packit d14fb6
help argument, for example "chassis help".  There are a few commands with
Packit d14fb6
special meaning:
Packit d14fb6
Packit d14fb6
> shell:  This command will launch an shell interface to the ipmitool
Packit d14fb6
  command set.  You can use this for interactively entering commands to
Packit d14fb6
  monitor system status.  An example session:
Packit d14fb6
Packit d14fb6
# ipmitool -I open shell
Packit d14fb6
ipmitool> chassis status
Packit d14fb6
System Power         : off
Packit d14fb6
Power Overload       : false
Packit d14fb6
Power Interlock      : inactive
Packit d14fb6
Main Power Fault     : false
Packit d14fb6
Power Control Fault  : false
Packit d14fb6
Power Restore Policy : always-off
Packit d14fb6
Last Power Event     : command
Packit d14fb6
Chassis Intrusion    : active
Packit d14fb6
Front-Panel Lockout  : inactive
Packit d14fb6
Drive Fault          : false
Packit d14fb6
Cooling/Fan Fault    : false
Packit d14fb6
ipmitool> user list 7
Packit d14fb6
ID  Name             Callin  Link Auth  IPMI Msg   Channel Priv Limit
Packit d14fb6
1                    true    false      true       ADMINISTRATOR
Packit d14fb6
ipmitool> exit
Packit d14fb6
Packit d14fb6
> exec:  This command will read a text file and execute ipmitool commands
Packit d14fb6
  in sequence.  It can be used for scriptable commands:
Packit d14fb6
Packit d14fb6
# cat lansetup.scr
Packit d14fb6
lan set 7 ipsrc static
Packit d14fb6
lan set 7 ipaddr 10.1.1.10
Packit d14fb6
lan set 7 netmask 255.255.255.0
Packit d14fb6
lan set 7 defgw ipaddr 10.1.1.254
Packit d14fb6
# ipmitool -I open exec lansetup.scr
Packit d14fb6
Setting LAN IP Address to 10.1.1.10
Packit d14fb6
Setting Lan Subnet Mask to 255.255.255.0
Packit d14fb6
Setting Lan Default Gateway IP to 10.1.1.254
Packit d14fb6
Packit d14fb6
> set:  This command can be used by the shell and exec modes to configure
Packit d14fb6
  various session parameters:
Packit d14fb6
Packit d14fb6
  hostname <host>        Session hostname
Packit d14fb6
  username <user>        Session username
Packit d14fb6
  password <pass>        Session password
Packit d14fb6
  privlvl <level>        Session privilege level force
Packit d14fb6
  authtype <type>        Authentication type force
Packit d14fb6
  localaddr <addr>       Local IPMB address
Packit d14fb6
  targetaddr <addr>      Remote target IPMB address
Packit d14fb6
  port <port>            Remote RMCP port
Packit d14fb6
  csv [level]            enable output in comma separated format
Packit d14fb6
  verbose [level]        Verbose level
Packit d14fb6
Packit d14fb6
# cat getstatus.scr
Packit d14fb6
set hostname sf-v20z-1
Packit d14fb6
set password admin
Packit d14fb6
chassis status
Packit d14fb6
# ipmitool -I lan exec getstatus.scr
Packit d14fb6
Set session hostname to lx50
Packit d14fb6
Set session password
Packit d14fb6
System Power         : off
Packit d14fb6
Power Overload       : false
Packit d14fb6
Power Interlock      : inactive
Packit d14fb6
Main Power Fault     : false
Packit d14fb6
Power Control Fault  : false
Packit d14fb6
Power Restore Policy : always-off
Packit d14fb6
Last Power Event     : command
Packit d14fb6
Chassis Intrusion    : active
Packit d14fb6
Front-Panel Lockout  : inactive
Packit d14fb6
Drive Fault          : false
Packit d14fb6
Cooling/Fan Fault    : false
Packit d14fb6
Packit d14fb6
Packit d14fb6
ipmievd
Packit d14fb6
=======
Packit d14fb6
Included with ipmitool is another utility called ipmievd that is a daemon
Packit d14fb6
which will listen for events from the BMC that are being sent to the SEL
Packit d14fb6
and also log those messages to syslog.  By default when run (as root) with
Packit d14fb6
no arguments it will daemonize and poll on the OpenIPMI device waiting for
Packit d14fb6
an event notification.  Upon receipt of an event it will log it to syslog
Packit d14fb6
with the LOG_LOCAL4 facility.  You can test ipmievd by sending test events
Packit d14fb6
over the LAN interface with ipmitool:
Packit d14fb6
Packit d14fb6
remote# ipmievd
Packit d14fb6
Packit d14fb6
local$ ipmitool -I lan -H lx50 -P admin event help
Packit d14fb6
usage: event <num>
Packit d14fb6
   1 : Temperature - Upper Critical - Going High
Packit d14fb6
   2 : Voltage Threshold - Lower Critical - Going Low
Packit d14fb6
   3 : Memory - Correctable ECC
Packit d14fb6
local$ ipmitool -I lan -H lx50 -P admin event 1
Packit d14fb6
Sending Temperature - Upper Critical - Going High event to BMC
Packit d14fb6
local$ ipmitool -I lan -H lx50 -P admin event 2
Packit d14fb6
Sending Voltage Threshold - Lower Critical - Going Low event to BMC
Packit d14fb6
local$ ipmitool -I lan -H lx50 -P admin event 3
Packit d14fb6
Sending Memory - Correctable ECC event to BMC
Packit d14fb6
Packit d14fb6
remote# tail /var/log/messages   (timestamps removed)
Packit d14fb6
ipmievd: Waiting for events...
Packit d14fb6
ipmievd: Temperature Sensor 30 - Upper Critical - going high
Packit d14fb6
ipmievd: Voltage Sensor 60 - Lower Critical - going low
Packit d14fb6
ipmievd: Memory Sensor 01 - Correctable ECC
Packit d14fb6
Packit d14fb6
Packit d14fb6
Resources
Packit d14fb6
=========
Packit d14fb6
IPMItool homepage
Packit d14fb6
http://ipmitool.sourceforge.net
Packit d14fb6
Packit d14fb6
IPMItool manpage
Packit d14fb6
http://ipmitool.sourceforge.net/manpage.html
Packit d14fb6
Packit d14fb6
IPMItool overview paper from Linux.conf.au 2004
Packit d14fb6
http://ipmitool.sourceforge.net/lca2004_ipmitool.pdf
Packit d14fb6
Packit d14fb6
Intelligent Platform Management Interface specification
Packit d14fb6
http://www.intel.com/design/servers/ipmi/spec.htm
Packit d14fb6
Packit d14fb6
OpenIPMI project: Linux IPMI kernel driver and userland library
Packit d14fb6
http://openipmi.sourceforge.net
Packit d14fb6
Packit d14fb6
IPMItool commit archive
Packit d14fb6
https://lists.sourceforge.net/lists/listinfo/ipmitool-cvs