From bdd128af684ff928bfc086ea2725e9faef1b311e Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 7 Feb 2019 10:11:14 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 70 ++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index e0e886a9..ca1aa8c5 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -21,41 +21,41 @@ STATUS() { echo echo -e "${idsCL[Yellow]} Node Service Status${idsCL[Default]}" DIVIDER - if [ ! -z ${LOCAL_SERVICES+x} ]; then - lip=$(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) - echo -e "Node hostname: ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME} (${lip})${idsST[Reset]}${idsCL[LightCyan]} - localhost${idsCL[Default]}" - DIVIDER false green - for srvc in "${LOCAL_SERVICES[@]}" - do - if [[ "mysql,nginx,gitea,haproxy,keepalived,maxscale" = *"${srvc}"* ]]; then spc=" "; else spc=""; fi - echo -en "${NM_SERVICES[${srvc}]} $spc" - if [ $(pgrep ${srvc} | wc -l) -gt "0" ]; then - echo -e "${idsCL[Green]}Running${idsCL[Default]}" - else echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" - fi - done - fi - echo - nid=1 - for nip in "${NODE_HOSTS[@]}" - do - if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then NCMD=''; LH='- localhost' - else NCMD="ssh root@${nip}"; LH='' - fi - echo -e "Node hostname: ${idsST[Bold]}${idsCL[LightCyan]}iDS-Node${nid} (${nip})${idsST[Reset]}${idsCL[LightCyan]} ${LH}${idsCL[Default]}" - DIVIDER false green - for srvc in "${NODE_SERVICES[@]}" - do - if [[ "mysql,nginx,gitea,haproxy,keepalived,maxscale" = *"${srvc}"* ]]; then spc=" "; else spc=""; fi - echo -en "${NM_SERVICES[${srvc}]} $spc" - if [ $(${NCMD} pgrep ${srvc} | wc -l) -gt "0" ]; then - echo -e "${idsCL[Green]}Running${idsCL[Default]}" - else echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" - fi - done - echo - nid=`expr $nid + 1` - done + # if [ ! -z ${LOCAL_SERVICES+x} ]; then + # lip=$(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) + # echo -e "Node hostname: ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME} (${lip})${idsST[Reset]}${idsCL[LightCyan]} - localhost${idsCL[Default]}" + # DIVIDER false green + # for srvc in "${LOCAL_SERVICES[@]}" + # do + # if [[ "mysql,nginx,gitea,haproxy,keepalived,maxscale" = *"${srvc}"* ]]; then spc=" "; else spc=""; fi + # echo -en "${NM_SERVICES[${srvc}]} $spc" + # if [ $(pgrep ${srvc} | wc -l) -gt "0" ]; then + # echo -e "${idsCL[Green]}Running${idsCL[Default]}" + # else echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" + # fi + # done + # fi + # echo + # nid=1 + # for nip in "${NODE_HOSTS[@]}" + # do + # if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then NCMD=''; LH='- localhost' + # else NCMD="ssh root@${nip}"; LH='' + # fi + # echo -e "Node hostname: ${idsST[Bold]}${idsCL[LightCyan]}iDS-Node${nid} (${nip})${idsST[Reset]}${idsCL[LightCyan]} ${LH}${idsCL[Default]}" + # DIVIDER false green + # for srvc in "${NODE_SERVICES[@]}" + # do + # if [[ "mysql,nginx,gitea,haproxy,keepalived,maxscale" = *"${srvc}"* ]]; then spc=" "; else spc=""; fi + # echo -en "${NM_SERVICES[${srvc}]} $spc" + # if [ $(${NCMD} pgrep ${srvc} | wc -l) -gt "0" ]; then + # echo -e "${idsCL[Green]}Running${idsCL[Default]}" + # else echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" + # fi + # done + # echo + # nid=`expr $nid + 1` + # done echo echo -e "${idsCL[Yellow]} Replication Status${idsCL[Default]}"