Update nodemgmt-scripts.sh
This commit is contained in:
@@ -23,21 +23,18 @@ 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
|
||||||
|
|
||||||
echo -e "${idsST[Bold]}"; DIVIDER
|
echo -e "${idsST[Bold]}"; DIVIDER
|
||||||
echo -e "${idsCL[Yellow]} Node Service Status${idsCL[Default]}"
|
echo -e "${idsCL[Yellow]} Node Service Status${idsCL[Default]}"
|
||||||
DIVIDER; echo -e "${idsST[Reset]}"
|
DIVIDER; echo -e "${idsST[Reset]}"
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user