Update nodemgmt-scripts.sh

This commit is contained in:
2023-12-06 12:26:40 -06:00
parent 2458d56da2
commit e9294d58c7

View File

@@ -639,11 +639,12 @@ DOWNLIST(){
# echo -e "${idsCL[Yellow]}Service/Host Host Down_Time${idsCL[Default]}"
# else
echo -e "${idsCL[Yellow]} Service/Host Host Down_Time Notifications${idsCL[Default]}"
echo -e "${idsCL[Yellow]} (Type) (Host/Service/Docker Name) (Host) (Down_Time) (Notifications)${idsCL[Default]}"
# fi
DIVIDER false yellow 95
until [ "${choice^^}" = "E" ]; do
cw=35; cw2=20; is=1;
cw=35; cw1=10; cw2=20; is=1;
for downitem in ${DOWNLIST[@]}; do
ditem=${downitem##*/}
ditem=${ditem//.down}
@@ -652,14 +653,19 @@ DOWNLIST(){
if [[ $ditem == *"~"* ]] && [ "${NM_SERVICE_DESC[${item}]}" != "" ]; then
itemname=${NM_SERVICE_DESC[${item}]}
itemtype=SERVICE
elif [[ $ditem == *"~"* ]] && [ "${NM_DOCKER_DESC[${item}]}" != "" ]; then
itemname="${NM_DOCKER_DESC[${item}]} (docker)"
itemname=${NM_DOCKER_DESC[${item}]}
itemtype=DOCKER
elif [[ $ditem == *"~"* ]] && [ "${NM_REPL_DESC[${item}]}" != "" ]; then
itemname="${NM_REPL_DESC[${item}]} (replication)"
itemname=${NM_REPL_DESC[${item}]}
itemtype=SYNC
elif [ "${NM_HOSTNAMES[${host}]}" != "" ]; then
itemname="HOST: ${NM_HOSTNAMES[${host}]}"
itemname=${NM_HOSTNAMES[${host}]}
itemtype=HOST
else
itemname="${item} DOWN";
itemtype=""
[ "${NM_HOSTNAMES[${host}]}" != "" ] && itemname="${itemname}: ${NM_HOSTNAMES[${host}]}"
fi
@@ -671,6 +677,8 @@ DOWNLIST(){
c=0; spc=''; spc1=${cw}-${#itemname}
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
c=0; spca=''; spc1=${cw1}-${#itemtype}
until [ $c = ${spc1} ]; do spca="${spca} "; c=`expr $c + 1`; done
c=0; spc2=''; spc1=${cw2}-${#host}
until [ $c = ${spc1} ]; do spc2="${spc2} "; c=`expr $c + 1`; done
@@ -686,7 +694,7 @@ DOWNLIST(){
time=$(SHOW_TIME ${toterrtime})
c=0; spc3=''
until [ $c = `expr 26 - ${#time}` ]; do spc3="${spc3} "; ((c++)); done
echo -e "\033[K${idsCL[LightRed]}${idsST[Bold]}${ignsel}${idsST[Reset]}${idsCL[LightRed]}${itemname}${spc}${host}${spc2}${time}${spc3}${dstatus}${idsCL[Default]}"
echo -e "\033[K${idsCL[LightRed]}${idsST[Bold]}${ignsel}${idsST[Reset]}${idsCL[LightRed]}${itemtype}${spca}${itemname}${spc}${host}${spc2}${time}${spc3}${dstatus}${idsCL[Default]}"
# fi
DIVIDER false darkGray 95