diff --git a/Dockerfile b/Dockerfile index 0287caf..57d6f71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,5 +26,6 @@ ENV IDRAC_HOST local #ENV IDRAC_USER root #ENV IDRAC_PASSWORD calvin ENV FAN_SPEED 5 +ENV MAXIMUM_TEMPERATURE 32 CMD /startup.sh && /opt/check_temp.sh && cron && tail -f /var/log/cron.log diff --git a/README.md b/README.md index 6e75f44..c0a2f69 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ - `IDRAC_HOST` parameter can be set to "local" or to your distant iDRAC's IP address. Default value is "local". - `IDRAC_USERNAME` parameter is only necessary if you're adressing a distant iDRAC. Default value is "root". - `IDRAC_PASSWORD` parameter is only necessary if you're adressing a distant iDRAC. Default value is "calvin". -- `FAN_SPEED` parameter can be set as a decimal or hexadecimal value (0x00 to 0x64). Default value is 5 (%). +- `FAN_SPEED` parameter can be set as a decimal (from 0 to 100%) or hexadecimal value (from 0x00 to 0x64) you want to set the fans to. Default value is 5(%). +- `MAXIMUM_TEMPERATURE` parameter is the threshold beyond which the Dell fan mode defined in your BIOS will become active again (to protect the server hardware against overheat). Default value is 32(°C). To use: @@ -14,6 +15,7 @@ docker run -d \ --name Dell_iDRAC_fan_controller \ --restart unless-stopped \ -e FAN_SPEED= \ + -e MAXIMUM_TEMPERATURE= \ alombardo4/idrac-fan-control:latest ``` @@ -27,6 +29,7 @@ docker run -d \ -e IDRAC_USERNAME= \ -e IDRAC_PASSWORD= \ -e FAN_SPEED= \ + -e MAXIMUM_TEMPERATURE= \ alombardo4/idrac-fan-control:latest ``` @@ -45,6 +48,7 @@ services: environment: - IDRAC_HOST=local # can be omitted as it is the default value - FAN_SPEED=0x05 # set to the decimal or hexadecimal value you want to set the fans to (from 0 to 100%) + - MAXIMUM_TEMPERATURE= devices: - /dev/ipmi0:/dev/ipmi0 ``` @@ -64,4 +68,5 @@ services: - IDRAC_USERNAME=root # set to your IPMI username - IDRAC_PASSWORD=calvin # set to your IPMI password - FAN_SPEED=0x05 # set to the decimal or hexadecimal value you want to set the fans to (from 0 to 100%) + - MAXIMUM_TEMPERATURE= ``` diff --git a/check_temp.sh b/check_temp.sh index 23c2c9e..5232fcb 100755 --- a/check_temp.sh +++ b/check_temp.sh @@ -5,8 +5,7 @@ IPMI_USERNAME=`cat /idrac_username.txt` IPMI_PASSWORD=`cat /idrac_password.txt` DECIMAL_FAN_SPEED=`cat /decimal_fan_speed.txt` HEXADECIMAL_FAN_SPEED=`cat /hexadecimal_fan_speed.txt` - -MAX_INLET_TEMPERATURE=32 +MAXIMUM_INLET_TEMPERATURE=`cat /maximum_inlet_temperature.txt` if [[ $IPMI_HOST == "local" ]] then @@ -23,7 +22,7 @@ NC='\033[0m' # No Color echo "------------------------------------" echo "Current inlet temperature is $INLET_TEMPERATURE °C." -if [ $INLET_TEMPERATURE -gt $MAX_INLET_TEMPERATURE ] +if [ $INLET_TEMPERATURE -gt $MAXIMUM_INLET_TEMPERATURE ] then printf "Inlet temperature is ${RED}too high${NC}. Activating default dynamic fan control." ipmitool -I $LOGIN_STRING raw 0x30 0x30 0x01 0x01 diff --git a/startup.sh b/startup.sh index 72317df..fa28a19 100644 --- a/startup.sh +++ b/startup.sh @@ -15,6 +15,7 @@ fi echo $DECIMAL_FAN_SPEED >> /decimal_fan_speed.txt echo $HEXADECIMAL_FAN_SPEED >> /hexadecimal_fan_speed.txt +echo $MAXIMUM_TEMPERATURE >> /maximum_inlet_temperature.txt echo "Idrac/IPMI host: `cat /idrac_host.txt`" if [[ $IDRAC_HOST != "local" ]] @@ -23,3 +24,4 @@ then echo "Idrac/IPMI password: `cat /idrac_password.txt`" fi echo "Fan speed objective: `cat /decimal_fan_speed.txt`%" +echo "Maximum inlet temperature: `cat /maximum_inlet_temperature.txt`°C"