Update powerwall.sh

This commit is contained in:
2023-08-14 21:13:17 -05:00
parent 82067535ca
commit e47869ae9a

View File

@@ -20,7 +20,7 @@ CHECKTEMP(){
echo
# echo -e "${idsCL[Yellow]}Sensor Temperature(s) ${idsCL[Green]}normal${idsCL[Default]} /${idsCL[Yellow]}warning${idsCL[Default]}/ ${idsCL[Red]}critical${idsCL[Default]}"
echo -e "${idsCL[Cyan]}Sensor Temperature(s) Current / 3DayAVG ${idsCL[Green]}normal${idsCL[Default]} /${idsCL[Yellow]}warning${idsCL[Default]}/ ${idsCL[Red]}critical${idsCL[Default]}"
DIVIDER . yellow 85
DIVIDER . yellow 90
for SENSOR in ${!PW_SENSOR_ID[@]}; do
if [ "${1}" == "" ] || [[ "${SENSOR}" = *"${1}"* ]]; then
@@ -28,7 +28,7 @@ CHECKTEMP(){
if [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "esxi" ]; then
vHOSTIP=${PW_ESXI_MON_HOSTS[${SENSOR}]}
vHOSTNAME=${PW_ESXI_HOST_NAMES[${vHOSTIP}]}
echo -e "\r\033[K${idsCL[Cyan]}${SENSOR} Host Sensors -${spc}${idsCL[Default]}"
echo -e "\r\033[K${idsCL[LightBlue]}${idsST[Bold]}${SENSOR} Host Sensors ${idsST[Reset]}- ${idsCL[LightCyan]}${PW_ESXI_HOST_NAMES[${vHOSTIP}]}${idsCL[Default]}"
echo -en "${idsCL[Yellow]}Pulling data and calculating averages for '${SENSOR}' ..."
if [ "$(CHECK_HOST ${vHOSTIP})" != "false" ]; then
@@ -43,7 +43,7 @@ CHECKTEMP(){
temp_crit=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g'); temp_crit=${temp_crit/ /}
reading=$(CHECKTEMPSENSOR ${SENSOR} ${temp_c} ${temp_warn} ${temp_crit})
c=0; spc=''; spc1=`expr ${cw} - ${#vSENSOR} - 1`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -e "${idsCL[LightCyan]} ${vSENSOR}${spc}${idsCL[Default]}: ${reading}"
echo -e "${idsCL[LightBlue]} ${vSENSOR}${spc}${idsCL[Default]}: ${reading}"
done
else