update
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
VERS='2.7.123b-11092024'
|
VERS='2.7.123d-11092024'
|
||||||
|
|
||||||
noheader=' update service dailytemp confsync -r -report test '
|
noheader=' update service dailytemp confsync -r -report test '
|
||||||
|
|
||||||
@@ -104,7 +104,6 @@ ${SN_MSG}
|
|||||||
|
|
||||||
$(date)" "${SN_TIT}" ${3} ${4} &
|
$(date)" "${SN_TIT}" ${3} ${4} &
|
||||||
else
|
else
|
||||||
# echo "HERE: [${SN_TIT}]=${SN_MSG}: DONE"
|
|
||||||
PUSH_TO_MOBILE "${SN_MSG}
|
PUSH_TO_MOBILE "${SN_MSG}
|
||||||
|
|
||||||
$(date)" "${SN_TIT}" ${3} ${4} &
|
$(date)" "${SN_TIT}" ${3} ${4} &
|
||||||
|
|||||||
@@ -850,7 +850,7 @@ OFFSITE_CHECKPOWER_SERVICE(){
|
|||||||
|
|
||||||
PW_OFFSITEHOSTS=$(echo ${PW_OFFSITE_HOSTS} | tr ',' ' ')
|
PW_OFFSITEHOSTS=$(echo ${PW_OFFSITE_HOSTS} | tr ',' ' ')
|
||||||
[ "${TEST_OFFSITE}" != "" ] && TEST=${TEST_OFFSITE} || TEST=''
|
[ "${TEST_OFFSITE}" != "" ] && TEST=${TEST_OFFSITE} || TEST=''
|
||||||
echo "HERE: '${TEST_OFFSITE}' '${TEST}'"
|
|
||||||
if [ "${TEST}" != "" ]; then
|
if [ "${TEST}" != "" ]; then
|
||||||
PW_OFFSITE_SHUTDOWNSERVERS_AT_LOAD=95 #percent
|
PW_OFFSITE_SHUTDOWNSERVERS_AT_LOAD=95 #percent
|
||||||
PW_OFFSITE_SHUTDOWNSERVERS_AFTER=1 #minutes
|
PW_OFFSITE_SHUTDOWNSERVERS_AFTER=1 #minutes
|
||||||
@@ -861,8 +861,7 @@ OFFSITE_CHECKPOWER_SERVICE(){
|
|||||||
else
|
else
|
||||||
TESTMODE=""
|
TESTMODE=""
|
||||||
fi
|
fi
|
||||||
echo "testmode: ${TESTMODE}"
|
|
||||||
|
|
||||||
# upsinfo=$(upsc CP1500PFCLCD)
|
# upsinfo=$(upsc CP1500PFCLCD)
|
||||||
upsinfo=$(upsc CP1500PFCLCD 2>&1)
|
upsinfo=$(upsc CP1500PFCLCD 2>&1)
|
||||||
if [ "$(echo "${upsinfo}" | grep 'input.voltage:' | sed 's/.*: //')" != "" ]; then
|
if [ "$(echo "${upsinfo}" | grep 'input.voltage:' | sed 's/.*: //')" != "" ]; then
|
||||||
|
|||||||
@@ -119,9 +119,7 @@ CHECKTEMP(){
|
|||||||
[ ${DETAILS} -eq 0 ] && [ "${last_sensor%%-*}" == "${SENSOR%%-*}" ] && [ "${last_sensor}" != "Offsite-ServerRoom" ] && [ "${last_sensor}" != "Powerwall-Switch" ] && echo -en "\033[1A"
|
[ ${DETAILS} -eq 0 ] && [ "${last_sensor%%-*}" == "${SENSOR%%-*}" ] && [ "${last_sensor}" != "Offsite-ServerRoom" ] && [ "${last_sensor}" != "Powerwall-Switch" ] && echo -en "\033[1A"
|
||||||
c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR_DESC}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; ((c++)); done
|
c=0; spc=''; spc1=`expr ${cw} - ${#SENSOR_DESC}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; ((c++)); done
|
||||||
echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR_DESC}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Pulling data ... "
|
echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR_DESC}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Pulling data ... "
|
||||||
|
|
||||||
echo "HERE: '${PW_TMPFOLDER}/${SENSOR}.down'"
|
|
||||||
|
|
||||||
if [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then
|
if [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then
|
||||||
IFS=: read -r temp_f temp_h <<< $(CHECKTEMPSENSOR ${SENSOR}); unset IFS
|
IFS=: read -r temp_f temp_h <<< $(CHECKTEMPSENSOR ${SENSOR}); unset IFS
|
||||||
if [ "${temp_f}" != "timeout" ] && [ "${temp_f}" != "offline" ]; then
|
if [ "${temp_f}" != "timeout" ] && [ "${temp_f}" != "offline" ]; then
|
||||||
@@ -745,9 +743,7 @@ CHECKTEMPSENSOR(){
|
|||||||
fi
|
fi
|
||||||
(( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}"
|
(( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}"
|
||||||
fi
|
fi
|
||||||
# echo "HERE: '${temp_c}' -> '${temp_f}'"
|
|
||||||
# echo -en ""
|
|
||||||
|
|
||||||
echo "${temp_f}:${temp_h}"
|
echo "${temp_f}:${temp_h}"
|
||||||
|
|
||||||
elif [ ${TIMEOUT} -eq 1 ]; then
|
elif [ ${TIMEOUT} -eq 1 ]; then
|
||||||
@@ -1022,12 +1018,9 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
|
|||||||
[ ! -f ${PW_TMPFOLDER}/.lasttemp/${SENSOR} ] && echo 0 > ${PW_TMPFOLDER}/.lasttemp/${SENSOR}
|
[ ! -f ${PW_TMPFOLDER}/.lasttemp/${SENSOR} ] && echo 0 > ${PW_TMPFOLDER}/.lasttemp/${SENSOR}
|
||||||
last_temp=$(cat ${PW_TMPFOLDER}/.lasttemp/${SENSOR})
|
last_temp=$(cat ${PW_TMPFOLDER}/.lasttemp/${SENSOR})
|
||||||
|
|
||||||
# [ "${SENSORa}" == "ServerRoomTemp" ] && echo "HERE: [${SENSOR//-/}] - ${last_temp} - ${temp_c} - ${temp_f} - ${temp_warn} - ${temp_crit} - ${temp_crit_sys}"
|
|
||||||
|
|
||||||
logtemp=${PW_LOGFOLDER}/log-temp-${SENSOR}
|
logtemp=${PW_LOGFOLDER}/log-temp-${SENSOR}
|
||||||
if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ] && [ "${temp_c}" != "unavailable" ] && [ "${temp_c}" != "unknown" ] && [ "${temp_h}" != "0" ]; then
|
if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ] && [ "${temp_c}" != "unavailable" ] && [ "${temp_c}" != "unknown" ] && [ "${temp_h}" != "0" ]; then
|
||||||
|
|
||||||
|
|
||||||
if [ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] || [ -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then
|
if [ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] || [ -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then
|
||||||
if [ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] || [ -f ${PW_TMPFOLDER}/${SENSOR}.restart ]; then
|
if [ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] || [ -f ${PW_TMPFOLDER}/${SENSOR}.restart ]; then
|
||||||
SENDNOTICE "${SENSOR} Data" "${SENSOR} is reporting data again"
|
SENDNOTICE "${SENSOR} Data" "${SENSOR} is reporting data again"
|
||||||
@@ -1062,10 +1055,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
|
|||||||
fi
|
fi
|
||||||
(( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}"
|
(( $(bc <<<"${temp_f} < 1") )) && [[ "${temp_f}" = *"."* ]] && temp_f="0${temp_f}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# echo "HERE: [${SENSOR//-/}] - ${last_temp} - ${temp_c} - ${temp_f} - ${temp_warn} - ${temp_crit} - ${temp_crit_sys}"
|
|
||||||
# [ ! "${temp_c}" ] || [ ! "${temp_f}" ] || [ ! "${temp_warn}" ] || [ ! "${temp_crit}" ] || [ ! "${temp_crit_sys}" ] && echo "VALUE NOT FOUND"
|
|
||||||
|
|
||||||
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" != "esxi" ]; then
|
if [ "${PW_SENSOR_TYPE[${SENSORa}]}" != "esxi" ]; then
|
||||||
echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 1 | read temp_warn
|
echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 1 | read temp_warn
|
||||||
echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 2 | read temp_crit
|
echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 2 | read temp_crit
|
||||||
|
|||||||
Reference in New Issue
Block a user