From a81db14a28f78810d408c49353a5840ae39b9b3d Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 9 May 2024 09:09:31 -0500 Subject: [PATCH] update --- defaults.inc | 1 + inc/status.inc | 2 +- nodemgmt-scripts.sh | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/defaults.inc b/defaults.inc index f2bde415..5cf98663 100755 --- a/defaults.inc +++ b/defaults.inc @@ -108,6 +108,7 @@ fi [ "${NM_BACKUP_FOLDER}" == "" ] && NM_BACKUP_FOLDER=/opt/idssys/backups NM_SCRIPT=${NM_FOLDER}/nodemgmt-scripts.sh NM_TMPFOLDER=${NM_FOLDER}/.tmp +PW_TMPFOLDER=${NM_TMPFOLDER}/powerwall [ "${NM_LOGFOLDER}" == "" ] && NM_LOGFOLDER=${NM_FOLDER}/logs NM_LOGFILE=${NM_LOGFOLDER}/logfile diff --git a/inc/status.inc b/inc/status.inc index c017631b..f65612af 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -260,7 +260,7 @@ STATUS(){ if [ ! -f ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.down ]; then touch ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.down else - if [ ! -f ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.disable ] && ([ -f ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.sent ] && [ $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.sent)) -gt ${NM_RENOTIFY_TIMEOUT} ]) || ([ ! -f ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.sent ] && [ $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.down)) -gt 60 ]); then + if [ ! -f ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.disable ] && ([[ "${nip}" != *"10.2."* ]] || [ ! -f ${PW_TMPFOLDER}/OFF-vMS-Host6.down ]) && ([ -f ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.sent ] && [ $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.sent)) -gt ${NM_RENOTIFY_TIMEOUT} ]) || ([ ! -f ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.sent ] && [ $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.down)) -gt 60 ]); then [ ! -f ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.errtime ] && mv ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.down ${NM_TMPFOLDER}/${nip}~${rcheck}.repl.errtime echo "$(date +%Y-%m-%d-%H-%M-%S) - ${nip} - ${NM_HOSTNAMES[${nip}]}[${nip}] - (${NM_REPL_DESC[${rcheck}]}) Replicated folder timeout, it is not syncing" >> ${NM_LOGFILE} SENDNOTICE "Repl-Timeout-'${NM_HOSTNAMES[${nip}]}[${nip}]'" "${NM_REPL_DESC[${rcheck}]} (${NM_REPL_CHECK_LOC[${rcheck}]}) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 1f04094e..d854dc8a 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -800,7 +800,7 @@ RUN_COMMAND(){ DOWNLIST(){ declare -i cw; declare -i spc1; declare -i c - DOWN_LIST=`find ${NM_TMPFOLDER}/ -iname "*.down"` + DOWN_LIST=`find -maxdepth 1 ${NM_TMPFOLDER}/ -iname "*.down"` IFS=$'\n'; read -rd '' -a DOWN_LIST <<<"${DOWN_LIST}"; unset IFS if [ "${1}" == "report" ]; then unset idsCL idsBG idsST @@ -918,7 +918,7 @@ DOWNLIST(){ fi [ ${is} -lt 10 ] && ignsel=" ${is}) " || ignsel="${is}) " - [ -f ${NM_TMPFOLDER}/${ditem}.disable ] && dstatus="OFF" || dstatus="${idsCL[Green]}ON" + ([ -f ${NM_TMPFOLDER}/${ditem}.disable ] || ([[ "${nip}" = *"10.2."* ]] && [ -f ${PW_TMPFOLDER}/OFF-vMS-Host6.down ])) && dstatus="OFF" || dstatus="${idsCL[Green]}ON" c=0; spc3=''; until [ $c = `expr 26 - ${#time}` ]; do spc3="${spc3} "; ((c++)); done echo -e "\033[K${idsCL[LightRed]}${idsST[Bold]}${ignsel}${idsST[Reset]}${idsCL[LightRed]}${itemtype}${spca}${itemname}${spc}${host}${spc2}${time}${spc3}${dstatus}${idsCL[Default]}" fi