From 26ea7e71da4a522c8e23b20775c692fa2ab2418b Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 4 Dec 2023 16:08:17 -0600 Subject: [PATCH] update --- defaults.inc | 19 ++++++++++--------- offsite-power-check.sh | 2 +- powerwall.sh | 18 +++++++++--------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/defaults.inc b/defaults.inc index c8195f71..178c7230 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,5 +1,5 @@ -VERS='2.3.348-12042023' +VERS='2.3.400-12042023' noheader=' update service dailytemp ' @@ -32,14 +32,15 @@ PW_POWERWALL_SERVICES['temp']='monitor-temp' PW_POWERWALL_SERVICES['power']='monitor-power' PW_POWERWALL_SERVICES['powerlogger']='monitor-powerlogger' -declare -A PW_TEMP_THRESHOLDS -# PW_TEMP_THRESHOLDS['ServerRoomTH']="72,74,76" #TEST1 -# PW_TEMP_THRESHOLDS['ServerRoomTH']="83,88,95" #Normal broken -PW_TEMP_THRESHOLDS['ServerRoomTH']="80,85,91" #Normal -4 -PW_TEMP_THRESHOLDS['Powerwall-CPU']="122,131,176" -PW_TEMP_THRESHOLDS['Powerwall-CPU-Usage']="40,80,90" -PW_TEMP_THRESHOLDS['OctoPi-CPU']="122,131,176" -PW_TEMP_THRESHOLDS['OctoPi-CPU-Usage']="40,80,90" +declare -A PW_THRESHOLDS +# PW_THRESHOLDS['ServerRoomTH']="72,74,76" #TEST1 +# PW_THRESHOLDS['ServerRoomTH']="83,88,95" #Normal broken +PW_THRESHOLDS['ServerRoomTH']="80,85,91" #Normal -4 +PW_THRESHOLDS['Powerwall-CPU']="122,131,176" +PW_THRESHOLDS['Powerwall-CPU-Usage']="40,80,90" +PW_THRESHOLDS['OctoPi-CPU']="122,131,176" +PW_THRESHOLDS['OctoPi-CPU-Usage']="40,80,90" +PW_THRESHOLDS['OFF-vMS-Host1-FanSpeed']="6360,11040,16080" PW_ServerRoomTH_Dev='-1' diff --git a/offsite-power-check.sh b/offsite-power-check.sh index eef023d4..324422bc 100755 --- a/offsite-power-check.sh +++ b/offsite-power-check.sh @@ -55,7 +55,7 @@ PWO_START(){ SENDNOTICE(){ MESSAGE="${TESTMODE}${2} -BATTERY CHARGE: ${OFFSITE_BATT_CAP}'% +BATTERY CHARGE: ${OFFSITE_BATT_CAP}'%25 BATT RUNTIME: ${OFFSITE_BATT_RUNTIME}'mins AC VOLTAGE: ${OFFSITE_VOLTIN}'volts" if [ "${3}" = "1" ]; then PRIORITY="${3}"; MSGSOUND=siren; elif [ "${3}" != "" ]; then PRIORITY=${3}; else PRIORITY=0; fi diff --git a/powerwall.sh b/powerwall.sh index eb716098..67dec488 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -101,8 +101,8 @@ CHECKTEMP(){ } CHECKTEMPSENSOR(){ - echo ${PW_TEMP_THRESHOLDS[${1}]} | cut -d',' -f 1 | read temp_warn - echo ${PW_TEMP_THRESHOLDS[${1}]} | cut -d',' -f 2 | read temp_crit + echo ${PW_THRESHOLDS[${1}]} | cut -d',' -f 1 | read temp_warn + echo ${PW_THRESHOLDS[${1}]} | cut -d',' -f 2 | read temp_crit [ "${PW_SENSOR_TYPE[${1}]}" == "cpu" ] && GAUGESH="'%" || GAUGESH="'F" if [ "${6}" != "noavg" ]; then @@ -261,10 +261,10 @@ CHECKTEMP_SERVICE(){ fi if [ "${SENSORS_CHECK}" != "" ]; then for SENSOR in "${SENSORS_CHECK[@]}"; do - if [ "${PW_TEMP_THRESHOLDS[${SENSORa}]}" != "" ]; then - echo ${PW_TEMP_THRESHOLDS[${SENSORa}]} | cut -d',' -f 1 | read temp_warn - echo ${PW_TEMP_THRESHOLDS[${SENSORa}]} | cut -d',' -f 2 | read temp_crit - [ "$(echo ${PW_TEMP_THRESHOLDS[${SENSORa}]} | cut -d',' -f 3)" != "" ] && echo ${PW_TEMP_THRESHOLDS[${SENSORa}]} | cut -d',' -f 3 | read temp_crit_sys || temp_crit_sys=${temp_crit} + if [ "${PW_THRESHOLDS[${SENSORa}]}" != "" ]; then + echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 1 | read temp_warn + echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 2 | read temp_crit + [ "$(echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 3)" != "" ] && echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 3 | read temp_crit_sys || temp_crit_sys=${temp_crit} fi if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "mqtt" ]; then @@ -323,9 +323,9 @@ CHECKTEMP_SERVICE(){ # echo "HERE: ${SENSOR} - ${temp_c} - ${temp_f} - ${temp_warn} - ${temp_crit} - ${temp_crit_sys}" if [ "${PW_SENSOR_TYPE[${SENSORa}]}" != "esxi" ]; then - echo ${PW_TEMP_THRESHOLDS[${SENSOR}]} | cut -d',' -f 1 | read temp_warn - echo ${PW_TEMP_THRESHOLDS[${SENSOR}]} | cut -d',' -f 2 | read temp_crit - echo ${PW_TEMP_THRESHOLDS[${SENSOR}]} | cut -d',' -f 3 | read temp_crit_sys + echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 1 | read temp_warn + echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 2 | read temp_crit + echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 3 | read temp_crit_sys fi if [ "${last_temp[${SENSOR}]}" != "" ]; then