From 5dfa248c30527a9b93bd269171ec9234a5304089 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 12 Dec 2023 14:04:38 -0600 Subject: [PATCH] Update status.inc --- inc/status.inc | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/inc/status.inc b/inc/status.inc index 3d46d9cb..b4f4231b 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -22,6 +22,7 @@ STATUS(){ # done PRI_CW=40 + DV_LEN=80 declare -i cw; declare -i spc1; declare -i c @@ -82,8 +83,8 @@ STATUS(){ if [ "${STATUS_ACTION}" != "check" ]; then lip=${RUN_NODE_IP} - echo -e "\n$(DIVIDER)\n${idsCL[Yellow]}${idsST[Bold]} LOCALHOST Service Status${idsST[Reset]}${idsCL[Default]}" - echo -e "$(DIVIDER)" + echo -e "\n$(DIVIDER . . ${DV_LEN})\n${idsCL[Yellow]}${idsST[Bold]} LOCALHOST Service Status${idsST[Reset]}${idsCL[Default]}" + echo -e "$(DIVIDER . . ${DV_LEN})" echo -en " ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME} ${idsST[Reset]}${idsCL[LightCyan]}[${lip}]" if ([ "${STATUS_ACTION}" == "report" ] && [ "${2}" == "email" ]) || [ "${STATUS_ACTION}" != "report" ]; then uptime=`uptime -p` @@ -91,14 +92,14 @@ STATUS(){ else echo -e "${idsCL[Default]}" fi - DIVIDER . green + DIVIDER . green ${DV_LEN} fi # if [ "${STATUS_ACTION}" != "check" ]; then # lip=${RUN_NODE_IP} # uptime=`uptime -p` # echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME} (${lip})${idsST[Reset]}${idsCL[LightCyan]} - ${uptime} - localhost${idsCL[Default]}" - # DIVIDER false green + # DIVIDER false green ${DV_LEN} # fi for srvc in "${LOCAL_SERVICES[@]}"; do if [ "${STATUS_ACTION}" != "check" ]; then @@ -183,9 +184,9 @@ STATUS(){ # if [ "${STATUS_ACTION}" == "report" ] || [ "${STATUS_ACTION}" == "repl" ] || [ "${STATUS_ACTION}" == "check" ] || [ "${STATUS_ACTION}" == "" ]; then if [ "${STATUS_ACTION}" == "repl" ] || [ "${STATUS_ACTION}" == "" ] || ([ "${STATUS_ACTION}" == "report" ] && [ ${REPLRUN} -eq 1 ]); then if [ "${STATUS_ACTION}" != "check" ]; then - echo -e "${idsST[Bold]}"; DIVIDER + echo -e "${idsST[Bold]}"; DIVIDER . . ${DV_LEN} echo -e "${idsCL[Yellow]} Replication Status Between the Primary and Secondary Nodes${idsCL[Default]}" - DIVIDER; echo -en "${idsST[Reset]}" + DIVIDER . . ${DV_LEN}; echo -en "${idsST[Reset]}" fi for NTYPE in "${ntypesel[@]}"; do @@ -198,7 +199,7 @@ STATUS(){ if [[ "${RUN_NODE_IP}" != *"${nip}"* ]] && [ "${nip}" != "${!PH}" ]; then if [ "${STATUS_ACTION}" != "check" ]; then echo -e " ${idsCL[LightCyan]}${NM_HOSTNAMES[${!PH}]}[${!PH}] <--> ${idsST[Bold]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}${idsCL[Default]}" - DIVIDER false green + DIVIDER false green ${DV_LEN} fi if [ ! -f ${NM_FOLDER}/${!PH}.down ] && [ ! -f ${NM_TMPFOLDER}/${nip}.down ]; then var2=${NTYPE}_REPL_CHECK[@] @@ -298,9 +299,9 @@ It was down for $(SHOW_TIME $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/${ if [ "${STATUS_ACTION}" == "freespace" ]; then for NTYPE in "${ntypesel[@]}"; do if [ "${STATUS_ACTION}" != "check" ]; then - echo -en "${idsST[Bold]}"; DIVIDER + echo -en "${idsST[Bold]}"; DIVIDER . . ${DV_LEN} echo -e "${idsCL[Yellow]} ${NM_NODETYPES[$NTYPE]}-Node(s) Free Space Scan${idsCL[Default]}" - DIVIDER; echo -e "${idsST[Reset]}" + DIVIDER . . ${DV_LEN}; echo -e "${idsST[Reset]}" fi var=${NTYPE}_HOSTS[@] for nip in "${!var}"; do @@ -309,7 +310,7 @@ It was down for $(SHOW_TIME $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/${ fi if [ "${STATUS_ACTION}" != "check" ]; then echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]} [${nip}]${idsST[Reset]}${idsCL[LightCyan]} ${idsCL[LightYellow]}${LH}${idsCL[Default]}" - DIVIDER false green + DIVIDER false green ${DV_LEN} fi [ "${STATUS_ACTION}" != "check" ] && [ "${2}" != "report" ] && echo -en " ${idsCL[LightCyan]}Getting drives from server ... ${idsCL[Default]}" @@ -432,13 +433,13 @@ STATUS_NODE(){ if [ ${GOFORCHECK} = true ]; then if [ "${STATUS_ACTION}" != "check" ]; then - echo -e "${idsST[Bold]}"; DIVIDER + echo -e "${idsST[Bold]}"; DIVIDER . . ${DV_LEN} if [ "${STATUS_ACTION}" == "dockers" ]; then echo -e "${idsCL[LightYellow]} ${NM_NODETYPES[$NTYPE]}-Node Docker Status${idsCL[Default]}" else echo -e "${idsCL[LightYellow]} ${NM_NODETYPES[$NTYPE]}-Node Service Status${idsCL[Default]}" fi - DIVIDER . lightYellow; echo -en "${idsST[Reset]}" + DIVIDER . lightYellow ${DV_LEN}; echo -en "${idsST[Reset]}" fi for nip in "${!NTHOSTS}"; do if [ "${STATUS_ACTION}" != "check" ]; then @@ -482,7 +483,7 @@ STATUS_NODE(){ echo -e "${idsCL[Default]}" fi - DIVIDER false lightCyan + DIVIDER false lightCyan ${DV_LEN} fi if [ -f ${NM_TMPFOLDER}/${nip}.down ]; then @@ -498,7 +499,7 @@ STATUS_NODE(){ ######################## if [ "${STATUS_ACTION}" != "dockers" ] && [ "${NM_SERVICES_CHECK[${NODETYPE}]}" != "" ]; then echo -e "${idsCL[Green]} System Service(s) Status${idsCL[Default]}" - DIVIDER . green 52 + DIVIDER . green ${DV_LEN} srvcs=${NODETYPE}_SERVICES_CHECK[@]; srvcstotest="$(join_by " " ${!srvcs})" @@ -607,7 +608,7 @@ STATUS_NODE(){ if [ "${STATUS_ACTION}" != "check" ]; then [ "${STATUS_ACTION}" == "" ] && [ "${NM_SERVICES_CHECK[${NODETYPE}]}" != "" ] && echo echo -e "${idsCL[Green]} Docker Service(s) Status${idsCL[Default]}" - DIVIDER . green 52 + DIVIDER . green ${DV_LEN} fi for docker in "${!dockers}"; do if [ "${STATUS_ACTION}" != "report" ]; then