This commit is contained in:
2019-02-07 22:25:27 -06:00
parent 0083753218
commit 5f96bef5a3
3 changed files with 10 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ noheader=' service status-check nightlyrenew backup report '
CERT_DAEMON='/usr/bin/certbot'
FOLDER=/opt/idssys/nodemgmt
SCRIPT=${FOLDER}/nodemgmt-scripts.sh
RENOTIFY=60
IFS=,
NODE_HOSTS=(${NODEHOSTS})

View File

@@ -208,10 +208,17 @@ STATUS-CHECK(){
fi
for srvc in "${NODE_SERVICES[@]}"; do
if [ "$(${NCMD} systemctl is-active ${srvc})" != "active" ]; then
# if [ ! -f ${FOLDER}/${nip}-${srvc}.down ]; then
if [ ! -f ${FOLDER}/${nip}-${srvc}.down ]; then
echo "${NM_SERVICES[${srvc}]} is down" | mail -s "iDS-Node${nid}-${nip}" ${STATUS_CHECK_EMAIL}
touch ${FOLDER}/${nip}-${srvc}.down
# fi
else
declare -i errtime
errtime=`date +%s`-$(stat -c %Y ${FOLDER}/${nip}-${srvc}.down)
echo "errtime: ${errtime}"
if [ $errtime -gt ${RENOTIFY} ]; then
echo "RENOTIFY"
fi
fi
elif [ -f ${FOLDER}/${nip}-${srvc}.down ]; then
echo "${NM_SERVICES[${srvc}]} is back UP!" | mail -s "iDS-Node${nid}-${nip}" ${STATUS_CHECK_EMAIL}
rm -f ${FOLDER}/${nip}-${srvc}.down

1
run.sh
View File

@@ -13,7 +13,6 @@ fi
source /opt/idssys/nodemgmt/defaults.inc
if [[ "${noheader}" != *" ${action} "* ]] && [[ "${noheader}" != *" ${2} "* ]]; then
#if [ "$1" != "service" ] && [ "$1" != "status-check" ] && [ "$1" != "nightlyrenew" ] && [ "$1" != "backup" ] && [ "$2" != "report" ]; then
if [ "${1}" = "gui" ]; then
DISP_HEADER
fi