diff --git a/config-root.yaml b/config-root.yaml index 4071ca8..23d66cb 100644 --- a/config-root.yaml +++ b/config-root.yaml @@ -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 diff --git a/home/Scripts/ipmi-auto.sh b/home/Scripts/ipmi/auto.sh similarity index 100% rename from home/Scripts/ipmi-auto.sh rename to home/Scripts/ipmi/auto.sh diff --git a/home/Scripts/ipmi-temp.sh b/home/Scripts/ipmi/fans.sh similarity index 100% rename from home/Scripts/ipmi-temp.sh rename to home/Scripts/ipmi/fans.sh diff --git a/home/Scripts/ipmi-static.sh b/home/Scripts/ipmi/static.sh similarity index 100% rename from home/Scripts/ipmi-static.sh rename to home/Scripts/ipmi/static.sh diff --git a/home/Scripts/ipmi/temp.sh b/home/Scripts/ipmi/temp.sh new file mode 100755 index 0000000..b25f111 --- /dev/null +++ b/home/Scripts/ipmi/temp.sh @@ -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 diff --git a/root/etc/systemd/system/ipmi/ipmi-static.service b/root/etc/systemd/system/ipmi/ipmi-static.service new file mode 100644 index 0000000..9588c2a --- /dev/null +++ b/root/etc/systemd/system/ipmi/ipmi-static.service @@ -0,0 +1,9 @@ +[Unit] +Description=Set fan speed + +[Service] +Type=simple +ExecStart=/home/balrog/Scripts/ipmi-static.sh + +[Install] +WantedBy=multi-user.target diff --git a/root/etc/systemd/system/ipmi/ipmi-temp.service b/root/etc/systemd/system/ipmi/ipmi-temp.service new file mode 100644 index 0000000..fc231cb --- /dev/null +++ b/root/etc/systemd/system/ipmi/ipmi-temp.service @@ -0,0 +1,9 @@ +[Unit] +Description=Watch server temperature + +[Service] +Type=simple +ExecStart=/home/balrog/Scripts/ipmi-temp.sh + +[Install] +WantedBy=multi-user.target diff --git a/root/etc/systemd/system/ipmi/ipmi-temp.timer b/root/etc/systemd/system/ipmi/ipmi-temp.timer new file mode 100644 index 0000000..d6605b1 --- /dev/null +++ b/root/etc/systemd/system/ipmi/ipmi-temp.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Watches server temperature + +[Timer] +OnUnitInactiveSec=5s +OnBootSec=5s + +[Install] +WantedBy=timers.target