Update powerwall.sh
This commit is contained in:
@@ -56,6 +56,7 @@ CHECKTEMP(){
|
|||||||
temp_c=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $2}' | sed -e 's/C//g'); temp_c=${temp_c/ /}
|
temp_c=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $2}' | sed -e 's/C//g'); temp_c=${temp_c/ /}
|
||||||
temp_warn=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $7}' | sed -e 's/C//g'); temp_warn=${temp_warn/ /}
|
temp_warn=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $7}' | sed -e 's/C//g'); temp_warn=${temp_warn/ /}
|
||||||
temp_crit=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g'); temp_crit=${temp_crit/ /}
|
temp_crit=$(echo ${sensordata} | cut -d'p' -f2 | awk '/ / {print $4}' | sed -e 's/C//g'); temp_crit=${temp_crit/ /}
|
||||||
|
echo "HERE: ${SENSOR} - ${vSENSOR// /_}"
|
||||||
reading=$(CHECKTEMPSENSOR ${SENSOR} ${temp_c} ${temp_warn} ${temp_crit} ${vSENSOR// /_})
|
reading=$(CHECKTEMPSENSOR ${SENSOR} ${temp_c} ${temp_warn} ${temp_crit} ${vSENSOR// /_})
|
||||||
c=0; spc=''; spc1=`expr ${cw} - ${#vSENSOR} - 1`; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
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[LightCyan]} ${vSENSOR}${spc}${idsCL[Default]}: ${reading}"
|
||||||
@@ -154,7 +155,7 @@ AVERAGETEMP(){
|
|||||||
if [ "${PW_SENSOR_TYPE[${sensorid}]}" == "esxi" ]; then
|
if [ "${PW_SENSOR_TYPE[${sensorid}]}" == "esxi" ]; then
|
||||||
entityid=($(${mysql_conn} -e "SELECT id FROM servermonitor.entities WHERE BINARY name='${3}' AND sensorid='${sensorid}'"))
|
entityid=($(${mysql_conn} -e "SELECT id FROM servermonitor.entities WHERE BINARY name='${3}' AND sensorid='${sensorid}'"))
|
||||||
entityid=${entityid[1]}
|
entityid=${entityid[1]}
|
||||||
echo "HERE: ${3} - ${entityid}"
|
# echo "HERE: ${3} - ${entityid}"
|
||||||
WHERE="sensorid=${sensorid} AND entity=${entityid}"
|
WHERE="sensorid=${sensorid} AND entity=${entityid}"
|
||||||
else
|
else
|
||||||
WHERE="sensorid=${sensorid}"
|
WHERE="sensorid=${sensorid}"
|
||||||
|
|||||||
Reference in New Issue
Block a user