Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-07 11:11:42 -06:00
parent 4fb0adf135
commit c8bce32f74

View File

@@ -19,13 +19,17 @@ source /opt/idssys/nodemgmt/defaults.inc
STATUS() {
declare -i cw; declare -i spc1; declare -i c
if [ ! -z ${LOCAL_SERVICES+x} ];
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
rm -f ${FOLDER}/test.repl
${NCMD} 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
${NCMD} echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl
${NCMD} yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl
done
fi
done
@@ -119,16 +123,15 @@ STATUS() {
STATUS-CHECK(){
if [ "${STATUS_CHECK_EMAIL}" != "" ]; then
if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) != *"${NODEHOSTS}"* ]]; then
echo
fi
if [ ! -z ${LOCAL_SERVICES+x} ]; 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
rm -f ${FOLDER}/test.repl
${NCMD} 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
${NCMD} echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl
${NCMD} yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl
done
fi
done