HP iLO4 2.73 Basic CPU temp control

For the safety of the server, never use “max”. Using “min” allows the server to ramp up if needed, just make sure to add a mini fan to your HP420/i and adjust the thresholds for the sensors for such areas. I recommend actually doing something secure with SSH keys etc but for anyone with a offline setup, this is fine (kind of).

if [ $CPU1 -gt 87 ]
   then
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 4 min 115'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 5 min 115'
elif [ $CPU1 -gt 77 ]
    then
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 4 min 100'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 5 min 100'
elif [ $CPU1 -gt 70 ]
    then
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 4 min 92'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 5 min 92'
elif [ $CPU1 -gt 63 ]
    then
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 4 min 76'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 5 min 76'
elif [ $CPU1 -gt 53 ]
    then
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 4 min 64'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 5 min 64'
elif [ $CPU1 -gt 40 ]
    then
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 4 min 52'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 5 min 55'
    else
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 4 min 25'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 5 min 35'
fi

if [ $CPU2 -gt 87 ]
   then
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 0 min 115'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 1 min 115'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 2 min 115'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 3 min 115'
elif [ $CPU2 -gt 77 ]
    then
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 0 min 100'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 1 min 100'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 2 min 100'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 3 min 100'
elif [ $CPU1 -gt 70 ]
    then
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 0 min 85'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 1 min 85'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 2 min 85'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 3 min 85'
elif [ $CPU2 -gt 63 ]
    then
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 0 min 76'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 1 min 76'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 2 min 76'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 3 min 76'
elif [ $CPU2 -gt 53 ]
    then
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 0 min 64'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 1 min 64'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 2 min 64'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 3 min 64'
elif [ $CPU2 -gt 40 ]
    then
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 0 min 52'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 1 min 52'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 2 min 52'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 3 min 52'
    else
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 0 min 30'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 1 min 25'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 2 min 25'
        sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no $USERNAME@$ILOIP 'fan p 3 min 25'
fi