Update nodemgmt-scripts.sh
This commit is contained in:
@@ -18,6 +18,7 @@ source /opt/idssys/nodemgmt/defaults.inc
|
||||
# ========================================================= #
|
||||
|
||||
STATUS() {
|
||||
declare -i cw; declare -i spc1; declare -i c
|
||||
for nip in "${NODE_HOSTS[@]}"; do
|
||||
if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) != *"${nip}"* ]]; then
|
||||
for rcheck in "${REPL_CHECK[@]}"; do
|
||||
@@ -53,12 +54,14 @@ STATUS() {
|
||||
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]}"
|
||||
echo -e " ${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"
|
||||
c=0; cw=26; spc=''
|
||||
spc1=${cw}-${#REPL_DESC[${rcheck}]}
|
||||
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||
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]}"
|
||||
@@ -68,7 +71,7 @@ STATUS() {
|
||||
nid=`expr $nid + 1`
|
||||
done
|
||||
echo
|
||||
echo -e "${idsCL[Yellow]} Replication Status${idsCL[Default]}"
|
||||
echo -e "${idsCL[Yellow]} Replication Status to Other Nodes${idsCL[Default]}"
|
||||
DIVIDER true
|
||||
timeout=`date --date='40 seconds' +%s`
|
||||
nid=1
|
||||
@@ -79,11 +82,9 @@ STATUS() {
|
||||
DIVIDER false green
|
||||
for rcheck in "${REPL_CHECK[@]}"
|
||||
do
|
||||
declare -i cw; declare -i spc1; declare -i c
|
||||
c=0; cw=20; spc=''
|
||||
c=0; cw=26; spc=''
|
||||
spc1=${cw}-${#REPL_DESC[${rcheck}]}
|
||||
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||
#echo "${rcheck} - ${REPL_DESC[${rcheck}]} - ${REPL_CHECKS[${rcheck}]}"
|
||||
echo -en "${REPL_DESC[${rcheck}]}${spc}: "
|
||||
checked=false
|
||||
until [ "${checked}" = "" ]; do
|
||||
|
||||
Reference in New Issue
Block a user