Merge pull request #4 from tigerblue77/1-enable-local-idrac-management
Enable local iDRAC management
This commit is contained in:
commit
d6499109d3
@ -21,8 +21,9 @@ RUN chmod 0777 /startup.sh
|
||||
RUN /usr/bin/crontab /etc/cron.d/fan-control
|
||||
|
||||
# you should override these when running. See README.md
|
||||
ENV IDRAC_HOST 192.168.1.100
|
||||
ENV IDRAC_USER root
|
||||
ENV IDRAC_PW calvin
|
||||
#ENV IDRAC_HOST 192.168.1.100
|
||||
ENV IDRAC_HOST local
|
||||
#ENV IDRAC_USER root
|
||||
#ENV IDRAC_PW calvin
|
||||
ENV FANSPEED 0x05
|
||||
CMD /startup.sh && cron && tail -f /var/log/cron.log
|
||||
25
README.md
25
README.md
@ -6,17 +6,36 @@ To use,
|
||||
|
||||
`FANSPEED` should be set as a hex value, e.g. `0x05`
|
||||
|
||||
Example `docker-compose.yml`:
|
||||
`docker-compose.yml` examples:
|
||||
|
||||
1. to use with local iDRAC:
|
||||
|
||||
```yml
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
fan-controller:
|
||||
Dell_iDRAC_fan_controller:
|
||||
image: alombardo4/idrac-fan-control
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- IDRAC_HOST=local # can be omitted as it is the default value
|
||||
- FANSPEED=0x05 # set to the hex value you want to set the fans to (from 0 to 100%)
|
||||
devices:
|
||||
- /dev/ipmi0:/dev/ipmi0
|
||||
```
|
||||
|
||||
2. to use with LAN iDRAC:
|
||||
|
||||
```yml
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
Dell_iDRAC_fan_controller:
|
||||
image: alombardo4/idrac-fan-control
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- IDRAC_HOST=192.168.1.100 # override to the IP of your IDRAC
|
||||
- IDRAC_USER=root # set to your IPMI username
|
||||
- IDRAC_PW=calvin # set to your IPMI password
|
||||
- FANSPEED=0x05 # set to the hex value you want to set the fans to (from 0 to 100)
|
||||
- FANSPEED=0x05 # set to the hex value you want to set the fans to (from 0 to 100%)
|
||||
```
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
IPMIHOST=`cat /host.txt`
|
||||
IPMIUSER=`cat /user.txt`
|
||||
IPMIPW=`cat /pw.txt`
|
||||
@ -5,15 +7,22 @@ FANSPEED=`cat /fanspeed.txt`
|
||||
|
||||
MAXTEMP=32
|
||||
|
||||
TEMP=$(ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW sdr type temperature |grep Inlet |grep degrees |grep -Po '\d{2}' | tail -1)
|
||||
if [[ $IPMIHOST == "local" ]]
|
||||
then
|
||||
LOGIN_STRING='open'
|
||||
else
|
||||
LOGIN_STRING="lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW"
|
||||
fi
|
||||
|
||||
TEMP=$(ipmitool -I $LOGIN_STRING sdr type temperature |grep Inlet |grep degrees |grep -Po '\d{2}' | tail -1)
|
||||
|
||||
echo "Current Temp is $TEMP C"
|
||||
if [ $TEMP -gt $MAXTEMP ];
|
||||
then
|
||||
echo "Temp is too high. Activating dynamic fan control"
|
||||
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x01 0x01
|
||||
ipmitool -I $LOGIN_STRING raw 0x30 0x30 0x01 0x01
|
||||
else
|
||||
echo "Temp is OK. Using manual fan control"
|
||||
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x01 0x00
|
||||
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x02 0xff $FANSPEED
|
||||
ipmitool -I $LOGIN_STRING raw 0x30 0x30 0x01 0x00
|
||||
ipmitool -I $LOGIN_STRING raw 0x30 0x30 0x02 0xff $FANSPEED
|
||||
fi
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo $IDRAC_HOST >> /host.txt
|
||||
echo $IDRAC_USER >> /user.txt
|
||||
echo $IDRAC_PW >> /pw.txt
|
||||
echo $FANSPEED >> /fanspeed.txt
|
||||
|
||||
echo "Host: `cat /host.txt`"
|
||||
if [[ $IDRAC_HOST != "local" ]]
|
||||
then
|
||||
echo "User: `cat /user.txt`"
|
||||
echo "PW: `cat /pw.txt`"
|
||||
fi
|
||||
echo "Fan speed `cat /fanspeed.txt`"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user