From bde9fea75fb3921d226061ce0adc78df5a0370e5 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 29 Jan 2019 23:50:36 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 51cfc24c..d0ab3f24 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -148,20 +148,19 @@ case "$1" in fi done fi - echo "HERE: ${2}" if [ -z ${LOCAL_SERVICES+x} ] || [ "${2}" = "all" ]; then nid=1 - for nip in "${HOSTS2[@]}" + for nip in "${NODE_HOSTS[@]}" do if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then NCMD='' else NCMD="ssh root@${nip}" - fi - for srvc in "${SERVICES2[@]}" - do - echo "${nip} - checking ${srvc}" - if [ $(${NCMD} pgrep ${srvc} | wc -l) -lt "1" ]; then - echo "${NM_SERVICES[${srvc}]} is down" | mail -s "iDS-Node${nid}-${nip}" ${STATUS_CHECK_EMAIL} - fi + fi + for srvc in "${NODE_SERVICES[@]}" + do + echo "${nip} - checking ${srvc}" + if [ $(${NCMD} pgrep ${srvc} | wc -l) -lt "1" ]; then + echo "${NM_SERVICES[${srvc}]} is down" | mail -s "iDS-Node${nid}-${nip}" ${STATUS_CHECK_EMAIL} + fi done nid=`expr $nid + 1` done