README 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. ipmitool
  2. Duncan Laurie
  3. ipmitool-devel@lists.sourceforge.net
  4. Overview
  5. ========
  6. ipmitool is a utility for managing and configuring devices that support
  7. the Intelligent Platform Management Interface. IPMI is an open standard
  8. for monitoring, logging, recovery, inventory, and control of hardware
  9. that is implemented independent of the main CPU, BIOS, and OS. The
  10. service processor (or Baseboard Management Controller, BMC) is the brain
  11. behind platform management and its primary purpose is to handle the
  12. autonomous sensor monitoring and event logging features.
  13. The ipmitool program provides a simple command-line interface to this BMC.
  14. It features the ability to read the sensor data repository (SDR) and print
  15. sensor values, display the contents of the System Event Log (SEL), print
  16. Field Replaceable Unit (FRU) inventory information, read and set LAN
  17. configuration parameters, and perform remote chassis power control.
  18. Background
  19. ==========
  20. I originally wrote ipmitool while between projects and employeed at Sun
  21. Microsystems. Sun had just embarked on a new line of general-purpose x86
  22. servers that included an OEM Intel board with an IPMIv1.5 BMC on board.
  23. It started with an idea that remote chassis power control would be a handy
  24. feature for my systems in the lab and from there it grew into a multi-
  25. purpose tool that lots of people found useful. I decided to release it
  26. under a BSD license and give others the chance to make use of it.
  27. ipmitool was not written to provide large-scale (aka Enterprise) management
  28. application functionality. The functionality that ipmitool proivides is
  29. easily accomplished by sending simple IPMI request messages and parsing
  30. the returned response. It is intended to be used by system administrators
  31. who like the simplicity and scriptability of command-line utilities, as
  32. well as those debugging or developing their own BMC implementations.
  33. Requirements
  34. ============
  35. Obviously the largest requirement is hardware with a service processor
  36. that supports the IPMI specification. Many x86-based servers are now
  37. comming with IPMI support, check with your preferred hardware vendor
  38. about available prodcuts.
  39. Once you are certain you have the required hardware, you then need to
  40. decide how you want to access the BMC. The most common case involve
  41. access through the System Interface or over the LAN. (or serial, but
  42. currently ipmitool does not support the serial interface)
  43. System Interface
  44. ----------------
  45. There are multiple types of system interfaces, but they are all similar
  46. enough to allow a single well-designed driver to support them all.
  47. Different types of system interfaces include Keyboard Controller Style
  48. (KCS), Block Transfer (BT), System Management Interface Chip (SMIC) and
  49. SMBus. Different hardware vendors will have different preference and
  50. implementations.
  51. On Linux the OpenIPMI kernel driver should support all of these system
  52. interfaces and it should be a simple matter of loading the right
  53. kernel modules and setting up the device node to use it. The driver
  54. module names vary slightly in different kernel versions, but for all
  55. releases you need these two modules:
  56. ipmi_msghandler: incoming and outgoing message handler
  57. ipmi_devintf: character device interface to IPMI driver
  58. For 2.4.x and early 2.6.x kernels you need to choose a module based on
  59. the type of system interface your hardware supports. For example:
  60. ipmi_kcs_drv: Keyboard Controller Style driver
  61. More recent 2.6.x kernels have combined these into a single module:
  62. ipmi_si: a universal IPMI system interface driver
  63. See the documentation that comes with your distribution and/or kernel
  64. for more information on what kernel modules are required. Once the
  65. required modules are loaded and the driver has found a suitable system
  66. interface to the BMC then you need to ensure the device node at
  67. /dev/ipmi0 is pointing at the correct major number.
  68. This is because OpenIPMI is given a dynamically assigned major number
  69. when it is loaded, but depending on what other modules are present
  70. this number may be anywhere from 254 on down. The easiest way to tell
  71. is to check the output of /proc/devices and see what major number the
  72. "ipmidev" device is assigned to.
  73. There is a sample script included with ipmitool called ipmi.init that
  74. can be used to automate this process at bootup.
  75. LAN Interface
  76. -------------
  77. This is often referred to as "IPMI-over-LAN" and defines how IPMI messages
  78. can be sent to and from the BMC encapsulated in Remote Management Control
  79. Protocol (RMCP) packets which are then transferred as UDP datagrams.
  80. IPMI-over-LAN is only supported with version 1.5 and higher of the IPMI
  81. specification. The RMCP packet format is defined by the Alert Standard
  82. Forum, and it has been followed up with the RMCP+ protocol that adds
  83. encryption and payload support. The IPMIv2 specification was updated
  84. accordingly to to support the RMCP+ protocol and brings with it enhanced
  85. security with encryption as well as support for Serial over LAN.
  86. There are different types of LAN interfaces as well. Some systems have
  87. shared management networks where the NIC will intercept UDP packets to
  88. port 623 and redirect them to the BMC over SMBUS. This type of LAN
  89. interface requires that the BMC be configured with the same settings that
  90. the system uses. It also suffers from an increased security risk just by
  91. the nature of sharing that interface with normal traffic.
  92. I have also seen bugs in some implementations that have rendered the
  93. IPMI-over-LAN feature "dangerous" to enable in some situations. (in
  94. particular there can be an issue with RPC because it will sometimes choose
  95. to use port 623 and you will lose response packets...)
  96. There is a sample shell script included with ipmitool called bmclanconf
  97. that can be used to simplify the LAN settings configuration process using
  98. the System Interface to configure the settings. In some cases the
  99. hardware will come with a utility (often a DOS bootable CD) for configuring
  100. enabling the LAN interface as well.
  101. In order to support the IPMIv2.0 interface you must have an OpenSSL library
  102. with the required encrytion functions. Recent distributions should have
  103. no problems. The IPMIv1.5 interface will attempt to use OpenSSL for MD5
  104. hash function at compile time but if that is not found it will use an
  105. internal library.
  106. IPMB Dual Bridging in IPMITOOL
  107. -------------------------------
  108. IPMI offers a standard messaging interface.
  109. The following concepts are related to this messaging interface:
  110. Channel type : Communication channel type (SMS/KCS, IPMB, LAN)
  111. Channel number : Channel descriptor
  112. Requester : Address of the requester
  113. Responder : Address of the responder
  114. NetFN : The logical function for the request/response.
  115. Command : The command number
  116. Sequence : An ID identifiying the request/response pair
  117. Message tracking : The ability to match request/response pair.
  118. When a communication is issued through any of the channels, an application
  119. formats a request and expect a response.
  120. Direct Command
  121. --------------
  122. The simplest form of communication is a "direct command" using SMS/KCS
  123. Example:
  124. ipmitool raw 6 4
  125. 55 00
  126. This send raw command 4 (selftest) from netfn 6(application) to KCS, the driver
  127. takes care of 'message tracking' and provides the answer.
  128. Hopefully, the application also includes a "human readable" instance of the API:
  129. ipmitool mc selftest
  130. Selftest: passed
  131. Bridged Command
  132. ---------------
  133. One slightly more complicated communication mode is the so-called
  134. "bridged command" using IPMB.
  135. Example:
  136. ipmitool -m 0x94 -t 0x9a raw 6 4
  137. 55 00
  138. or
  139. ipmitool -m 0x94 -t 0x9a mc selftest
  140. Selftest: passed
  141. This still sends the same command 4 (selftest) from netfn 6(application) to
  142. the target. However, to do so, the command is encapsulated (by the driver) and
  143. sent using the command 0x34 (send message) from netfn 6(application) to KCS.
  144. Then KCS is polled by the driver until a message has been received, then the
  145. driver uses command 0x33 (get message). The driver also tracks the message
  146. and makes sure the response matches the request. Then it decapsultates the
  147. message and gives the response back to the application.
  148. Dual Bridged Command
  149. --------------------
  150. Things get a little more ugly when the application needs to reach a management
  151. controller sitting on an interface (or channel) not directly connected to the
  152. BMC/IPMC. In the case the application must encapsulate its message itself and
  153. request the IPMC to deal with message tracking itself.
  154. Its been working well with IPMITOOL on the LAN interface with:
  155. ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x20 -t 0x7a -b 7
  156. mc selftest
  157. However, trying to dual bridge commands locally with :
  158. ipmitool -B 0 -T 0x9a -m 0x94 -t 0x7a -b 7 mc selftest didn't work
  159. (it returned the same data as ipmitool -m 0x20 -t 0x7a -b 7 mc selftest )
  160. The reason was that the "openipmi" interface pluging didn't
  161. encapsulate/decapsulate the message and didn't even detect the intent
  162. to double bridge the request.
  163. ./src/ipmitool -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7 mc selftest
  164. -B 0 : transit channel for first bridge level (channel 0: IPMB-0)
  165. -T 0x8a : transit destination address (remote IPMC address)
  166. -m 0x94 : source address (local IPMC address on IPMB-0)
  167. -t 0x7a : remote target (AMC IPMB-L address)
  168. -b 7 : remote channel (channel 7: IPMB-L)
  169. The transit source address (remote IPMC address on remote channel) is
  170. automatically assigned by the remote IPMC.
  171. Payload Size Limit
  172. ------------------
  173. Because some commands return a lot of data (fru read/get sdr) and because 2
  174. levels of encapsulation are used, some command will fail.
  175. For instance this works.
  176. ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7
  177. mc selftest
  178. but this does not:
  179. ipmitool -H <ip> -U <user> -P <password> -B 0 -T 0x8a -m 0x94 -t 0x7a -b 7
  180. fru print.
  181. Usage
  182. =====
  183. All invocations of ipmitool require specifying an interface to use, unless
  184. you want to use the default interface as set at compile time. Each call
  185. must also specify a command to run. You can see the list of supported
  186. interfaces and which is default as well as a list of top level commands in
  187. the usage output available with the -h option:
  188. usage: ipmitool [options...] <command>
  189. -h This help
  190. -V Show version information
  191. -v Verbose (can use multiple times)
  192. -c Display output in comma separated format
  193. -I intf Interface to use
  194. -H hostname Remote host name for LAN interface
  195. -p port Remote RMCP port [default=623]
  196. -L level Remote session privilege level [default=USER]
  197. -A authtype Force use of authtype NONE, PASSWORD, MD2 or MD5
  198. -U username Remote session username
  199. -P password Remote session password
  200. -f file Read remote session password from file
  201. -a Prompt for remote password
  202. -E Read password from IPMI_PASSWORD environment variable
  203. -m address Set local IPMB address
  204. -t address Bridge request to remote target address
  205. Interfaces:
  206. open Linux OpenIPMI Interface [default]
  207. imb Intel IMB Interface
  208. lan IPMI v1.5 LAN Interface
  209. lanplus IPMI v2.0 RMCP+ LAN Interface
  210. Commands:
  211. raw Send a RAW IPMI request and print response
  212. lan Configure LAN Channels
  213. chassis Get chassis status and set power state
  214. event Send pre-defined events to BMC
  215. bmc Print BMC status and configure global enables
  216. sdr Print Sensor Data Repository entries and readings
  217. sensor Print detailed sensor information
  218. fru Print built-in FRU and scan SDR for FRU locators
  219. sel Print System Evelnt Log
  220. sol Configure IPMIv2.0 Serial-over-LAN
  221. user Configure BMC users
  222. channel Configure BMC channels
  223. session Print session information
  224. shell Launch interactive IPMI shell
  225. exec Run list of commands from file
  226. set Set runtime variable for shell and exec
  227. Commands
  228. ========
  229. More help on the supported commands can be found by running them with the
  230. help argument, for example "chassis help". There are a few commands with
  231. special meaning:
  232. > shell: This command will launch an shell interface to the ipmitool
  233. command set. You can use this for interactively entering commands to
  234. monitor system status. An example session:
  235. # ipmitool -I open shell
  236. ipmitool> chassis status
  237. System Power : off
  238. Power Overload : false
  239. Power Interlock : inactive
  240. Main Power Fault : false
  241. Power Control Fault : false
  242. Power Restore Policy : always-off
  243. Last Power Event : command
  244. Chassis Intrusion : active
  245. Front-Panel Lockout : inactive
  246. Drive Fault : false
  247. Cooling/Fan Fault : false
  248. ipmitool> user list 7
  249. ID Name Callin Link Auth IPMI Msg Channel Priv Limit
  250. 1 true false true ADMINISTRATOR
  251. ipmitool> exit
  252. > exec: This command will read a text file and execute ipmitool commands
  253. in sequence. It can be used for scriptable commands:
  254. # cat lansetup.scr
  255. lan set 7 ipsrc static
  256. lan set 7 ipaddr 10.1.1.10
  257. lan set 7 netmask 255.255.255.0
  258. lan set 7 defgw ipaddr 10.1.1.254
  259. # ipmitool -I open exec lansetup.scr
  260. Setting LAN IP Address to 10.1.1.10
  261. Setting Lan Subnet Mask to 255.255.255.0
  262. Setting Lan Default Gateway IP to 10.1.1.254
  263. > set: This command can be used by the shell and exec modes to configure
  264. various session parameters:
  265. hostname <host> Session hostname
  266. username <user> Session username
  267. password <pass> Session password
  268. privlvl <level> Session privilege level force
  269. authtype <type> Authentication type force
  270. localaddr <addr> Local IPMB address
  271. targetaddr <addr> Remote target IPMB address
  272. port <port> Remote RMCP port
  273. csv [level] enable output in comma separated format
  274. verbose [level] Verbose level
  275. # cat getstatus.scr
  276. set hostname sf-v20z-1
  277. set password admin
  278. chassis status
  279. # ipmitool -I lan exec getstatus.scr
  280. Set session hostname to lx50
  281. Set session password
  282. System Power : off
  283. Power Overload : false
  284. Power Interlock : inactive
  285. Main Power Fault : false
  286. Power Control Fault : false
  287. Power Restore Policy : always-off
  288. Last Power Event : command
  289. Chassis Intrusion : active
  290. Front-Panel Lockout : inactive
  291. Drive Fault : false
  292. Cooling/Fan Fault : false
  293. ipmievd
  294. =======
  295. Included with ipmitool is another utility called ipmievd that is a daemon
  296. which will listen for events from the BMC that are being sent to the SEL
  297. and also log those messages to syslog. By default when run (as root) with
  298. no arguments it will daemonize and poll on the OpenIPMI device waiting for
  299. an event notification. Upon receipt of an event it will log it to syslog
  300. with the LOG_LOCAL4 facility. You can test ipmievd by sending test events
  301. over the LAN interface with ipmitool:
  302. remote# ipmievd
  303. local$ ipmitool -I lan -H lx50 -P admin event help
  304. usage: event <num>
  305. 1 : Temperature - Upper Critical - Going High
  306. 2 : Voltage Threshold - Lower Critical - Going Low
  307. 3 : Memory - Correctable ECC
  308. local$ ipmitool -I lan -H lx50 -P admin event 1
  309. Sending Temperature - Upper Critical - Going High event to BMC
  310. local$ ipmitool -I lan -H lx50 -P admin event 2
  311. Sending Voltage Threshold - Lower Critical - Going Low event to BMC
  312. local$ ipmitool -I lan -H lx50 -P admin event 3
  313. Sending Memory - Correctable ECC event to BMC
  314. remote# tail /var/log/messages (timestamps removed)
  315. ipmievd: Waiting for events...
  316. ipmievd: Temperature Sensor 30 - Upper Critical - going high
  317. ipmievd: Voltage Sensor 60 - Lower Critical - going low
  318. ipmievd: Memory Sensor 01 - Correctable ECC
  319. Resources
  320. =========
  321. IPMItool homepage
  322. http://ipmitool.sourceforge.net
  323. IPMItool manpage
  324. http://ipmitool.sourceforge.net/manpage.html
  325. IPMItool overview paper from Linux.conf.au 2004
  326. http://ipmitool.sourceforge.net/lca2004_ipmitool.pdf
  327. Intelligent Platform Management Interface specification
  328. http://www.intel.com/design/servers/ipmi/spec.htm
  329. OpenIPMI project: Linux IPMI kernel driver and userland library
  330. http://openipmi.sourceforge.net
  331. IPMItool commit archive
  332. https://lists.sourceforge.net/lists/listinfo/ipmitool-cvs