Update nodemgmt-scripts.sh

This commit is contained in:
2022-07-24 17:21:24 -05:00
parent 0b93b30d7f
commit b2e680f454

View File

@@ -1844,7 +1844,7 @@ DOWNLIST(){
echo -e "Down_Item Host Down_Since"
DIVIDER false yellow
cw=30
cw=30; cw2=50
# for downitem in $(</tmp/downlist); do
for downitem in `find /opt/idssys/nodemgmt -name "*.down"`; do
ditem=${downitem##*/}
@@ -1853,11 +1853,18 @@ DOWNLIST(){
item=${ditem#*-}
if [[ $ditem == *"-"* ]]; then item=${NM_SERVICES[${ditem#*-}]};
else item='HOST DOWN'; fi
toterrtime=`date +%s`-$(stat -c %Y ${FOLDER}/${NODE_HOSTNAME}-${srvc}.errtime)
errtime=$(SHOW_TIME ${toterrtime})
c=0; spc=''
spc1=${cw}-${#item}
echo "HERE: $downitem ~ $ditem ~ $host ~ $item ~ $spc1"
#echo "HERE: $downitem ~ $ditem ~ $host ~ $item ~ $spc1"
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -e "${idsST[Bold]}${idsCL[Red]}${item}${spc}${host}${idsST[Reset]}${idsCL[Default]}"
c=0; spc2=''
spc1=${cw2}-${spc1}
until [ $c = ${spc1} ]; do spc2="${spc2} "; c=`expr $c + 1`; done
echo -e "${idsST[Bold]}${idsCL[Red]}${item}${spc}${host}${spc2}${errtime}${idsST[Reset]}${idsCL[Default]}"
DIVIDER false darkGray
done
echo