Update nodemgmt-scripts.sh

This commit is contained in:
2023-01-01 09:46:39 -06:00
parent 65d22fabc4
commit f2f9221e3f

View File

@@ -216,7 +216,7 @@ STATUS(){
mysqlgo=true
fi
# echo "mysqlgo=${mysqlgo}"
if [ "${srvctst}" != "active" ] && [ "${mysqlgo}" != "true" ]; then
if [ "${srvctst}" != "active" ] && [ ${mysqlgo} != true ]; then
if [ ! -f ${FOLDER}/${nip}-${srvc}.down ]; then
if [ "${ST_ACTION}" != "check" ]; then
@@ -232,15 +232,15 @@ STATUS(){
mv ${FOLDER}/${nip}-${srvc}.down ${FOLDER}/${nip}-${srvc}.errtime
fi
toterrtime=`date +%s`-$(stat -c %Y ${FOLDER}/${nip}-${srvc}.errtime)
if [ "${ST_ACTION}" != "check" ]; then
echo -e "${idsCL[Red]}Not running for $(SHOW_TIME ${toterrtime})${idsCL[Default]}"
fi
# if [ "${EMAIL_NOTICE}" != "" ]; then echo "${NM_SERVICES[${srvc}]} has been down for $(SHOW_TIME ${toterrtime})" | mail -s "${NM_NODETYPES[$NTYPE]}-Node${nid}-${nip}" ${EMAIL_NOTICE}; fi
touch ${FOLDER}/${nip}-${srvc}.down
if [ "${srvc}" = "mysql" ]; then
${NCMD} systemctl restart ${srvc}
fi
fi
if [ "${ST_ACTION}" != "check" ]; then
echo -e "${idsCL[Red]}Not running for $(SHOW_TIME ${toterrtime})${idsCL[Default]}"
fi
fi
else
if [ "${ST_ACTION}" != "check" ]; then