ipmi

ipmitool

Install
sudo apt-add-repository universe
sudo apt install -y freeipmi-tools ipmitool

Install ipmitool (IPMI command line client)
<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.ipmitool.sh";
echo "wget $URL -O - | bash -";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

Configure BMC to DHCP
# show BMC interface informations
ipmitool lan print

# set dhcp IP
ipmitool lan set 1 ipsrc dhcp

# set static IP
ipmitool lan set 1 ipsrc static
ipmitool lan set 1 ipaddr 10.0.1.11
ipmitool lan set 1 netmask_address 255.255.255.0
ipmitool lan set 1 defgw ipaddr 10.0.1.252

Commands
# Reset chassis intrusion
ipmitool -I lanplus -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} raw 0x30 0x03

# enable UID light
ipmitool -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} raw 0x30 0x0d

# disable UID light
ipmitool -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} raw 0x30 0x0e

configure bmc user
NEW_BMC_USER=devops
NEW_BMC_PASS=pass1234
ipmitool -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} user set name 2 ${NEW_BMC_USER}
ipmitool -H ${BMC_IP} -U ${NEW_BMC_USER} -P ${BMC_PASS} user set password 2 ${NEW_BMC_PASS}

view sensors readings
ipmitool sdr

# howto
# reset BMC
ipmitool -I lan -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} mc reset cold

# reset factory defaults
ipmitool -I lan -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} raw 0x3c 0x40

# reset server
ipmitool power reset -I lan -H ${IP} -U ADMIN -P ADMIN

# power on / off
ipmitool -I lanplus -H SERVER_IP -U ADMIN -P ADMIN power on
ipmitool -I lanplus -H SERVER_IP -U ADMIN -P ADMIN power off
ipmitool -I lanplus -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} power reset

# get IPMI IP
IPMI_IP=$(ipmitool lan print | grep "IP Address" | grep -v Source | cut -d":" -f2)

FRU
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} fru

Configure User
https://docs.oracle.com/en/database/oracle/oracle-database/18/cwlin/example-of-bmc-configuration-using-ipmitool.html#GUID-11E563E0-3688-4FE9-8440-81402A7AC23A
https://www.thomas-krenn.com/de/wiki/IPMI_Konfiguration_unter_Linux_mittels_ipmitool
https://www.thomas-krenn.com/de/wiki/IPMI_Konfiguration_unter_Linux_mittels_ipmitool

# test
ipmitool -I lanplus -H 192.168.1.100 -U ADMIN -P ADMIN sdr
ipmitool -I lan -H 192.168.1.100 -U ADMIN -P ADMIN sdr

Configure temporary boot device
https://www.thomas-krenn.com/de/wiki/Bootdevice_mit_ipmitool_setzen

# boot to bios
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} chassis bootdev bios
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} power reset

# boot to pxe (UEFI)
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} chassis bootdev pxe options=efiboot
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} power reset