Update nodemgmt-scripts.sh

This commit is contained in:
2019-03-26 22:39:01 -05:00
parent d7b4c5f112
commit 74407bc1b2

View File

@@ -36,20 +36,17 @@ STATUS(){
echo -e "${idsCL[LightCyan]}Setting up status checks...${idsCL[Default]}" echo -e "${idsCL[LightCyan]}Setting up status checks...${idsCL[Default]}"
echo echo
fi fi
# if [ ! -z ${LOCAL_SERVICES+x} ]; then
NHCMD="ssh root@${MYSQL_HOSTS[0]}" NHCMD="ssh root@${MYSQL_HOSTS[0]}"
LBHCMD="ssh root@${LB_HOSTS[0]}" LBHCMD="ssh root@${LB_HOSTS[0]}"
WHCMD="ssh root@${WEB_HOSTS[0]}" WHCMD="ssh root@${WEB_HOSTS[0]}"
# echo "HERE: '${NHCMD}' '${WHCMD}'" for NTYPE in "${NODE_TYPES[@]}"; do
# else var=${NTYPE}_REPL_CHECK[@]
# NHCMD='' if [ ! -z ${!var+x} ]; then
# fi for rcheck in "${!var}"; do
if [ ! -z ${MYSQL_REPL_CHECK+x} ]; then
for rcheck in "${MYSQL_REPL_CHECK[@]}"; do
${NHCMD} rm -f ${FOLDER}/test.repl ${NHCMD} rm -f ${FOLDER}/test.repl
daterun=`date +%Y-%m-%d-%H-%M-%S` daterun=`date +%Y-%m-%d-%H-%M-%S`
if [ "${NHCMD}" = "" ]; then if [ "${NHCMD}" = "" ]; then
echo -e "MySQL-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl echo -e "${NM_NODETYPES[$NTYPE]}-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl
yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl
else else
${NHCMD} "echo -e \"Status-Check (${NODE_HOSTNAME})\n${daterun}\" > ${FOLDER}/test.repl" ${NHCMD} "echo -e \"Status-Check (${NODE_HOSTNAME})\n${daterun}\" > ${FOLDER}/test.repl"
@@ -57,36 +54,12 @@ STATUS(){
fi fi
done done
fi fi
if [ ! -z ${LB_REPL_CHECK+x} ]; then
for rcheck in "${LB_REPL_CHECK[@]}"; do
${LBHCMD} rm -f ${FOLDER}/test.repl
daterun=`date +%Y-%m-%d-%H-%M-%S`
if [ "${LBHCMD}" = "" ]; then
echo -e "LB-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl
yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl
else
${LBHCMD} "echo -e \"Status-Check (${NODE_HOSTNAME})\n${daterun}\" > ${FOLDER}/test.repl"
yes | ${LBHCMD} "cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl"
fi
done
fi
for rcheck in "${WEB_REPL_CHECK[@]}"; do
${WHCMD} rm -f ${FOLDER}/test.repl
daterun=`date +%Y-%m-%d-%H-%M-%S`
if [ "${WHCMD}" = "" ]; then
echo -e "Webserver-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl
yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl
else
${WHCMD} "echo -e \"Status-Check (${NODE_HOSTNAME})\n${daterun}\" > ${FOLDER}/test.repl"
yes | ${WHCMD} "cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl"
fi
done done
if [ "${ST_ACTION}" = "repl" ]; then if [ "${ST_ACTION}" = "repl" ]; then
sleep 5 sleep 5
fi fi
fi fi
######################## ########################
if [ "${ST_ACTION}" = "" ] || [ "${ST_ACTION}" = "report" ] || [ "${ST_ACTION}" = "services" ] || [ "${ST_ACTION}" = "check" ]; then if [ "${ST_ACTION}" = "" ] || [ "${ST_ACTION}" = "report" ] || [ "${ST_ACTION}" = "services" ] || [ "${ST_ACTION}" = "check" ]; then
if [ ! -z ${LOCAL_SERVICES+x} ]; then if [ ! -z ${LOCAL_SERVICES+x} ]; then
if [ "${ST_ACTION}" != "check" ]; then if [ "${ST_ACTION}" != "check" ]; then