Created
February 19, 2020 21:25
-
-
Save ppouliot/16284f0ebfd35102abee4ed034e90c80 to your computer and use it in GitHub Desktop.
Script to set the fan speed on Ampere server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
logo () { | |
echo "" | |
echo " ▄██▄" | |
echo " ▄█ █▄" | |
echo " ▄█ █▄" | |
echo " ▄▄▄▄█ ▄▄▄ █▄" | |
echo " ▄█▀▀▀ ▄█ ▀██▄" | |
echo " ▄█▀ ▄█ ▀█▄" | |
echo " A M P E R E COMPUTING" | |
} | |
display_usage () { | |
echo "" | |
echo "Usage: ./setFans.sh auto //Enable Cooling Manager" | |
echo "Usage: ./setFans.sh N //Set fan PWM to N%" | |
echo "" | |
} | |
set_fan () { | |
echo -n "Setting fan $1 to " | |
decPWM=$(printf "%d" $2) | |
echo -n "$decPWM%. " | |
fanStat=$(ipmitool raw 0x3C 0x14 $1 $2) #set fan pwm | |
if [ "$fanStat" = " 00" ]; then | |
echo "Success" | |
else | |
echo "Failed" | |
fi | |
} | |
logo | |
if [ $# -ne 1 ]; then | |
display_usage | |
exit 1 | |
fi | |
if [ "$1" = "auto" ]; then | |
#Enable cooling manager | |
cmStat=$(ipmitool raw 0x3C 0x0B 0x00) | |
echo -n "Cooling manager " | |
if [ "$cmStat" = " 00" ]; then | |
echo "enabled" | |
echo "Fan speed auto" | |
else | |
echo "disabled" | |
echo "Fan speed manual" | |
fi | |
else | |
#Convert decimal pwm to hex | |
hexPWM=$(printf "0x%02x" $1) | |
#Disable cooling manager | |
cmStat=$(ipmitool raw 0x3C 0x0b 0x01) | |
echo -n "Cooling manager " | |
if [ "$cmStat" = " 01" ]; then | |
echo "disabled" | |
echo "Fan speed manual" | |
else | |
echo "enabled" | |
echo "Fan speed auto" | |
fi | |
sleep 1 | |
#Set the fans | |
for nFan in {2..6} | |
do | |
set_fan $nFan $hexPWM | |
done | |
fi |
This script does not appear to work for the 2U Mt Jade platform with firmware 2.10d... any chance for a fix?
Hi thanks for the question. There’s no fix because this script is only for its original server.
I got it from Ampere who now have an active developer forum. I’d suggest you ask there
Alex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ppouliot I have figured it out!
Needs to be
2..7
- the 7th fan is the one that was being left out and which was causing all the noise.