This commit is contained in:
2023-11-25 22:10:10 -06:00
parent ea033f7218
commit 5a8492e757
2 changed files with 6 additions and 79 deletions

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
VERS='4.16.5-11252023'
VERS='4.16.6-11252023'
noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense gui nightlyreview update log '
CERT_DAEMON='/snap/bin/certbot'

View File

@@ -204,7 +204,11 @@ STATUS(){
SENDNOTICE "${NM_HOSTNAMES[${nip}]}[${nip}]-UP" "${NM_HOSTNAMES[${nip}]}[${nip}] is back UP! It was down for $(SHOW_TIME ${toterrtime})"
fi
if [ "${ST_ACTION}" != "dockers" ]; then
########################
## SERVICES CHECK
########################
if [ "${ST_ACTION}" != "dockers" ] && [ "${NM_SERVICES_CHECK[${NTYPE}]}" != "" ]; then
echo -e "${idsCL[Green]} System Service(s) Status${idsCL[Default]}"
DIVIDER . green 52
@@ -284,83 +288,6 @@ STATUS(){
sr=`expr $sr + 1`
done
# for srvc in "${!var2}"; do
# NOGOCHK=true;
# [ "${srvc}" == "gitea" ] && [ "${NTYPE}" == "WEB" ] && [[ $(${NCMD} ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${WEB_HOSTS[0]}* ]] && NOGOCHK=false;
# if [ ${NOGOCHK} = true ]; then
# if [ "${ST_ACTION}" != "check" ]; then
# if [ "${ST_ACTION}" != "report" ]; then
# c=0; cw=${PRI_CW}; spc=''
# spc1=${cw}-${#NM_SERVICE_DESC[${srvc}]}
# until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
# else
# spc=' '
# fi
# echo -en " ${NM_SERVICE_DESC[${srvc}]}$spc: "
# fi
# srvctst=$(${NCMD} systemctl is-active ${srvc})
# if [ "${srvctst}" != "active" ] && [ "${srvc}" = "mysql" ]; then
# mysqlgo=false;
# [ "$(${NCMD} systemctl is-active mariadb)" = "active" ] && mysqlgo=true;
# elif [ "${srvctst}" != "active" ] && [ "${srvc}" = "mariadb" ]; then
# mysqlgo=false;
# [ "$(${NCMD} systemctl is-active mysql)" = "active" ] && mysqlgo=true;
# elif [ "${srvctst}" = "active" ] && ([ "${srvc}" = "mysql" ] || [ "${srvc}" = "mariadb" ]); then
# mysqlgo=true
# fi
# # echo "mysqlgo=${mysqlgo}"
# if [ "${srvctst}" != "active" ] && [ "${mysqlgo}" != "true" ]; then
# if [ ! -f ${NM_TMPFOLDER}/${nip}~${srvc}.down ]; then
# if [ "${ST_ACTION}" != "check" ]; then
# echo -e "${idsCL[Red]}Not Running${idsCL[Default]}"
# fi
# SENDNOTICE "${NM_HOSTNAMES[${nip}]}[${nip}]" "${NM_SERVICE_DESC[${srvc}]} is down" 1
# touch ${NM_TMPFOLDER}/${nip}~${srvc}.down
# echo "$(date +%Y-%m-%d-%H-%M-%S) - ${nip} - ${NM_HOSTNAMES[${nip}]}[${nip}] - ${NM_SERVICE_DESC[${srvc}]} is down" >> ${NM_LOGFILE}
#
# else
# errtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}~${srvc}.down)
# if [ $errtime -gt ${NM_RENOTIFY_TIMEOUT} ]; then
# if [ ! -f ${NM_TMPFOLDER}/${nip}~${srvc}.errtime ]; then
# mv ${NM_TMPFOLDER}/${nip}~${srvc}.down ${NM_TMPFOLDER}/${nip}~${srvc}.errtime
# fi
# toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}~${srvc}.errtime)
# touch ${NM_TMPFOLDER}/${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
# echo -e "${idsCL[LightGreen]}Running${idsCL[Default]}"
# fi
# if [ -f ${NM_TMPFOLDER}/${nip}~${srvc}.down ]; then
# if [ -f ${NM_TMPFOLDER}/${nip}~${srvc}.errtime ]; then
# toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}~${srvc}.errtime)
# else
# toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}~${srvc}.down)
# fi
# SENDNOTICE "${NM_HOSTNAMES[${nip}]}[${nip}]" "${NM_SERVICE_DESC[${srvc}]} is back UP! It was down for $(SHOW_TIME ${toterrtime})"
# echo "$(date +%Y-%m-%d-%H-%M-%S) - ${nip} - ${NM_HOSTNAMES[${nip}]}[${nip}] - ${NM_SERVICE_DESC[${srvc}]} is back up, it was down for $(SHOW_TIME ${toterrtime})" >> ${NM_LOGFILE}
#
# rm -f ${NM_TMPFOLDER}/${nip}~${srvc}.down
# rm -f ${NM_TMPFOLDER}/${nip}~${srvc}.errtime
#
# fi
# # if [ "${srvc}" == "pdnsadmin.socket" ] || [ "${srvc}" == "pdnsadmin" ] || [ "${srvc}" == "gitea" ]; then
# if [ "${srvc}" == "gitea" ]; then
# rm -f ${NM_FOLDER}/*~${srvc}.down
# rm -f ${NM_FOLDER}/*~${srvc}.errtime
# fi
# fi
# [ "${mysqlgo}" = "true" ] && unset mysqlgo
# fi
# done
fi
########################