Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-07 11:55:58 -06:00
parent 4a973aedf2
commit 6b56e3e4d5

View File

@@ -23,21 +23,18 @@ STATUS() {
then NCMD='ssh root@10.5.10.51'
else NCMD=''
fi
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
${NCMD} rm -f ${FOLDER}/test.repl
daterun=`date +%Y-%m-%d-%H-%M-%S`
if [ "${NCMD}" = "" ]; then
echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl
else
${NCMD} 'echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl'
fi
yes | ${NCMD} cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl
done
for rcheck in "${REPL_CHECK[@]}"; do
${NCMD} rm -f ${FOLDER}/test.repl
daterun=`date +%Y-%m-%d-%H-%M-%S`
if [ "${NCMD}" = "" ]; then
echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl
yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl
else
${NCMD} "echo -e \"Status-Check (${NODE_HOSTNAME})\n${daterun}\" > ${FOLDER}/test.repl"
yes | ${NCMD} "cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl"
fi
done
echo -e "${idsST[Bold]}"; DIVIDER
echo -e "${idsCL[Yellow]} Node Service Status${idsCL[Default]}"
DIVIDER; echo -e "${idsST[Reset]}"
@@ -101,7 +98,7 @@ STATUS() {
if [ "${NCMD}" = "" ]; then
checked=`ssh root@${nip} "cat ${REPL_CHECKS[${rcheck}]}/test.repl" | diff - ${REPL_CHECKS[${rcheck}]}/test.repl`
else
${NCMD} 'checked=`ssh root@${nip} "cat ${REPL_CHECKS[${rcheck}]}/test.repl" | diff - ${REPL_CHECKS[${rcheck}]}/test.repl`'
${NCMD} "checked=`ssh root@${nip} \"cat ${REPL_CHECKS[${rcheck}]}/test.repl\" | diff - ${REPL_CHECKS[${rcheck}]}/test.repl`"
fi
if [ "`date +%s`" -gt "$timeout" ]; then
if [ "${STATUS_CHECK_EMAIL}" != "" ]; then