This commit is contained in:
2023-12-04 16:08:17 -06:00
parent a80e0621cb
commit 26ea7e71da
3 changed files with 20 additions and 19 deletions

View File

@@ -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'

View File

@@ -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

View File

@@ -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