Update nodemgmt-scripts.sh

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

View File

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