This commit is contained in:
2024-05-09 09:09:31 -05:00
parent 2a787aa34c
commit a81db14a28
3 changed files with 4 additions and 3 deletions

View File

@@ -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

View File

@@ -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}]})

View File

@@ -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