Update nodemgmt-scripts.sh

This commit is contained in:
2019-01-29 23:50:36 -06:00
parent 94891ec066
commit bde9fea75f

View File

@@ -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