xref: /openbmc/docs/IPMITOOL-cheatsheet.md (revision f4febd00)
1# IPMITOOL-cheatsheet.md
2
3This document is intended to provide a set of ipmitool commands for OpenBMC
4usage.
5
6## Power
7
8#### 1. View server status
9
10```
11$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power status
12```
13
14#### 2. Server power on
15
16```
17$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power on
18```
19
20#### 3. Server power off
21
22```
23$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power off
24```
25
26#### 4. Server power reset
27
28```
29$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power reset
30```
31
32#### 5. Server power cycle
33
34```
35$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power cycle
36```
37
38#### 6. Server power soft
39
40```
41$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power soft
42```
43
44#### 7. Send a diagnostic interrupt directly to the processor(not support)
45
46```
47$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power diag
48```
49
50## Users
51
52#### 1. View information for all users
53
54```
55$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user list
56```
57
58#### 2. Display a brief summary of BMC users
59
60```
61$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user summary
62```
63
64#### 3. Create a BMC user with a given name
65
66```
67$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user set name <userid> <username>
68```
69
70#### 4. Set a given user with a given password
71
72```
73$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user set password <userid>[<password>]
74```
75
76#### 5. Disable designated users from accessing BMC
77
78```
79$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user disable <userid>
80```
81
82#### 6. Enable the specified user to access BMC
83
84```
85$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user enable <userid>
86```
87
88## Field-replaceable Unit (FRU)
89
90#### 1. View FRU information
91
92```
93$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" fru list
94```
95
96## Sensor Data Record (SDR)
97
98#### 1. View SDR information
99
100```
101$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sdr
102```
103
104#### 2. Query related SDR information in BMC
105
106```
107$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sdr info
108```
109
110#### 3. View sensor date records
111
112```
113$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sdr list [all|full|compact|event|mcloc|fru|generic]
114
115##
116all     : All SDR records (sensors and positioners)
117full    : Complete sensor recording
118compact : Simple sensor recording
119event   : Event information recorded by the sensor
120mcloc   : Manage controller locator records
121fru     : FRU (Field Replaceable Unit) locator record
122generic : General SDR records
123```
124
125## Sensors
126
127#### 1. View sensor information
128
129```
130$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sensor list
131```
132
133## Management Controller (MC)
134
135#### 1. Instruct the BMC to perform a cold reset
136
137```
138$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" mc reset cold
139```
140
141#### 2. Instruct the BMC to perform a warm reset(not supported)
142
143```
144$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" mc reset warm
145```
146
147#### 3. View BMC information
148
149```
150$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" mc info
151```
152
153#### 4. View the currently available operation options of BMC
154
155```
156$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" mc getenables
157```
158
159## Channels
160
161#### 1. Display the authentication function about the selected information
162
163#### channel
164
165```
166$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" channel authcap <channel number> <max privilege>
167```
168
169#### 2. Display the information for the selected channel
170
171```
172$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" channel info [<channel number>]
173```
174
175#### 3. View channel information
176
177```
178$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" channel info
179```
180
181## Chassis
182
183#### 1. Display information about the high-level status of the system rack and
184
185#### power subsystem.
186
187```
188$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis status
189```
190
191#### 2. The command will return the power on time
192
193```
194$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis poh
195```
196
197#### 3. Query the reason for the last system restart.(not supported)
198
199```
200$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis restart_cause
201```
202
203#### 4. Set rack power strategy in case of power failure
204
205```
206$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis policy <state>
207
208##
209list        : return supported policies
210always-on   : turn on when power is restored
211previous    : return to previous state when power is restored
212always-off  : stay off after power is restored
213```
214
215#### 5. View and change power status
216
217```
218$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis power
219
220##
221status : show current status
222on     : power on
223off    : power off
224reset  : power reset
225soft   : power soft
226cycle  : power cycle
227```
228
229#### 6. Set boot device for next system restart
230
231```
232$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device>
233```
234
235##
236
237Currently supported devices:
238
239| device | function                                                    |
240| :----: | ----------------------------------------------------------- |
241|  none  | do not change boot device                                   |
242|  pxe   | boot from pxe                                               |
243|  disk  | boot from BIOS default boot device                          |
244|  safe  | boot from BIOS default boot device,but requires a safe mode |
245|  diag  | boot from the diagnostic partition                          |
246| cdrom  | boot from the CD/DVD                                        |
247|  bios  | enter bios settings                                         |
248
249##
250
251If you want to make your override persistent over reboots use the `persistent`
252option:
253
254```
255$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device> options=persistent
256```
257
258##
259
260If the main host machine is based on the x86 CPU you need also pay attention to
261the legacy/EFI mode selector. By default IPMI overrides boot source with the
262legacy mode enabled. To set EFI mode use `efiboot` option:
263
264```
265$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device> options=efiboot
266```
267
268You can combine options with a help of `,`:
269
270```
271$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device> options=persistent,efiboot
272```
273
274##
275
276To read current boot source override setting:
277
278```
279$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootparam get 5
280```
281
282#### 7. Control panel logo light
283
284```
285$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis identify <interval>
286```
287
288## Local Area Network(LAN)
289
290#### 1. Output the current configuration information of a given channel
291
292```
293 $ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" lan print [<channel number>]
294```
295
296#### 2. Set the given parameters for the given channel
297
298```
299$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" lan set <channel> <command> <parameter>
300##
301Valid parameter
302ipaddr <x.x.x.x>                 : Set ip for this channel
303netmask <x.x.x.x>                : Set netmask for this channel
304macaddr<xx:xx:xx:xx:xx:xx>       : Set the mac address for this channel
305defgw ipaddr <x.x.x.x>           : Set the default gateway IP address
306defgw macaddr<xx:xx:xx:xx:xx:xx> : Set the mac address of the default gateway
307bakgw ipaddr <x.x.x.x>           : Set the IP address of the backup gateway
308bakgw macaddr<xx:xx:xx:xx:xx:xx> : Set the IP address of the backup gateway
309password <pass>                  : Set no user password
310access <on|off>                  : Set the LAN channel access mode
311```
312
313## System Event Log (SEL)
314
315#### 1. Query the relevant information about SEL and its content in BMC
316
317```
318$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel info
319```
320
321#### 2. Clear the information in SEL,but it cannot be undone.
322
323```
324$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel clear
325```
326
327#### 3. Delete a single event
328
329```
330$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel delete <number>
331```
332
333#### 4. Display the current time of the SEL clock
334
335```
336$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel time get
337```
338
339## Session
340
341#### 1. Display session information
342
343```
344$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" session info all
345```
346
347## Serial Over Lan (SOL)
348
349#### 1. Retrieve Serial-Over-LAN configuration information for the specified
350
351#### channel.
352
353```
354$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol info [<channel number>]
355```
356
357#### 2. Put ipmitool into Serial Over LAN mode
358
359```
360$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol activate
361```
362
363#### 3. Disable serial LAN in BMC mode
364
365```
366$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol deactivate
367```
368