Move some files around

This commit is contained in:
Marko Korhonen 2020-02-17 13:52:25 +02:00
parent 1e7cb8ac7e
commit 3c68936ebc
8 changed files with 50 additions and 9 deletions

View file

@ -116,15 +116,9 @@ dotfiles:
f_20-quiet-printk.conf:
src: etc/sysctl.d/20-quiet-printk.conf
dst: /etc/sysctl.d/20-quiet-printk.conf
f_ipmi-temp.timer:
src: etc/systemd/system/ipmi-temp.timer
dst: /etc/systemd/system/ipmi-temp.timer
f_ipmi-temp.service:
src: etc/systemd/system/ipmi-temp.service
dst: /etc/systemd/system/ipmi-temp.service
f_ipmi-static.service:
src: etc/systemd/system/ipmi-static.service
dst: /etc/systemd/system/ipmi-static.service
d_ipmi:
src: etc/systemd/system/ipmi
dst: /etc/systemd/system/ipmi
profiles:
IPMI:
dotfiles:
@ -165,6 +159,7 @@ profiles:
- f_mkinitcpio.conf
- f_vconsole.conf
- f_20-quiet-printk.conf
- d_ipmi
include:
- Locale
- Pacman

19
home/Scripts/ipmi/temp.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/bash
IPMIHOST=10.0.0.82
IPMIUSER=ReekyMarko
IPMIPW={{@@ env['PASS_IPMI'] @@}}
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
if [[ $TEMP > $MAXTEMP ]];
then
printf "Warning: Temperature is too high! Activating dynamic fan control! ($TEMP C)"
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK raw 0x30 0x30 0x01 0x01
else
printf "Temperature is OK ($TEMP C)"
fi

View file

@ -0,0 +1,9 @@
[Unit]
Description=Set fan speed
[Service]
Type=simple
ExecStart=/home/balrog/Scripts/ipmi-static.sh
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,9 @@
[Unit]
Description=Watch server temperature
[Service]
Type=simple
ExecStart=/home/balrog/Scripts/ipmi-temp.sh
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,9 @@
[Unit]
Description=Watches server temperature
[Timer]
OnUnitInactiveSec=5s
OnBootSec=5s
[Install]
WantedBy=timers.target