Skip to content

Instantly share code, notes, and snippets.

@clemone210
Last active January 8, 2024 16:16
Show Gist options
  • Save clemone210/3c3351a8411182989be96dcf91751aee to your computer and use it in GitHub Desktop.
Save clemone210/3c3351a8411182989be96dcf91751aee to your computer and use it in GitHub Desktop.
Script to set the fan speed on HP Server trough iLO firmware
#!/bin/bash
# Variables
ilo_user="#" # Replace with your iLO username
ilo_pass="#" # Replace with your iLO password
ilo_host="#" # Replace with your iLO hostname or IP address
# Options to enable older key exchange and host key methods
ssh_options="-o KexAlgorithms=diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 -o HostKeyAlgorithms=ssh-rsa,ssh-dss -o StrictHostKeyChecking=no"
# Loop through the sensor numbers and send the command
for sensor in {01..46}
do
#echo "Setting fan PID $sensor to 1600 lo"
# SSH into iLO and send the command
sshpass -p $ilo_pass ssh $ssh_options $ilo_user@$ilo_host "fan pid $sensor lo 1600"
done
echo "All commands sent."
@clemone210
Copy link
Author

clemone210 commented Jan 8, 2024

script is placed at /usr/local/bin/fanspeed.sh

crontab -e
@reboot /usr/local/bin/fanspeed.sh >> /var/log/fanspeed.log 2>&1

sshpass needs to be installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment