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