diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index f56f3fcc..2d8f9616 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -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