Add more ipmi stuff
This commit is contained in:
parent
3c68936ebc
commit
fb06f8f264
6 changed files with 17 additions and 19 deletions
|
@ -120,11 +120,6 @@ dotfiles:
|
||||||
src: etc/systemd/system/ipmi
|
src: etc/systemd/system/ipmi
|
||||||
dst: /etc/systemd/system/ipmi
|
dst: /etc/systemd/system/ipmi
|
||||||
profiles:
|
profiles:
|
||||||
IPMI:
|
|
||||||
dotfiles:
|
|
||||||
- f_ipmi-temp.timer
|
|
||||||
- f_ipmi-temp.service
|
|
||||||
- f_ipmi-static.service
|
|
||||||
Locale:
|
Locale:
|
||||||
dotfiles:
|
dotfiles:
|
||||||
- f_locale.conf
|
- f_locale.conf
|
||||||
|
@ -184,3 +179,4 @@ profiles:
|
||||||
dotfiles:
|
dotfiles:
|
||||||
- f_sshd_config
|
- f_sshd_config
|
||||||
- f_99-sysctl.conf
|
- f_99-sysctl.conf
|
||||||
|
- d_ipmi
|
||||||
|
|
|
@ -7,7 +7,7 @@ services:
|
||||||
- TZ=Europe/Helsinki
|
- TZ=Europe/Helsinki
|
||||||
volumes:
|
volumes:
|
||||||
- /docker/homeautomation/home-assistant:/config
|
- /docker/homeautomation/home-assistant:/config
|
||||||
- /tmp/idrac-temp:/idrac-temp
|
- /tmp/ipmi:/ipmi
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
|
|
|
@ -4,16 +4,16 @@ IPMIHOST=10.0.0.82
|
||||||
IPMIUSER=ReekyMarko
|
IPMIUSER=ReekyMarko
|
||||||
IPMIPW={{@@ env['PASS_IPMI'] @@}}
|
IPMIPW={{@@ env['PASS_IPMI'] @@}}
|
||||||
IPMIEK=0000000000000000000000000000000000000000
|
IPMIEK=0000000000000000000000000000000000000000
|
||||||
MAXTEMP=27
|
|
||||||
TEMP=$(ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK sdr type temperature |grep Ambient |grep degrees |grep -Po '\d{2}' | tail -1)
|
|
||||||
|
|
||||||
echo $TEMP > /tmp/idrac-temp
|
mkdir -p /tmp/ipmi
|
||||||
|
|
||||||
|
DATA=`ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK sdr get "FAN 1 RPM" "FAN 2 RPM" "FAN 3 RPM" "FAN 4 RPM" "FAN 5 RPM" "FAN 6 RPM" | grep "Sensor Reading" | awk '{ print $4 }'`
|
||||||
|
|
||||||
if [[ $TEMP > $MAXTEMP ]];
|
echo "$DATA"
|
||||||
then
|
|
||||||
printf "Warning: Temperature is too high! Activating dynamic fan control! ($TEMP C)"
|
echo "$DATA" | head -1 | tail -1> /tmp/ipmi/fan1
|
||||||
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK raw 0x30 0x30 0x01 0x01
|
echo "$DATA" | head -2 | tail -1> /tmp/ipmi/fan2
|
||||||
else
|
echo "$DATA" | head -3 | tail -1> /tmp/ipmi/fan3
|
||||||
printf "Temperature is OK ($TEMP C)"
|
echo "$DATA" | head -4 | tail -1> /tmp/ipmi/fan4
|
||||||
fi
|
echo "$DATA" | head -5 | tail -1> /tmp/ipmi/fan5
|
||||||
|
echo "$DATA" | head -6 | tail -1> /tmp/ipmi/fan6
|
||||||
|
|
|
@ -7,7 +7,9 @@ IPMIEK=0000000000000000000000000000000000000000
|
||||||
MAXTEMP=27
|
MAXTEMP=27
|
||||||
TEMP=$(ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK sdr type temperature |grep Ambient |grep degrees |grep -Po '\d{2}' | tail -1)
|
TEMP=$(ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK sdr type temperature |grep Ambient |grep degrees |grep -Po '\d{2}' | tail -1)
|
||||||
|
|
||||||
echo $TEMP > /tmp/idrac-temp
|
mkdir -p /tmp/ipmi
|
||||||
|
|
||||||
|
echo $TEMP > /tmp/ipmi/temp
|
||||||
|
|
||||||
|
|
||||||
if [[ $TEMP > $MAXTEMP ]];
|
if [[ $TEMP > $MAXTEMP ]];
|
||||||
|
|
|
@ -3,7 +3,7 @@ Description=Set fan speed
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/home/balrog/Scripts/ipmi-static.sh
|
ExecStart=/home/balrog/Scripts/ipmi/static.sh
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -3,7 +3,7 @@ Description=Watch server temperature
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/home/balrog/Scripts/ipmi-temp.sh
|
ExecStart=/home/balrog/Scripts/ipmi/temp.sh
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Reference in a new issue