# IPMITOOL-cheatsheet.md This document is intended to provide a set of ipmitool commands for OpenBMC usage. ## Power ### 1. View server status ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power status ``` ### 2. Server power on ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power on ``` ### 3. Server power off ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power off ``` ### 4. Server power reset ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power reset ``` ### 5. Server power cycle ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power cycle ``` ### 6. Server power soft ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power soft ``` ### 7. Send a diagnostic interrupt directly to the processor(not support) ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" power diag ``` ## Users ### 1. View information for all users ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user list ``` ### 2. Display a brief summary of BMC users ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user summary ``` ### 3. Create a BMC user with a given name ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user set name ``` ### 4. Set a given user with a given password ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user set password [] ``` ### 5. Disable designated users from accessing BMC ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user disable ``` ### 6. Enable the specified user to access BMC ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" user enable ``` ## Field-replaceable Unit (FRU) ### 1. View FRU information ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" fru list ``` ## Sensor Data Record (SDR) ### 1. View SDR information ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sdr ``` ### 2. Query related SDR information in BMC ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sdr info ``` ### 3. View sensor date records ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sdr list [all|full|compact|event|mcloc|fru|generic] ## all : All SDR records (sensors and positioners) full : Complete sensor recording compact : Simple sensor recording event : Event information recorded by the sensor mcloc : Manage controller locator records fru : FRU (Field Replaceable Unit) locator record generic : General SDR records ``` ## Sensors ### 1. View sensor information ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sensor list ``` ## Management Controller (MC) ### 1. Instruct the BMC to perform a cold reset ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" mc reset cold ``` ### 2. Instruct the BMC to perform a warm reset(not supported) ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" mc reset warm ``` ### 3. View BMC information ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" mc info ``` ### 4. View the currently available operation options of BMC ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" mc getenables ``` ## Channels ### 1. Display the authentication function about the selected information channel ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" channel authcap ``` ### 2. Display the information for the selected channel ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" channel info [] ``` ### 3. View channel information ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" channel info ``` ## Chassis ### 1. Display information about the high-level status of the system rack and power subsystem ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis status ``` ### 2. The command will return the power on time ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis poh ``` ### 3. Query the reason for the last system restart.(not supported) ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis restart_cause ``` ### 4. Set rack power strategy in case of power failure ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis policy ## list : return supported policies always-on : turn on when power is restored previous : return to previous state when power is restored always-off : stay off after power is restored ``` ### 5. View and change power status ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis power ## status : show current status on : power on off : power off reset : power reset soft : power soft cycle : power cycle ``` ### 6. Set boot device for next system restart ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev ``` ## Currently supported devices: | device | function | | :----: | ----------------------------------------------------------- | | none | do not change boot device | | pxe | boot from pxe | | disk | boot from BIOS default boot device | | safe | boot from BIOS default boot device,but requires a safe mode | | diag | boot from the diagnostic partition | | cdrom | boot from the CD/DVD | | bios | enter bios settings | If you want to make your override persistent over reboots use the `persistent` option: ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev options=persistent ``` If the main host machine is based on the x86 CPU you need also pay attention to the legacy/EFI mode selector. By default IPMI overrides boot source with the legacy mode enabled. To set EFI mode use `efiboot` option: ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev options=efiboot ``` You can combine options with a help of `,`: ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootdev options=persistent,efiboot ``` To read current boot source override setting: ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis bootparam get 5 ``` ### 7. Control panel logo light ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" chassis identify ``` ## Local Area Network(LAN) ### 1. Output the current configuration information of a given channel ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" lan print [] ``` ### 2. Set the given parameters for the given channel ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" lan set ## Valid parameter ipaddr : Set ip for this channel netmask : Set netmask for this channel macaddr : Set the mac address for this channel defgw ipaddr : Set the default gateway IP address defgw macaddr : Set the mac address of the default gateway bakgw ipaddr : Set the IP address of the backup gateway bakgw macaddr : Set the IP address of the backup gateway password : Set no user password access : Set the LAN channel access mode ``` ## System Event Log (SEL) ### 1. Query the relevant information about SEL and its content in BMC ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel info ``` ### 2. Clear the information in SEL,but it cannot be undone ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel clear ``` ### 3. Delete a single event ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel delete ``` ### 4. Display the current time of the SEL clock ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sel time get ``` ## Session ### 1. Display session information ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" session info all ``` ## Serial Over Lan (SOL) ### 1. Retrieve Serial-Over-LAN configuration information for the specified channel ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol info [] ``` ### 2. Put ipmitool into Serial Over LAN mode ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol activate ``` ### 3. Disable serial LAN in BMC mode ```bash ipmitool -C 17 -H "$BMC_IP" -I lanplus -U "$BMC_USER" -P "$BMC_PASSWD" sol deactivate ```