Update nodemgmt-scripts.sh

This commit is contained in:
2023-04-26 13:13:24 -05:00
parent dc0afb88de
commit d045ce4b2f

View File

@@ -415,8 +415,10 @@ STATUS(){
echo -e " ${idsCL[LightCyan]}${NM_NODETYPES[$NTYPE]}-Node1 (${!PH}) <--> ${idsST[Bold]}${NM_NODETYPES[$NTYPE]}-Node${nid} (${nip})${idsST[Reset]}${idsCL[Default]}" echo -e " ${idsCL[LightCyan]}${NM_NODETYPES[$NTYPE]}-Node1 (${!PH}) <--> ${idsST[Bold]}${NM_NODETYPES[$NTYPE]}-Node${nid} (${nip})${idsST[Reset]}${idsCL[Default]}"
DIVIDER false green DIVIDER false green
fi fi
checkhost=$(CHECK_HOST ${nip})
if [ "${checkhost}" != "false" ]; then # checkhost=$(CHECK_HOST ${nip})
#if [ "${checkhost}" != "false" ]; then
if [ ! -f ${FOLDER}/${!PH}.down ] || [ ! -f ${FOLDER}/${nip}.down ]; then
if [ -f ${FOLDER}/${nip}.down ]; then if [ -f ${FOLDER}/${nip}.down ]; then
if [ -f ${FOLDER}/${nip}.errtime ]; then if [ -f ${FOLDER}/${nip}.errtime ]; then
toterrtime=`date +%s`-$(stat -c %Y ${FOLDER}/${nip}.errtime) toterrtime=`date +%s`-$(stat -c %Y ${FOLDER}/${nip}.errtime)
@@ -434,7 +436,6 @@ STATUS(){
if [ "${ST_ACTION}" != "check" ]; then if [ "${ST_ACTION}" != "check" ]; then
if [ "${ST_ACTION}" != "report" ]; then if [ "${ST_ACTION}" != "report" ]; then
c=0; cw=30; spc='' c=0; cw=30; spc=''
echo "${cw}-${#REPL_DESC[${rcheck}]}"
spc1=${cw}-${#REPL_DESC[${rcheck}]} spc1=${cw}-${#REPL_DESC[${rcheck}]}
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
else else
@@ -493,10 +494,8 @@ STATUS(){
done done
else else
if [ "${ST_ACTION}" != "check" ]; then if [ "${ST_ACTION}" != "check" ]; then
echo -e "${idsCL[Red]}Node is Down!${idsCL[Default]}" [ ! -f ${FOLDER}/${!PH}.down ] && echo -e "${idsCL[Red]}${NM_NODETYPES[$NTYPE]}-Node1 (${!PH}) is offline${idsCL[Default]}"
fi [ ! -f ${FOLDER}/${nip}.down ] && echo -e "${idsCL[Red]}${NM_NODETYPES[$NTYPE]}-Node${nip: -1} (${nip}) is offline${idsCL[Default]}"
if [ ! -f ${FOLDER}/${nip}.down ]; then
touch ${FOLDER}/${nip}.down
fi fi
fi fi
if [ "${ST_ACTION}" != "check" ]; then echo; fi if [ "${ST_ACTION}" != "check" ]; then echo; fi