Update nodemgmt-scripts.sh
This commit is contained in:
@@ -339,17 +339,22 @@ STATUS(){
|
||||
if [ ! -f ${FOLDER}/${nip}.errtime ]; then
|
||||
touch ${FOLDER}/${nip}.errtime
|
||||
fi
|
||||
# [ "${EMAIL_NOTICE}" != "" ] && echo "${NM_NODETYPES[$NTYPE]}-Node${nid} is down" | mail -s "${NM_NODETYPES[$NTYPE]}-Node${nid}-${nip}" ${EMAIL_NOTICE}
|
||||
if [ "${ST_ACTION}" != "check" ]; then
|
||||
toterrtime=`date +%s`-$(stat -c %Y ${FOLDER}/${nip}.errtime)
|
||||
echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_NODETYPES[$NTYPE]}-Node${nid} (${nip})${idsST[Reset]}${idsCL[Red]} - Node is down!${idsCL[Default]}"
|
||||
fi
|
||||
[ "${EMAIL_NOTICE}" != "" ] && echo "${NM_NODETYPES[$NTYPE]}-Node${nid} is down" | mail -s "${NM_NODETYPES[$NTYPE]}-Node${nid}-${nip}" ${EMAIL_NOTICE}
|
||||
else
|
||||
if [ "${ST_ACTION}" != "check" ]; then
|
||||
toterrtime=`date +%s`-$(stat -c %Y ${FOLDER}/${nip}.errtime)
|
||||
echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_NODETYPES[$NTYPE]}-Node${nid} (${nip})${idsST[Reset]}${idsCL[Red]} - Node has been down for $(SHOW_TIME ${toterrtime}) ${idsCL[LightYello]}${LH}${idsCL[Default]}"
|
||||
fi
|
||||
errtime=`date +%s`-$(stat -c %Y ${FOLDER}/${nip}.down)
|
||||
# if [ $errtime -gt ${RENOTIFY} ] && [ "${EMAIL_NOTICE}" != "" ]; then
|
||||
# echo "${NM_NODETYPES[$NTYPE]}-Node${nid} has been down for $(SHOW_TIME ${toterrtime})" | mail -s "${NM_NODETYPES[$NTYPE]}-Node${nid}-${nip}" ${EMAIL_NOTICE}
|
||||
# fi
|
||||
fi
|
||||
if [ "${ST_ACTION}" != "check" ]; then
|
||||
toterrtime=`date +%s`-$(stat -c %Y ${FOLDER}/${nip}.errtime)
|
||||
echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_NODETYPES[$NTYPE]}-Node${nid} (${nip})${idsST[Reset]}${idsCL[Red]} - Node has been down for $(SHOW_TIME ${toterrtime}) ${idsCL[LightYello]}${LH}${idsCL[Default]}"
|
||||
fi
|
||||
|
||||
fi
|
||||
if [ "${ST_ACTION}" != "check" ]; then echo; fi
|
||||
nid=`expr $nid + 1`
|
||||
|
||||
Reference in New Issue
Block a user