This commit is contained in:
2024-11-30 12:00:01 -06:00
parent 6f8580f0ed
commit 0c301eec2f
2 changed files with 47 additions and 37 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
VERS='5.3.14e-11292024' VERS='5.3.15-11302024'
NM_BETA=false NM_BETA=false
noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense gui nightlyreview update log betacheck offsite-staticroute-fix ' noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense gui nightlyreview update log betacheck offsite-staticroute-fix '

View File

@@ -474,14 +474,21 @@ STATUS_NODE(){
else else
NCMD="ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip}"; LH='' NCMD="ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip}"; LH=''
fi fi
if [ "${NCMD}" != "" ]; then if [ "${NCMD}" != "" ] && [ ! -f ${STATUSRUN_TMPFOLDER}/.${nip}.* ]; then
checkhost=$(CHECK_HOST ${nip}) checkhost=$(CHECK_HOST ${nip})
[ "${checkhost}" != "false" ] && checkhostssl=$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${nip} echo ok 2>&1) [ "${checkhost}" != "false" ] && checkhostssl=$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${nip} echo ok 2>&1)
elif [ -f ${STATUSRUN_TMPFOLDER}/.${nip}.up ]; then
checkhost=true
checkhostssl=ok
elif [ -f ${STATUSRUN_TMPFOLDER}/.${nip}.down ]; then
checkhost=false
checkhostssl=no
else else
checkhost=true checkhost=true
checkhostssl=ok checkhostssl=ok
fi fi
if [ "${checkhost}" != "false" ] && [ "${checkhostssl}" == "ok" ]; then if [ "${checkhost}" != "false" ] && [ "${checkhostssl}" == "ok" ]; then
if [ ! -f ${STATUSRUN_TMPFOLDER}/.${nip}.up ]; then
[ "${NODETYPE}" != "OFW" ] && cpu_usage=$(${NCMD} "/opt/idssys/defaults/get-data.sh cpu-usage") || cpu_usage="" [ "${NODETYPE}" != "OFW" ] && cpu_usage=$(${NCMD} "/opt/idssys/defaults/get-data.sh cpu-usage") || cpu_usage=""
if [ "${cpu_usage}" != "" ]; then if [ "${cpu_usage}" != "" ]; then
if [ "${NM_HOST_CPULEVELS[${nip}]}" != "" ]; then if [ "${NM_HOST_CPULEVELS[${nip}]}" != "" ]; then
@@ -521,6 +528,8 @@ STATUS_NODE(){
fi fi
fi fi
fi fi
touch ${STATUSRUN_TMPFOLDER}/.${nip}.up
fi
if [ "${STATUS_ACTION}" != "check" ]; then if [ "${STATUS_ACTION}" != "check" ]; then
if ([ "${STATUS_ACTION}" == "report" ] && [ "${2}" == "email" ]) || [ "${STATUS_ACTION}" != "report" ]; then if ([ "${STATUS_ACTION}" == "report" ] && [ "${2}" == "email" ]) || [ "${STATUS_ACTION}" != "report" ]; then
if [ "${NODETYPE}" == "OFW" ]; then if [ "${NODETYPE}" == "OFW" ]; then
@@ -773,6 +782,7 @@ STATUS_NODE(){
else else
[ "${STATUS_ACTION}" != "check" ] && echo -en "\033[K\r ${idsST[Bold]}${idsCL[LightRed]}${NM_HOSTNAMES[${nip}]} [${nip}]${idsST[Reset]}" [ "${STATUS_ACTION}" != "check" ] && echo -en "\033[K\r ${idsST[Bold]}${idsCL[LightRed]}${NM_HOSTNAMES[${nip}]} [${nip}]${idsST[Reset]}"
[ ! -f ${STATUSRUN_TMPFOLDER}/.${nip}.down ] && touch ${STATUSRUN_TMPFOLDER}/.${nip}.down
rm -f ${NM_TMPFOLDER}/${nip}~* rm -f ${NM_TMPFOLDER}/${nip}~*
if [ ! -f ${NM_TMPFOLDER}/${nip}.down ]; then if [ ! -f ${NM_TMPFOLDER}/${nip}.down ]; then
if [ ! -f ${NM_TMPFOLDER}/${nip}.disable ] && ([[ "${nip}" != *"10.2."* ]] || ([[ "${nip}" = *"10.2."* ]] && [ ! -f ${PW_TMPFOLDER}/OFF-vMS-Host1.down ])); then if [ ! -f ${NM_TMPFOLDER}/${nip}.disable ] && ([[ "${nip}" != *"10.2."* ]] || ([[ "${nip}" = *"10.2."* ]] && [ ! -f ${PW_TMPFOLDER}/OFF-vMS-Host1.down ])); then