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