From 43af1e63ea2310bb36a7287aeca64585d6934f73 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Mon, 17 Feb 2020 13:22:21 +0200 Subject: [PATCH] Echo ipmi temp to /tmp for use in home assistant --- home/Scripts/ipmi-auto.sh | 9 +++++++++ home/Scripts/ipmi-static.sh | 14 +------------- home/Scripts/ipmi-temp.sh | 4 +++- 3 files changed, 13 insertions(+), 14 deletions(-) create mode 100755 home/Scripts/ipmi-auto.sh diff --git a/home/Scripts/ipmi-auto.sh b/home/Scripts/ipmi-auto.sh new file mode 100755 index 0000000..60b7518 --- /dev/null +++ b/home/Scripts/ipmi-auto.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +IPMIHOST=10.0.0.82 +IPMIUSER=ReekyMarko +IPMIPW={{@@ env['PASS_IPMI'] @@}} +IPMIEK=0000000000000000000000000000000000000000 + +printf "Activating dynamic fan control." +ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK raw 0x30 0x30 0x01 0x01 diff --git a/home/Scripts/ipmi-static.sh b/home/Scripts/ipmi-static.sh index f06d66b..e82c3a6 100755 --- a/home/Scripts/ipmi-static.sh +++ b/home/Scripts/ipmi-static.sh @@ -1,18 +1,6 @@ #!/usr/bin/env bash -# ---------------------------------------------------------------------------------- -# Script for setting manual fan speed to 2160 RPM (on my R710) -# -# Requires: -# ipmitool – apt-get install ipmitool -# slacktee.sh – https://github.com/course-hero/slacktee -# ---------------------------------------------------------------------------------- - - -# IPMI SETTINGS: -# Modify to suit your needs. -# DEFAULT IP: 192.168.0.120 -IPMIHOST=10.0.0.174 +IPMIHOST=10.0.0.82 IPMIUSER=ReekyMarko IPMIPW={{@@ env['PASS_IPMI'] @@}} IPMIEK=0000000000000000000000000000000000000000 diff --git a/home/Scripts/ipmi-temp.sh b/home/Scripts/ipmi-temp.sh index fb693ae..b25f111 100755 --- a/home/Scripts/ipmi-temp.sh +++ b/home/Scripts/ipmi-temp.sh @@ -1,12 +1,14 @@ #!/bin/bash -IPMIHOST=10.0.0.174 +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