Skip to content

Commit

Permalink
Merge pull request #58 from rw15e/feature/third_party_pcie_default_flag
Browse files Browse the repository at this point in the history
Feature/third party pcie default flag
  • Loading branch information
tigerblue77 authored Nov 10, 2024
2 parents f843679 + 96f6200 commit 8610b3b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dell_iDRAC_fan_controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

source functions.sh

# Trap the signals for container exit and run gracefull_exit function
trap 'gracefull_exit' SIGQUIT SIGKILL SIGTERM
# Trap the signals for container exit and run graceful_exit function
trap 'graceful_exit' SIGQUIT SIGTERM

# Prepare, format and define initial variables

Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ ENV FAN_SPEED 5
ENV CPU_TEMPERATURE_THRESHOLD 50
ENV CHECK_INTERVAL 60
ENV DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE false
ENV KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT false

CMD ["./Dell_iDRAC_fan_controller.sh"]
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ docker run -d \
-e CPU_TEMPERATURE_THRESHOLD=<decimal temperature threshold> \
-e CHECK_INTERVAL=<seconds between each check> \
-e DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE=<true or false> \
-e KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT=<true or false> \
--device=/dev/ipmi0:/dev/ipmi0:rw \
tigerblue77/dell_idrac_fan_controller:latest
```
Expand All @@ -98,6 +99,7 @@ docker run -d \
-e CPU_TEMPERATURE_THRESHOLD=<decimal temperature threshold> \
-e CHECK_INTERVAL=<seconds between each check> \
-e DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE=<true or false> \
-e KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT=<true or false> \
tigerblue77/dell_idrac_fan_controller:latest
```

Expand All @@ -119,6 +121,7 @@ services:
- CPU_TEMPERATURE_THRESHOLD=<decimal temperature threshold>
- CHECK_INTERVAL=<seconds between each check>
- DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE=<true or false>
- KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT=<true or false>
devices:
- /dev/ipmi0:/dev/ipmi0:rw
```
Expand All @@ -141,6 +144,7 @@ services:
- CPU_TEMPERATURE_THRESHOLD=<decimal temperature threshold>
- CHECK_INTERVAL=<seconds between each check>
- DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE=<true or false>
- KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT=<true or false>
```
<p align="right">(<a href="#top">back to top</a>)</p>
Expand All @@ -157,6 +161,7 @@ All parameters are optional as they have default values (including default iDRAC
- `CPU_TEMPERATURE_THRESHOLD` parameter is the T°junction (junction temperature) 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 50(°C).
- `CHECK_INTERVAL` parameter is the time (in seconds) between each temperature check and potential profile change. **Default** value is 60(s).
- `DISABLE_THIRD_PARTY_PCIE_CARD_DELL_DEFAULT_COOLING_RESPONSE` parameter is a boolean that allows to disable third-party PCIe card Dell default cooling response. **Default** value is false.
- `KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT` parameter is a boolean that allows to keep the third-party PCIe card Dell default cooling response state upon exit. **Default** value is false, so that it resets the third-party PCIe card Dell default cooling response to Dell default.

<p align="right">(<a href="#top">back to top</a>)</p>

Expand Down
10 changes: 8 additions & 2 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,15 @@ function disable_third_party_PCIe_card_Dell_default_cooling_response () {
# }

# Prepare traps in case of container exit
function gracefull_exit () {
function graceful_exit () {
apply_Dell_fan_control_profile
enable_third_party_PCIe_card_Dell_default_cooling_response

# Reset third-party PCIe card cooling response to Dell default depending on the user's choice at startup
if ! $KEEP_THIRD_PARTY_PCIE_CARD_COOLING_RESPONSE_STATE_ON_EXIT
then
enable_third_party_PCIe_card_Dell_default_cooling_response
fi

echo "/!\ WARNING /!\ Container stopped, Dell default dynamic fan control profile applied for safety."
exit 0
}
Expand Down

0 comments on commit 8610b3b

Please sign in to comment.