From affd827aa6e51ab321337ef3bde0feae4a73a1bc Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 7 Feb 2019 10:19:42 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 9e0bf184..b916fc30 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -18,6 +18,17 @@ source /opt/idssys/nodemgmt/defaults.inc # ========================================================= # STATUS() { + for nip in "${NODE_HOSTS[@]}"; do + if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]]; then + for rcheck in "${REPL_CHECK[@]}"; do + rm -f ${FOLDER}/test.repl + daterun=`date +%Y-%m-%d-%H-%M` + echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl + yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl + done + fi + done + echo echo -e "${idsCL[Yellow]} Node Service Status${idsCL[Default]}" DIVIDER @@ -59,7 +70,7 @@ STATUS() { echo echo -e "${idsCL[Yellow]} Replication Status${idsCL[Default]}" DIVIDER true - timeout=`date --date='2 minutes' +%s` + timeout=`date --date='40 seconds' +%s` nid=1 for nip in "${NODE_HOSTS[@]}" do @@ -68,13 +79,9 @@ STATUS() { DIVIDER false green for rcheck in "${REPL_CHECK[@]}" do - rm -f ${FOLDER}/test.repl - daterun=`date +%Y-%m-%d-%H-%M` - echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl - yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl declare -i cw; declare -i spc1; declare -i c c=0; cw=20; spc='' - spc1=${cw}-${#SUBJECT} + spc1=${cw}-${#REPL_DESC[${rcheck}]} until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done #echo "${rcheck} - ${REPL_DESC[${rcheck}]} - ${REPL_CHECKS[${rcheck}]}" echo -en "${REPL_DESC[${rcheck}]}${spc}: "