Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-07 10:19:42 -06:00
parent d87f1435c1
commit affd827aa6

View File

@@ -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}: "