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| device | function | 268| :----: | ----------------------------------------------------------- | 269| none | do not change boot device | 270| pxe | boot from pxe | 271| disk | boot from BIOS default boot device | 272| safe | boot from BIOS default boot device,but requires a safe mode | 273| diag | boot from the diagnostic partition | 274| cdrom | boot from the CD/DVD | 275| bios | enter bios settings | 276 277## 278 279If you want to make your override persistent over reboots use the `persistent` option: 280``` 281$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis 282bootdev <device> options=persistent 283``` 284 285## 286 287If the main host machine is based on the x86 CPU you need also pay attention to 288the legacy/EFI mode selector. By default IPMI overrides boot source with the legacy 289mode enabled. To set EFI mode use `efiboot` option: 290``` 291$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis 292bootdev <device> options=efiboot 293``` 294 295You can combine options with a help of `,`: 296``` 297$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis 298bootdev <device> options=persistent,efiboot 299``` 300 301## 302 303To read current boot source override setting: 304``` 305$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis 306bootparam get 5 307``` 308 309#### 7. Control panel logo light 310 311``` 312$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis 313identify <interval> 314``` 315 316## Local Area Network(LAN) 317 318#### 1. Output the current configuration information of a given channel 319 320``` 321 $ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" lan 322print [<channel number>] 323``` 324 325#### 2. Set the given parameters for the given channel 326 327``` 328$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" lan set 329<channel> <command> <parameter> 330## 331Valid parameter 332ipaddr <x.x.x.x> : Set ip for this channel 333netmask <x.x.x.x> : Set netmask for this channel 334macaddr<xx:xx:xx:xx:xx:xx> : Set the mac address for this channel 335defgw ipaddr <x.x.x.x> : Set the default gateway IP address 336defgw macaddr<xx:xx:xx:xx:xx:xx> : Set the mac address of the default gateway 337bakgw ipaddr <x.x.x.x> : Set the IP address of the backup gateway 338bakgw macaddr<xx:xx:xx:xx:xx:xx> : Set the IP address of the backup gateway 339password <pass> : Set no user password 340access <on|off> : Set the LAN channel access mode 341``` 342 343## System Event Log (SEL) 344 345#### 1. Query the relevant information about SEL and its content in BMC 346 347``` 348$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel 349info 350``` 351 352#### 2. Clear the information in SEL,but it cannot be undone. 353 354``` 355$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel 356clear 357``` 358 359#### 3. Delete a single event 360 361``` 362$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel 363delete <number> 364``` 365 366#### 4. Display the current time of the SEL clock 367 368``` 369$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel 370time get 371``` 372 373## Session 374 375#### 1. Display session information 376 377``` 378$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" session 379info 380``` 381 382## Serial Over Lan (SOL) 383 384#### 1. Retrieve Serial-Over-LAN configuration information for the specified 385#### channel. 386 387``` 388$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol 389info [<channel number>] 390``` 391 392#### 2. Put ipmitool into Serial Over LAN mode 393 394``` 395$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol 396activate 397``` 398 399#### 3. Disable serial LAN in BMC mode 400 401``` 402$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol 403deactivate 404``` 405 406