update
This commit is contained in:
@@ -3,11 +3,8 @@ STATUS(){
|
||||
start=`date +%s`
|
||||
|
||||
PRI_CW=40;
|
||||
|
||||
ST_ACTION=${1}
|
||||
if [ "${ST_ACTION}" = "sync" ]; then
|
||||
ST_ACTION=repl
|
||||
fi
|
||||
[ "${ST_ACTION}" = "sync" ] && ST_ACTION=repl
|
||||
declare -i cw; declare -i spc1; declare -i c
|
||||
|
||||
ntypesel=""
|
||||
@@ -18,18 +15,14 @@ STATUS(){
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ "${ntypesel}" != "" ]; then
|
||||
ntypesel=(${ntypesel})
|
||||
else
|
||||
ntypesel=(${NM_NODE_TYPES[@]})
|
||||
fi
|
||||
[ "${ntypesel}" != "" ] && ntypesel=(${ntypesel}) || ntypesel=(${NM_NODE_TYPES[@]})
|
||||
|
||||
############################
|
||||
## REPLICATION CHECK SETUP
|
||||
############################
|
||||
|
||||
# if [ "${ST_ACTION}" == "report" ] || [ "${ST_ACTION}" == "repl" ] || [ "${ST_ACTION}" == "check" ] || [ "${ST_ACTION}" == "" ]; then
|
||||
if [ "${ST_ACTION}" == "repl" ]; then
|
||||
if [ "${ST_ACTION}" == "repl" ] || [ "${ST_ACTION}" == "all" ]; then
|
||||
if [ "${ST_ACTION}" != "check" ]; then
|
||||
echo -en "${idsCL[LightCyan]}Setting up replication checks ... ${idsCL[Default]}"
|
||||
fi
|
||||
@@ -45,7 +38,7 @@ STATUS(){
|
||||
########################
|
||||
## LOCALHOST CHECK
|
||||
########################
|
||||
if [ "${ST_ACTION}" = "" ] || [ "${ST_ACTION}" = "report" ] || [ "${ST_ACTION}" = "services" ] || [ "${ST_ACTION}" = "dockers" ] || [ "${ST_ACTION}" = "check" ]; then
|
||||
if [ "${ST_ACTION}" = "" ] || [ "${ST_ACTION}" = "report" ] || [ "${ST_ACTION}" = "services" ] || [ "${ST_ACTION}" = "dockers" ] || [ "${ST_ACTION}" = "check" ] || [ "${ST_ACTION}" == "all" ]; then
|
||||
cpu_usage=$(awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1) "%"; }' <(grep 'cpu ' /proc/stat) <(sleep 1;grep 'cpu ' /proc/stat) | sed -e 's/%//g')
|
||||
|
||||
if [ ! -z ${LOCAL_SERVICES+x} ] && [ "${ST_ACTION}" != "dockers" ]; then
|
||||
@@ -146,7 +139,7 @@ STATUS(){
|
||||
########################
|
||||
|
||||
# if [ "${ST_ACTION}" == "report" ] || [ "${ST_ACTION}" == "repl" ] || [ "${ST_ACTION}" == "check" ] || [ "${ST_ACTION}" == "" ]; then
|
||||
if [ "${ST_ACTION}" == "repl" ]; then
|
||||
if [ "${ST_ACTION}" == "repl" ] || [ "${ST_ACTION}" == "all" ]; then
|
||||
if [ "${ST_ACTION}" != "check" ]; then
|
||||
echo -e "${idsST[Bold]}"; DIVIDER
|
||||
echo -e "${idsCL[Yellow]} Replication Status Between the Primary and Secondary Nodes${idsCL[Default]}"
|
||||
@@ -253,7 +246,7 @@ It was down for $(SHOW_TIME $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/${
|
||||
# REMOVE REPL CHECK FILES
|
||||
##########################
|
||||
# if [ "${ST_ACTION}" == "report" ] || [ "${ST_ACTION}" == "repl" ] || [ "${ST_ACTION}" == "check" ] || [ "${ST_ACTION}" == "" ]; then
|
||||
if [ "${ST_ACTION}" == "repl" ]; then
|
||||
if [ "${ST_ACTION}" == "repl" ] || [ "${ST_ACTION}" == "all" ]; then
|
||||
if [ "${ST_ACTION}" != "check" ]; then
|
||||
echo -en "${idsCL[LightCyan]} Cleaning up status checks... ${idsCL[Default]}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user