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#### power subsystem. 185 186``` 187$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis status 188``` 189 190#### 2. The command will return the power on time 191 192``` 193$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis poh 194``` 195 196#### 3. Query the reason for the last system restart.(not supported) 197 198``` 199$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis restart_cause 200``` 201 202#### 4. Set rack power strategy in case of power failure 203 204``` 205$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis policy <state> 206 207## 208list : return supported policies 209always-on : turn on when power is restored 210previous : return to previous state when power is restored 211always-off : stay off after power is restored 212``` 213 214#### 5. View and change power status 215 216``` 217$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis power 218 219## 220status : show current status 221on : power on 222off : power off 223reset : power reset 224soft : power soft 225cycle : power cycle 226``` 227 228#### 6. Set boot device for next system restart 229 230``` 231$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device> 232``` 233 234## 235 236Currently supported devices: 237 238| device | function | 239| :----: | ----------------------------------------------------------- | 240| none | do not change boot device | 241| pxe | boot from pxe | 242| disk | boot from BIOS default boot device | 243| safe | boot from BIOS default boot device,but requires a safe mode | 244| diag | boot from the diagnostic partition | 245| cdrom | boot from the CD/DVD | 246| bios | enter bios settings | 247 248## 249 250If you want to make your override persistent over reboots use the `persistent` option: 251``` 252$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device> options=persistent 253``` 254 255## 256 257If the main host machine is based on the x86 CPU you need also pay attention to 258the legacy/EFI mode selector. By default IPMI overrides boot source with the legacy 259mode enabled. To set EFI mode use `efiboot` option: 260``` 261$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device> options=efiboot 262``` 263 264You can combine options with a help of `,`: 265``` 266$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev <device> options=persistent,efiboot 267``` 268 269## 270 271To read current boot source override setting: 272``` 273$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootparam get 5 274``` 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 identify <interval> 280``` 281 282## Local Area Network(LAN) 283 284#### 1. Output the current configuration information of a given channel 285 286``` 287 $ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" lan print [<channel number>] 288``` 289 290#### 2. Set the given parameters for the given channel 291 292``` 293$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" lan set <channel> <command> <parameter> 294## 295Valid parameter 296ipaddr <x.x.x.x> : Set ip for this channel 297netmask <x.x.x.x> : Set netmask for this channel 298macaddr<xx:xx:xx:xx:xx:xx> : Set the mac address for this channel 299defgw ipaddr <x.x.x.x> : Set the default gateway IP address 300defgw macaddr<xx:xx:xx:xx:xx:xx> : Set the mac address of the default gateway 301bakgw ipaddr <x.x.x.x> : Set the IP address of the backup gateway 302bakgw macaddr<xx:xx:xx:xx:xx:xx> : Set the IP address of the backup gateway 303password <pass> : Set no user password 304access <on|off> : Set the LAN channel access mode 305``` 306 307## System Event Log (SEL) 308 309#### 1. Query the relevant information about SEL and its content in BMC 310 311``` 312$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel info 313``` 314 315#### 2. Clear the information in SEL,but it cannot be undone. 316 317``` 318$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel clear 319``` 320 321#### 3. Delete a single event 322 323``` 324$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel delete <number> 325``` 326 327#### 4. Display the current time of the SEL clock 328 329``` 330$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel time get 331``` 332 333## Session 334 335#### 1. Display session information 336 337``` 338$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" session info all 339``` 340 341## Serial Over Lan (SOL) 342 343#### 1. Retrieve Serial-Over-LAN configuration information for the specified 344#### channel. 345 346``` 347$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol info [<channel number>] 348``` 349 350#### 2. Put ipmitool into Serial Over LAN mode 351 352``` 353$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol activate 354``` 355 356#### 3. Disable serial LAN in BMC mode 357 358``` 359$ ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol deactivate 360``` 361