File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,15 @@ RUN apt-get update
7
7
RUN apt-get install ipmitool -y
8
8
9
9
ADD functions.sh /app/functions.sh
10
+ ADD healthcheck.sh /app/healthcheck.sh
10
11
ADD Dell_iDRAC_fan_controller.sh /app/Dell_iDRAC_fan_controller.sh
11
12
12
- RUN chmod 0777 /app/functions.sh /app/Dell_iDRAC_fan_controller.sh
13
+ RUN chmod 0777 /app/functions.sh /app/healthcheck.sh /app/ Dell_iDRAC_fan_controller.sh
13
14
14
15
WORKDIR /app
15
16
17
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "/app/healthcheck.sh" ]
18
+
16
19
# you should override these default values when running. See README.md
17
20
# ENV IDRAC_HOST 192.168.1.100
18
21
ENV IDRAC_HOST local
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Enable strict bash mode to stop the script if an uninitialized variable is used, if a command fails, or if a command with a pipe fails
4
+ # Not working in some setups : https://github.com/tigerblue77/Dell_iDRAC_fan_controller/issues/48
5
+ # set -euo pipefail
6
+
7
+ source functions.sh
8
+
9
+ # Check if the iDRAC host is set to 'local' or not then set the IDRAC_LOGIN_STRING accordingly
10
+ if [[ $IDRAC_HOST == " local" ]]
11
+ then
12
+ # Check that the Docker host IPMI device (the iDRAC) has been exposed to the Docker container
13
+ if [ ! -e " /dev/ipmi0" ] && [ ! -e " /dev/ipmi/0" ] && [ ! -e " /dev/ipmidev/0" ]; then
14
+ echo " /!\ Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0, check that you added the device to your Docker container or stop using local mode. Exiting." >&2
15
+ exit 1
16
+ fi
17
+ IDRAC_LOGIN_STRING=' open'
18
+ else
19
+ echo " iDRAC/IPMI username: $IDRAC_USERNAME "
20
+ echo " iDRAC/IPMI password: $IDRAC_PASSWORD "
21
+ IDRAC_LOGIN_STRING=" lanplus -H $IDRAC_HOST -U $IDRAC_USERNAME -P $IDRAC_PASSWORD "
22
+ fi
23
+
24
+ ipmitool -I $IDRAC_LOGIN_STRING sdr type temperature
You can’t perform that action at this time.
0 commit comments