diff --git a/defaults.inc b/defaults.inc index d081584f..7ec9776a 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='2.7.25-05012024' +VERS='2.7.26-05022024' noheader=' update service dailytemp confsync -r -report ' diff --git a/inc/power.inc.bak.sh b/inc/power.inc.bak.sh index b49a9421..691061f5 100644 --- a/inc/power.inc.bak.sh +++ b/inc/power.inc.bak.sh @@ -167,7 +167,7 @@ CHECKPOWER(){ SVRRM_AMP=$(snmpwalk -t 1 -r 0 -v 1 -c public ${PW_UPS_IP} iso.3.6.1.4.1.850.1.1.3.1.3.3.2.1.3.1.1 | sed 's/.*: //') SVRRM_AMP=`echo "scale=2; ${SVRRM_AMP}/100" | bc` - AIRCON_INFO=$(curl -m 3 -s http://${PW_TUYA_API}/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps') + AIRCON_INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR}:8888/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps') AIRCON_AMP=$(echo "${AIRCON_INFO}" | grep '"18":' | cut -d' ' -f 4 | sed 's/,//g') AIRCON_AMP=$(ROUND_NUMBER $(echo "scale=3; ${AIRCON_AMP}/1000" | bc -l) 2) AIRCON_WATT=$(echo "${AIRCON_INFO}" | grep '"19":' | cut -d' ' -f 4 | sed 's/,//g') @@ -835,7 +835,7 @@ POWERLOGGER_SERVICE(){ ${mysql_conn} -e "USE servermonitor; ${QRY}" fi - AIRCON_INFO=$(curl -m 3 -s http://${PW_TUYA_API}/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps') + AIRCON_INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR}:8888/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps') if [ "${AIRCON_INFO}" != "" ]; then AIRCON_AMP=$(echo "${AIRCON_INFO}" | grep '"18":' | cut -d' ' -f 4 | sed 's/,//g') AIRCON_AMP=$(ROUND_NUMBER $(echo "scale=3; ${AIRCON_AMP}/1000" | bc -l) 2) diff --git a/inc/power.inc.sh b/inc/power.inc.sh index 531a557b..892f828a 100644 --- a/inc/power.inc.sh +++ b/inc/power.inc.sh @@ -139,7 +139,7 @@ CHECKPOWER(){ SVRRM_AMP=$(snmpwalk -t 1 -r 0 -v 1 -c public ${PW_UPS_IP} iso.3.6.1.4.1.850.1.1.3.1.3.3.2.1.3.1.1 | sed 's/.*: //') SVRRM_AMP=`echo "scale=2; ${SVRRM_AMP}/100" | bc` - AIRCON_INFO=$(curl -m 3 -s http://${PW_TUYA_API}/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps') + AIRCON_INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR}:8888/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps') if [ "${AIRCON_INFO}" != "" ]; then AIRCON_AMP=$(echo "${AIRCON_INFO}" | grep '"18":' | cut -d' ' -f 4 | sed 's/,//g') AIRCON_AMP=$(ROUND_NUMBER $(echo "scale=3; ${AIRCON_AMP}/1000" | bc -l) 2) @@ -950,7 +950,7 @@ POWERLOGGER_SERVICE(){ ${mysql_conn} -e "USE servermonitor; ${QRY}" fi - AIRCON_INFO=$(curl -m 3 -s http://${PW_TUYA_API}/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps') + AIRCON_INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR}:8888/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps') if [ "${AIRCON_INFO}" != "" ]; then AIRCON_AMP=$(echo "${AIRCON_INFO}" | grep '"18":' | cut -d' ' -f 4 | sed 's/,//g') AIRCON_AMP=$(ROUND_NUMBER $(echo "scale=3; ${AIRCON_AMP}/1000" | bc -l) 2) @@ -1214,7 +1214,7 @@ OFFSITE_SENDPOWER(){ } GET_TUYA_POWER(){ - INFO=$(curl -m 3 -s http://${PW_TUYA_API}/status/${PW_SENSOR_DEVICEID[${1}]} | jq '.dps') + INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR}:8888/status/${PW_SENSOR_DEVICEID[${1}]} | jq '.dps') if [ "${INFO}" != "" ]; then WATT=-1 if [ "$(echo "${INFO}" | grep '"18":')" != "" ]; then diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 71575475..50ee7115 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -1502,7 +1502,7 @@ GET_DEFAULT_FANSPEED(){ } GET_TUYA_TEMP(){ - INFO=$(curl -m 3 -s http://${PW_TUYA_API}/status/${PW_SENSOR_DEVICEID[${1}]} | jq '.dps') + INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR}:8888/status/${PW_SENSOR_DEVICEID[${1}]} | jq '.dps') if [ "${INFO}" != "" ]; then TEMP=-1 if [ "$(echo "${INFO}" | grep '"108":')" != "" ]; then