Added ipmi control scripts

This commit is contained in:
Marko Korhonen 2020-02-14 01:11:23 +02:00
parent 8922ddc658
commit 7fdf22b3bd
4 changed files with 41 additions and 0 deletions

22
home/Scripts/ipmi-static.sh Executable file
View file

@ -0,0 +1,22 @@
#!/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
IPMIUSER=ReekyMarko
IPMIPW={{@@ env['PASS_IPMI'] @@}}
IPMIEK=0000000000000000000000000000000000000000
printf "Activating manual fan speeds! (2160 RPM)"
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK raw 0x30 0x30 0x01 0x00
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW -y $IPMIEK raw 0x30 0x30 0x02 0xff 0x09

17
home/Scripts/ipmi-temp.sh Normal file
View file

@ -0,0 +1,17 @@
#!/bin/bash
IPMIHOST=10.0.0.174
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)
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

@ -6,6 +6,7 @@ export PASS_MUSPY="$(pass entertainment/muspy.com | head -n 1)"
export PASS_ARIA2="$(pass linux/aria2 | head -n 1)"
export PASS_MPD="$(pass linux/mpd | head -n 1)"
export PASS_MPD_ADMIN="$(pass linux/mpd-admin | head -n 1)"
export PASS_IPMI="$(pass reekynet/idrac | head -n 1)"
export ME_FULLNAME="$(pass me | head -n 1)"
export ME_ADDRESS="$(pass me | rg 'address' | cut -d' ' -f2-)"

View file

@ -10,6 +10,7 @@ export PASS_MUSPY="$PASS_MUSPY"
export PASS_ARIA2="$PASS_ARIA2"
export PASS_MPD="$PASS_MPD"
export PASS_MPD_ADMIN="$PASS_MPD_ADMIN"
export PASS_IPMI="$PASS_IPMI"
export ME_FULLNAME="$ME_FULLNAME"
export ME_ADDRESS="$ME_ADDRESS"