This commit is contained in:
2024-05-02 21:56:36 -05:00
parent 4a5567bee2
commit 9be1070262
3 changed files with 6 additions and 7 deletions

View File

@@ -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=$(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` SVRRM_AMP=`echo "scale=2; ${SVRRM_AMP}/100" | bc`
AIRCON_INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR}:8888/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps') AIRCON_INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR['ServerRoom-AC']}: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=$(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_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') 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}" ${mysql_conn} -e "USE servermonitor; ${QRY}"
fi fi
AIRCON_INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR}:8888/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps') AIRCON_INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR['ServerRoom-AC']}:8888/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps')
if [ "${AIRCON_INFO}" != "" ]; then if [ "${AIRCON_INFO}" != "" ]; then
AIRCON_AMP=$(echo "${AIRCON_INFO}" | grep '"18":' | cut -d' ' -f 4 | sed 's/,//g') 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_AMP=$(ROUND_NUMBER $(echo "scale=3; ${AIRCON_AMP}/1000" | bc -l) 2)

View File

@@ -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=$(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` SVRRM_AMP=`echo "scale=2; ${SVRRM_AMP}/100" | bc`
AIRCON_INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR}:8888/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps') AIRCON_INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR['ServerRoom-AC']}:8888/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps')
if [ "${AIRCON_INFO}" != "" ]; then if [ "${AIRCON_INFO}" != "" ]; then
AIRCON_AMP=$(echo "${AIRCON_INFO}" | grep '"18":' | cut -d' ' -f 4 | sed 's/,//g') 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_AMP=$(ROUND_NUMBER $(echo "scale=3; ${AIRCON_AMP}/1000" | bc -l) 2)
@@ -950,7 +950,7 @@ POWERLOGGER_SERVICE(){
${mysql_conn} -e "USE servermonitor; ${QRY}" ${mysql_conn} -e "USE servermonitor; ${QRY}"
fi fi
AIRCON_INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR}:8888/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps') AIRCON_INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR['ServerRoom-AC']}:8888/status/${PW_SENSOR_DEVICEID['ServerRoom-AC']} | jq '.dps')
if [ "${AIRCON_INFO}" != "" ]; then if [ "${AIRCON_INFO}" != "" ]; then
AIRCON_AMP=$(echo "${AIRCON_INFO}" | grep '"18":' | cut -d' ' -f 4 | sed 's/,//g') 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_AMP=$(ROUND_NUMBER $(echo "scale=3; ${AIRCON_AMP}/1000" | bc -l) 2)
@@ -1214,8 +1214,7 @@ OFFSITE_SENDPOWER(){
} }
GET_TUYA_POWER(){ GET_TUYA_POWER(){
INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR}:8888/status/${PW_SENSOR_DEVICEID[${1}]} | jq '.dps') INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR[${1}]}:8888/status/${PW_SENSOR_DEVICEID[${1}]} | jq '.dps')
echo "HERE: 'http://${PW_REMOTE_SENSOR}:8888/status/${PW_SENSOR_DEVICEID[${1}]}' = ${INFO}"
if [ "${INFO}" != "" ]; then if [ "${INFO}" != "" ]; then
WATT=-1 WATT=-1
if [ "$(echo "${INFO}" | grep '"18":')" != "" ]; then if [ "$(echo "${INFO}" | grep '"18":')" != "" ]; then

View File

@@ -1502,7 +1502,7 @@ GET_DEFAULT_FANSPEED(){
} }
GET_TUYA_TEMP(){ GET_TUYA_TEMP(){
INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR}:8888/status/${PW_SENSOR_DEVICEID[${1}]} | jq '.dps') INFO=$(curl -m 3 -s http://${PW_REMOTE_SENSOR${1}}:8888/status/${PW_SENSOR_DEVICEID[${1}]} | jq '.dps')
if [ "${INFO}" != "" ]; then if [ "${INFO}" != "" ]; then
TEMP=-1 TEMP=-1
if [ "$(echo "${INFO}" | grep '"108":')" != "" ]; then if [ "$(echo "${INFO}" | grep '"108":')" != "" ]; then