Update nodemgmt-scripts.sh

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

View File

@@ -23,18 +23,15 @@ STATUS() {
then NCMD='ssh root@10.5.10.51' then NCMD='ssh root@10.5.10.51'
else NCMD='' else NCMD=''
fi fi
for nip in "${NODE_HOSTS[@]}"; do for rcheck in "${REPL_CHECK[@]}"; do
if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]]; then ${NCMD} rm -f ${FOLDER}/test.repl
for rcheck in "${REPL_CHECK[@]}"; do daterun=`date +%Y-%m-%d-%H-%M-%S`
${NCMD} rm -f ${FOLDER}/test.repl if [ "${NCMD}" = "" ]; then
daterun=`date +%Y-%m-%d-%H-%M-%S` echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl
if [ "${NCMD}" = "" ]; then yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl
echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl else
else ${NCMD} "echo -e \"Status-Check (${NODE_HOSTNAME})\n${daterun}\" > ${FOLDER}/test.repl"
${NCMD} 'echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl' yes | ${NCMD} "cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl"
fi
yes | ${NCMD} cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl
done
fi fi
done done
@@ -101,7 +98,7 @@ STATUS() {
if [ "${NCMD}" = "" ]; then if [ "${NCMD}" = "" ]; then
checked=`ssh root@${nip} "cat ${REPL_CHECKS[${rcheck}]}/test.repl" | diff - ${REPL_CHECKS[${rcheck}]}/test.repl` checked=`ssh root@${nip} "cat ${REPL_CHECKS[${rcheck}]}/test.repl" | diff - ${REPL_CHECKS[${rcheck}]}/test.repl`
else 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 fi
if [ "`date +%s`" -gt "$timeout" ]; then if [ "`date +%s`" -gt "$timeout" ]; then
if [ "${STATUS_CHECK_EMAIL}" != "" ]; then if [ "${STATUS_CHECK_EMAIL}" != "" ]; then