From 536bd24438799a15686415b054f57676b053702d Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Thu, 30 Sep 2021 23:32:45 +0200 Subject: move --- check_sensors | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100755 check_sensors (limited to 'check_sensors') diff --git a/check_sensors b/check_sensors deleted file mode 100755 index 8cb1e20..0000000 --- a/check_sensors +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -# °C -WARN=75 -CRIT=85 - -PERFDATA="|" -IS_WARN="false" -IS_CRIT="false" - -TEXT=(OK WARNING CRITICAL UNKOWN) -LEVEL=0 - -DATA=( $(sensors | \ - grep "^Core" | \ - sed -n "s|^Core\s[0-9]\+:\s\++\([0-9]\+\.[0-9]\+\).*$|\1|p" ) ) - -for (( i=0; i<${#DATA[@]}; i++ )); do - (( $(echo "${DATA[$i]} > $WARN" | bc -l ) )) && IS_WARN="true" - (( $(echo "${DATA[$i]} > $CRIT" | bc -l ) )) && IS_CRIT="true" - PERFDATA+=" core_$i=${DATA[$i]}C" -done - -[ $IS_WARN = true ] && LEVEL=1 -[ $IS_CRIT = true ] && LEVEL=2 -[ ${#DATA[@]} -eq 0 ] && LEVEL=3 - -echo "sensors ${TEXT[$LEVEL]}$PERFDATA" - -exit $LEVEL -- cgit v1.2.3