diff --git a/inc/power.inc.sh b/inc/power.inc.sh index 42e9cd15..98a3a7aa 100644 --- a/inc/power.inc.sh +++ b/inc/power.inc.sh @@ -8,11 +8,11 @@ AVERAGEPOWER(){ total_watt=0 while IFS=$'\t' read date amp watt ;do echo "HERE: '${amp}'" - if [ "${amp}" != "" ] && [ "${amp}" != "null" ]; then + if [ "${amp}" != "" ] && [ "${amp}" != "NULL" ]; then total_amp=$(bc <<< "scale=2; ${total_amp}+${amp}") ((logsfound_amp++)) fi - if [ "${watt}" != "" ] && [ "${watt}" != "null" ]; then + if [ "${watt}" != "" ] && [ "${watt}" != "NULL" ]; then total_watt=$(bc <<< "scale=2; ${total_watt}+${watt}") ((logsfound_watt++)) fi @@ -344,8 +344,8 @@ CHECKPOWER(){ # if [ ${HOST_WATTS} -gt 0 ]; then if [ "${avgdays}" != "" ] && [ ${HOST_WATTS} -ne -2 ] && [ "${SENSOR}" != "iDS-vMS-Host6" ]; then echo -en "${idsCL[LightYellow]} Calculating average ...${idsCL[Default]}" - AVERAGEPOWER ${PW_POWERSENSOR_ID[${SENSOR}]} ${avgdays} both - # average=$(AVERAGEPOWER ${PW_POWERSENSOR_ID[${SENSOR}]} ${avgdays} both) + # AVERAGEPOWER ${PW_POWERSENSOR_ID[${SENSOR}]} ${avgdays} both + average=$(AVERAGEPOWER ${PW_POWERSENSOR_ID[${SENSOR}]} ${avgdays} both) average_amp=$(echo ${average} | cut -d'~' -f 1) average_watt=$(echo ${average} | cut -d'~' -f 2) average_disp="${idsCL[LightYellow]} ${average_amp}'amps - `IDS_NUMBER_FORMAT ${average_watt} 0`'watts"