This commit is contained in:
2025-06-03 20:53:49 -05:00
parent e31e7fdf83
commit b7bf5f5209
4 changed files with 12 additions and 12 deletions

View File

@@ -1,11 +1,11 @@
#!/usr/bin/env bash
VERS='5.5.16-06032025'
VERS='5.5.17-06032025'
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 '
CERT_DAEMON='/opt/certbot/bin/certbot'
SSHCMD='ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1'
SSHCMD='ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1'
declare -i errtime
[ "${NM_FOLDER}" == "" ] && NM_FOLDER=/opt/idssys/nodemgmt

View File

@@ -22,8 +22,8 @@ SINGLE_SERVER_SERVICE_CHECK(){
[ "${stc}" = "pdnsadmin" ] && stc="pdnsadmin.service pdnsadmin.socket"
for nip in "${!hosts}"; do
if [[ "${RUN_NODE_IP}" != *"${nip}"* ]] && [ "$(CHECK_HOST ${nip})" != "false" ]; then
ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} 'systemctl is-active --quiet '${stc}' && /bin/systemctl stop '${stc} >/dev/null 2>&1
ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} '[ -f '${NM_TMPFOLDER}'/.singleserver.'${1^^}'.primary ] && rm -f '${NM_TMPFOLDER}'/.singleserver.'${1^^}'.primary' >/dev/null 2>&1
${SSHCMD} root@${nip} 'systemctl is-active --quiet '${stc}' && /bin/systemctl stop '${stc} >/dev/null 2>&1
${SSHCMD} root@${nip} '[ -f '${NM_TMPFOLDER}'/.singleserver.'${1^^}'.primary ] && rm -f '${NM_TMPFOLDER}'/.singleserver.'${1^^}'.primary' >/dev/null 2>&1
fi
done
done

View File

@@ -517,18 +517,18 @@ STATUS_NODE(){
fi
if [ "${NCMD}" != "" ] && [ ! -f ${STATUSRUN_TMPFOLDER}/.${nip}.* ]; then
checkhost=$(CHECK_HOST ${nip})
[ "${checkhost}" != "false" ] && checkhostssl=$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${nip} echo ok 2>&1)
[ "${checkhost}" != "false" ] && checkhostssh=$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${nip} echo ok 2>&1)
elif [ -f ${STATUSRUN_TMPFOLDER}/.${nip}.up ]; then
checkhost=true
checkhostssl=ok
checkhostssh=ok
elif [ -f ${STATUSRUN_TMPFOLDER}/.${nip}.down ]; then
checkhost=false
checkhostssl=no
checkhostssh=no
else
checkhost=true
checkhostssl=ok
checkhostssh=ok
fi
if [ "${checkhost}" != "false" ] && [ "${checkhostssl}" == "ok" ]; then
if [ "${checkhost}" != "false" ] && [ "${checkhostssh}" == "ok" ]; then
if [ ! -f ${STATUSRUN_TMPFOLDER}/.${nip}.up ]; then
# [ "${NODETYPE}" != "OFW" ] && cpu_usage=$(${NCMD} "/opt/idssys/defaults/get-data.sh cpu-usage") || cpu_usage=""
# if [ "${cpu_usage}" != "" ]; then
@@ -877,7 +877,7 @@ STATUS_NODE(){
fi
fi
# SENDNOTICE "${NM_HOSTNAMES[${nip}]}[${nip}]" "${NM_HOSTNAMES[${nip}]}[${nip}] is down" 1
[ "${checkhostssl}" != "ok" ] && echo "$(date +%Y-%m-%d-%H-%M-%S) - ${nip} - ${NM_HOSTNAMES[${nip}]}[${nip}] - Node is down" >> ${NM_LOGFILE}
[ "${checkhostssh}" != "ok" ] && echo "$(date +%Y-%m-%d-%H-%M-%S) - ${nip} - ${NM_HOSTNAMES[${nip}]}[${nip}] - Node is down" >> ${NM_LOGFILE}
else
#if [ ! -f ${NM_TMPFOLDER}/${nip}.disable ] && ([ "${nip}" = "10.2.1.5" ] || [[ "${nip}" != *"10.2."* ]] || ([[ "${nip}" = *"10.2."* ]] && [ ! -f ${PW_TMPFOLDER}/OFF-vMS-Host1.down ])) && [ ! -f ${NM_TMPFOLDER}/${nip}.errtime ] && [ $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/${nip}.down)) -gt 60 ]; then
if [ ! -f ${NM_TMPFOLDER}/${nip}.disable ] && [ ! -f ${NM_TMPFOLDER}/${nip}.errtime ] && [ $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/${nip}.down)) -gt 60 ]; then

View File

@@ -401,7 +401,7 @@ NODEUPDATE(){
else
noup=0
fi
NCMD="ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip}"
NCMD="${SSHCMD} root@${nip}"
NODE="${NM_HOSTNAMES[${nip}]} [${nip}]"
tmpfile=/tmp/.nodeupdate.${NM_HOSTNAMES[${nip}]// /-}
@@ -1271,7 +1271,7 @@ LIST_SKIPPED_SERVERS(){
GETSKIP(){
nip="${1}"
NCMD="ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip}"
NCMD="${SSHCMD} root@${nip}"
if [ "${2}" == "" ]; then
NODE="${NM_HOSTNAMES[${nip}]} [${nip}]"