This commit is contained in:
2023-12-04 08:20:54 -06:00
parent a87bb7b56d
commit 936a91b9e8
2 changed files with 6 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
VERS='2.3.340-12032023'
VERS='2.3.341-12042023'
noheader=' update service dailytemp '

View File

@@ -111,7 +111,7 @@ 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
if [ "${6}" != "noavg" ] && [ "${PW_SENSOR_TYPE[${1}]}" != "cpu" ]; then
if [ "${6}" != "noavg" ]; then
[ "${6}" != "" ] && [[ "${6}" =~ ^[0-9]+$ ]] && avgdays=${6} || avgdays=3
if [ "${PW_SENSOR_TYPE[${1}]}" != "esxi" ]; then
average=$(AVERAGETEMP ${PW_SENSOR_ID[${1}]} ${avgdays})
@@ -156,7 +156,7 @@ CHECKTEMPSENSOR(){
# echo -en ""
c=0; spct=''; spc1=`expr 6 - ${#temp_f}`; until [ ${c} = ${spc1} ]; do spct="${spct} "; c=`expr ${c} + 1`; done
if [ "${average}" != "" ] && [ "${PW_SENSOR_TYPE[${1}]}" != "cpu" ]; then
if [ "${average}" != "" ]; then
c=0; spca=''; spc1=`expr 6 - ${#average}`; until [ ${c} = ${spc1} ]; do spca="${spca} "; c=`expr ${c} + 1`; done
if [ "${average}" == "" ]; then
averagedisp="${idsCL[Green]}"
@@ -170,11 +170,11 @@ CHECKTEMPSENSOR(){
fi
if [ $(bc -l <<< "${temp_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit}") -eq 1 ]; then
([ "${average}" != "" ] && [ "${PW_SENSOR_TYPE[${1}]}" != "cpu" ]) && echo -en "${idsCL[Yellow]}WARNING ${spct}${temp_f}'F /${spca}${averagedisp}${idsCL[Default]}" || echo -en "${idsCL[Yellow]}WARNING ${spct}${temp_f}"
[ "${average}" != "" ] && echo -en "${idsCL[Yellow]}WARNING ${spct}${temp_f}'F /${spca}${averagedisp}${idsCL[Default]}" || echo -en "${idsCL[Yellow]}WARNING ${spct}${temp_f}"
elif [ $(bc -l <<< "${temp_f} >= ${temp_crit}") -eq 1 ]; then
([ "${average}" != "" ] && [ "${PW_SENSOR_TYPE[${1}]}" != "cpu" ]) && echo -en "${idsCL[Red]}CRITICAL${spct}${temp_f}'F /${spca}${averagedisp}${idsCL[Default]}" || echo -en "${idsCL[Red]}CRITICAL${spct}${temp_f}"
[ "${average}" != "" ] && echo -en "${idsCL[Red]}CRITICAL${spct}${temp_f}'F /${spca}${averagedisp}${idsCL[Default]}" || echo -en "${idsCL[Red]}CRITICAL${spct}${temp_f}"
else
([ "${average}" != "" ] && [ "${PW_SENSOR_TYPE[${1}]}" != "cpu" ]) && echo -en "${idsCL[Green]}Normal ${spct}${temp_f}'F /${spca}${averagedisp}${idsCL[Default]}" || echo -en "${idsCL[Green]}Normal ${spct}${temp_f}"
[ "${average}" != "" ] && echo -en "${idsCL[Green]}Normal ${spct}${temp_f}'F /${spca}${averagedisp}${idsCL[Default]}" || echo -en "${idsCL[Green]}Normal ${spct}${temp_f}"
fi
[ "${PW_SENSOR_TYPE[${1}]}" == "cpu" ] && echo -en "%${idsCL[Default]}" || echo -en "'F${idsCL[Default]}"