update
This commit is contained in:
22
defaults.inc
22
defaults.inc
@@ -23,15 +23,6 @@ if [ -f ${FOLDER}/defaults.local.inc ]; then
|
||||
|
||||
IFS=,
|
||||
|
||||
MYSQL_SERVICES_CHECK=(${MYSQLSERVICES_CHECK})
|
||||
WEB_SERVICES_CHECK=(${WEBSERVICES_CHECK})
|
||||
LB_SERVICES_CHECK=(${LBSERVICES_CHECK})
|
||||
NC_SERVICES_CHECK=(${NCSERVICES_CHECK})
|
||||
WPD_SERVICES_CHECK=(${WPDSERVICES_CHECK})
|
||||
LPD_SERVICES_CHECK=(${LPDSERVICES_CHECK})
|
||||
MM_SERVICES_CHECK=(${MMSERVICES_CHECK})
|
||||
PW_SERVICES_CHECK=(${PWSERVICES_CHECK})
|
||||
WM_SERVICES_CHECK=(${WMSERVICES_CHECK})
|
||||
LOCAL_SERVICES=(${LOCAL_SERVICES})
|
||||
|
||||
WEB_DOCKER=(${WEBDOCKER})
|
||||
@@ -44,6 +35,7 @@ if [ -f ${FOLDER}/defaults.local.inc ]; then
|
||||
|
||||
unset IFS
|
||||
|
||||
|
||||
declare -a NODE_TYPES
|
||||
for nmtype in "${!NM_HOSTS[@]}"; do
|
||||
NODE_TYPES+=(${nmtype})
|
||||
@@ -51,11 +43,19 @@ if [ -f ${FOLDER}/defaults.local.inc ]; then
|
||||
|
||||
for ntype in "${NODE_TYPES[@]}"; do
|
||||
arr ${ntype}_HOSTS
|
||||
arr ${ntype}_SERVICES_CHECK
|
||||
|
||||
var=(${NM_HOSTS[${ntype}]})
|
||||
for host in "${var[@]}"; do
|
||||
arr_insert ${ntype}_HOSTS $host
|
||||
for value in "${var[@]}"; do
|
||||
arr_insert ${ntype}_HOSTS $value
|
||||
done
|
||||
|
||||
var=(${NM_SERVICES_CHECK[${ntype}]})
|
||||
for value in "${var[@]}"; do
|
||||
arr_insert ${ntype}_SERVICES_CHECK $value
|
||||
done
|
||||
done
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
@@ -3,29 +3,40 @@
|
||||
|
||||
NODEMANAGER=10.10.10.50
|
||||
|
||||
MYSQLHOSTS=10.10.1.51,10.10.1.52
|
||||
WEBHOSTS=10.10.1.121,10.10.1.122
|
||||
LBHOSTS=10.10.10.81,10.10.10.82
|
||||
NCHOSTS=10.10.10.42
|
||||
WPDHOSTS=100.100.55.2,100.100.55.3,10.10.1.28
|
||||
LPDHOSTS=10.10.10.10,10.10.10.11,10.2.1.2
|
||||
MMHOSTS=10.10.1.24
|
||||
NODEMANAGER=10.10.10.50
|
||||
GLHOSTS=10.10.1.41,10.10.1.42,10.10.1.121,10.10.1.122
|
||||
PWHOSTS=10.10.0.240
|
||||
WMHOSTS=100.100.55.5
|
||||
# declare -A NM_HOST_SERVICES
|
||||
# NM_HOST_SERVICES['LB']=
|
||||
# NM_HOST_SERVICES['LPD']=
|
||||
# NM_HOST_SERVICES['MM']=
|
||||
# NM_HOST_SERVICES['MYSQL']=
|
||||
# NM_HOST_SERVICES['NC']=
|
||||
# NM_HOST_SERVICES['PW']=
|
||||
# NM_HOST_SERVICES['WPD']=
|
||||
# NM_HOST_SERVICES['WM']=
|
||||
# NM_HOST_SERVICES['WEB']=
|
||||
|
||||
declare -A NM_HOSTS
|
||||
NM_HOSTS['MYSQL']=10.10.1.51,10.10.1.52
|
||||
NM_HOSTS['WEB']=10.10.1.121,10.10.1.122
|
||||
# NM_HOSTS['GL']=10.10.1.41,10.10.1.42,10.10.1.121,10.10.1.122
|
||||
NM_HOSTS['LB']=10.10.10.81,10.10.10.82
|
||||
NM_HOSTS['NC']=10.10.10.42
|
||||
NM_HOSTS['WPD']=100.100.55.2,100.100.55.3,10.10.1.28
|
||||
NM_HOSTS['LPD']=10.10.10.10,10.10.10.11,10.2.1.2
|
||||
NM_HOSTS['MM']=10.10.1.24
|
||||
# NM_HOSTS['GL']=10.10.1.41,10.10.1.42,10.10.1.121,10.10.1.122
|
||||
NM_HOSTS['MYSQL']=10.10.1.51,10.10.1.52
|
||||
NM_HOSTS['NC']=10.10.10.42
|
||||
NM_HOSTS['PW']=10.10.0.240
|
||||
NM_HOSTS['WPD']=100.100.55.2,100.100.55.3,10.10.1.28
|
||||
NM_HOSTS['WM']=100.100.55.5
|
||||
NM_HOSTS['WEB']=10.10.1.121,10.10.1.122
|
||||
|
||||
declare -A NM_SERVICES_CHECK
|
||||
NM_SERVICES_CHECK['LB']=nginx,haproxy,keepalived
|
||||
NM_SERVICES_CHECK['LPD']=pdns,nginx,mariadb,pdnsadmin,pdnsadmin.socket,keepalived
|
||||
NM_SERVICES_CHECK['MM']=bazarr,radarr,sonarr,prowlarr,qbittorrent,snap.tautulli.tautulli,ombi,nginx,php8.2-fpm
|
||||
NM_SERVICES_CHECK['MYSQL']=mariadb,proxysql,keepalived
|
||||
NM_SERVICES_CHECK['NC']=nginx,php8.1-fpm,redis-server
|
||||
NM_SERVICES_CHECK['PW']=mosquitto,monitor-power,monitor-temp
|
||||
NM_SERVICES_CHECK['WPD']=pdns,nginx,mariadb,pdnsadmin,pdnsadmin.socket,proxysql,tailscaled
|
||||
NM_SERVICES_CHECK['WM']=nginx,tailscaled
|
||||
NM_SERVICES_CHECK['WEB']=nginx,php5.6-fpm,php7.2-fpm,php7.3-fpm,php7.4-fpm,php8.2-fpm,gitea,keepalived
|
||||
|
||||
|
||||
|
||||
MYSQLSERVICES_CHECK=mariadb,proxysql,keepalived
|
||||
@@ -95,45 +106,45 @@ NM_NODETYPES['MM']='Media Manager'
|
||||
NM_NODETYPES['PW']='PowerWall'
|
||||
NM_NODETYPES['WM']='WAN-Monitor'
|
||||
|
||||
declare -A NM_SERVICES
|
||||
NM_SERVICES['mysql']='MySQL'
|
||||
NM_SERVICES['mariadb']='MariaDB (MySQL)'
|
||||
NM_SERVICES['postgresql']='PostgreSQL'
|
||||
NM_SERVICES['apache2']='Apache Web Server'
|
||||
NM_SERVICES['nginx']='NGINX Web Server'
|
||||
NM_SERVICES['gogs']='Gogs Git Repository'
|
||||
NM_SERVICES['gitea']='Gitea Git Repository'
|
||||
NM_SERVICES['haproxy']='HAProxy Load Balancer'
|
||||
NM_SERVICES['keepalived']='Keepalived Load Balancer'
|
||||
NM_SERVICES['maxscale']='MaxScale Load Balancer'
|
||||
NM_SERVICES['cmon']='ClusterControl'
|
||||
NM_SERVICES['cmon-events']='CC-Events Manager'
|
||||
NM_SERVICES['cmon-cloud']='CC-Cloud Daemon'
|
||||
NM_SERVICES['php5.6-fpm']='PHP 5.6 FPM'
|
||||
NM_SERVICES['php7.2-fpm']='PHP 7.2 FPM'
|
||||
NM_SERVICES['php7.3-fpm']='PHP 7.3 FPM'
|
||||
NM_SERVICES['php7.4-fpm']='PHP 7.4 FPM'
|
||||
NM_SERVICES['php8.0-fpm']='PHP 8.0 FPM'
|
||||
NM_SERVICES['php8.1-fpm']='PHP 8.1 FPM'
|
||||
NM_SERVICES['php8.2-fpm']='PHP 8.2 FPM'
|
||||
NM_SERVICES['syncthing']='Syncthing'
|
||||
NM_SERVICES['pdns']='PowerDNS Server'
|
||||
NM_SERVICES['pdnsadmin']='PowerDNS-Admin'
|
||||
NM_SERVICES['pdnsadmin.socket']='PowerDNS-Admin Socket'
|
||||
NM_SERVICES['proxysql']='ProxySQL Load Balancer'
|
||||
NM_SERVICES['radarr']='Radarr'
|
||||
NM_SERVICES['sonarr']='Sonarr'
|
||||
NM_SERVICES['jackett']='Jackett'
|
||||
NM_SERVICES['prowlarr']='Prowlarr'
|
||||
NM_SERVICES['qbittorrent']='qBittorrent'
|
||||
NM_SERVICES['snap.tautulli.tautulli']='Tautulli'
|
||||
NM_SERVICES['ombi']='Ombi'
|
||||
NM_SERVICES['glusterd']='Gluster FileSystem'
|
||||
NM_SERVICES['redis-server']='Redis Caching Server'
|
||||
NM_SERVICES['mosquitto']='Mosquitto MQTT Broker'
|
||||
NM_SERVICES['tailscaled']='Tailscale P2P VPN'
|
||||
NM_SERVICES['monitor-power']='Server Power Monitor'
|
||||
NM_SERVICES['monitor-temp']='Server Temp Monitor'
|
||||
declare -A NM_SERVICE_DESC
|
||||
NM_SERVICE_DESC['mysql']='MySQL'
|
||||
NM_SERVICE_DESC['mariadb']='MariaDB (MySQL)'
|
||||
NM_SERVICE_DESC['postgresql']='PostgreSQL'
|
||||
NM_SERVICE_DESC['apache2']='Apache Web Server'
|
||||
NM_SERVICE_DESC['nginx']='NGINX Web Server'
|
||||
NM_SERVICE_DESC['gogs']='Gogs Git Repository'
|
||||
NM_SERVICE_DESC['gitea']='Gitea Git Repository'
|
||||
NM_SERVICE_DESC['haproxy']='HAProxy Load Balancer'
|
||||
NM_SERVICE_DESC['keepalived']='Keepalived Load Balancer'
|
||||
NM_SERVICE_DESC['maxscale']='MaxScale Load Balancer'
|
||||
NM_SERVICE_DESC['cmon']='ClusterControl'
|
||||
NM_SERVICE_DESC['cmon-events']='CC-Events Manager'
|
||||
NM_SERVICE_DESC['cmon-cloud']='CC-Cloud Daemon'
|
||||
NM_SERVICE_DESC['php5.6-fpm']='PHP 5.6 FPM'
|
||||
NM_SERVICE_DESC['php7.2-fpm']='PHP 7.2 FPM'
|
||||
NM_SERVICE_DESC['php7.3-fpm']='PHP 7.3 FPM'
|
||||
NM_SERVICE_DESC['php7.4-fpm']='PHP 7.4 FPM'
|
||||
NM_SERVICE_DESC['php8.0-fpm']='PHP 8.0 FPM'
|
||||
NM_SERVICE_DESC['php8.1-fpm']='PHP 8.1 FPM'
|
||||
NM_SERVICE_DESC['php8.2-fpm']='PHP 8.2 FPM'
|
||||
NM_SERVICE_DESC['syncthing']='Syncthing'
|
||||
NM_SERVICE_DESC['pdns']='PowerDNS Server'
|
||||
NM_SERVICE_DESC['pdnsadmin']='PowerDNS-Admin'
|
||||
NM_SERVICE_DESC['pdnsadmin.socket']='PowerDNS-Admin Socket'
|
||||
NM_SERVICE_DESC['proxysql']='ProxySQL Load Balancer'
|
||||
NM_SERVICE_DESC['radarr']='Radarr'
|
||||
NM_SERVICE_DESC['sonarr']='Sonarr'
|
||||
NM_SERVICE_DESC['jackett']='Jackett'
|
||||
NM_SERVICE_DESC['prowlarr']='Prowlarr'
|
||||
NM_SERVICE_DESC['qbittorrent']='qBittorrent'
|
||||
NM_SERVICE_DESC['snap.tautulli.tautulli']='Tautulli'
|
||||
NM_SERVICE_DESC['ombi']='Ombi'
|
||||
NM_SERVICE_DESC['glusterd']='Gluster FileSystem'
|
||||
NM_SERVICE_DESC['redis-server']='Redis Caching Server'
|
||||
NM_SERVICE_DESC['mosquitto']='Mosquitto MQTT Broker'
|
||||
NM_SERVICE_DESC['tailscaled']='Tailscale P2P VPN'
|
||||
NM_SERVICE_DESC['monitor-power']='Server Power Monitor'
|
||||
NM_SERVICE_DESC['monitor-temp']='Server Temp Monitor'
|
||||
|
||||
|
||||
declare -A NM_DOCKERS
|
||||
|
||||
@@ -65,12 +65,12 @@ STATUS(){
|
||||
if [ "${ST_ACTION}" != "check" ]; then
|
||||
if [ "${ST_ACTION}" != "report" ]; then
|
||||
c=0; cw=30; spc=''
|
||||
spc1=${cw}-${#NM_SERVICES[${srvc}]}
|
||||
spc1=${cw}-${#NM_SERVICE_DESC[${srvc}]}
|
||||
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||
else
|
||||
spc=' '
|
||||
fi
|
||||
echo -en " ${NM_SERVICES[${srvc}]}${spc}: "
|
||||
echo -en " ${NM_SERVICE_DESC[${srvc}]}${spc}: "
|
||||
fi
|
||||
|
||||
if [ "$(systemctl is-active ${srvc})" != "active" ]; then
|
||||
@@ -78,9 +78,9 @@ STATUS(){
|
||||
if [ "${ST_ACTION}" != "check" ]; then
|
||||
echo -e "${idsCL[Red]}Not Running${idsCL[Default]}"
|
||||
fi
|
||||
SENDNOTICE "${NODE_HOSTNAME}" "${NM_SERVICES[${srvc}]} is down" 1
|
||||
SENDNOTICE "${NODE_HOSTNAME}" "${NM_SERVICE_DESC[${srvc}]} is down" 1
|
||||
touch ${TMPFOLDER}/${NODE_HOSTNAME}~${srvc}.down
|
||||
echo "$(date) - LOCAL - ${NODE_HOSTNAME} - ${NM_SERVICES[${srvc}]} is down" >> ${LOGFILE}
|
||||
echo "$(date) - LOCAL - ${NODE_HOSTNAME} - ${NM_SERVICE_DESC[${srvc}]} is down" >> ${LOGFILE}
|
||||
else
|
||||
errtime=`date +%s`-$(stat -c %Y ${TMPFOLDER}/${NODE_HOSTNAME}~${srvc}.down)
|
||||
if [ $errtime -gt ${RENOTIFY} ]; then
|
||||
@@ -105,8 +105,8 @@ STATUS(){
|
||||
toterrtime=`date +%s`-$(stat -c %Y ${TMPFOLDER}/${NODE_HOSTNAME}~${srvc}.down)
|
||||
fi
|
||||
rm -f ${TMPFOLDER}/${NODE_HOSTNAME}~${srvc}.*
|
||||
SENDNOTICE "${NODE_HOSTNAME}" "${NM_SERVICES[${srvc}]} is back UP! It was down for $(SHOW_TIME ${toterrtime})"
|
||||
echo "$(date) - LOCAL - ${NODE_HOSTNAME} - ${NM_SERVICES[${srvc}]} is back up" >> ${LOGFILE}
|
||||
SENDNOTICE "${NODE_HOSTNAME}" "${NM_SERVICE_DESC[${srvc}]} is back UP! It was down for $(SHOW_TIME ${toterrtime})"
|
||||
echo "$(date) - LOCAL - ${NODE_HOSTNAME} - ${NM_SERVICE_DESC[${srvc}]} is back up" >> ${LOGFILE}
|
||||
|
||||
fi
|
||||
fi
|
||||
@@ -183,11 +183,11 @@ STATUS(){
|
||||
if [ ${NOGOCHK} == true ]; then
|
||||
if [ "${ST_ACTION}" != "check" ]; then
|
||||
if [ "${ST_ACTION}" != "report" ]; then
|
||||
c=0; cw=30; spc=''; spc1=${cw}-${#NM_SERVICES[${srvc}]}; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||
c=0; cw=30; spc=''; spc1=${cw}-${#NM_SERVICE_DESC[${srvc}]}; until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||
else
|
||||
spc=' '
|
||||
fi
|
||||
echo -en " ${NM_SERVICES[${srvc}]}$spc: "
|
||||
echo -en " ${NM_SERVICE_DESC[${srvc}]}$spc: "
|
||||
fi
|
||||
if [ "${srvctst[$sr]}" != "active" ] && [ "${srvc}" == "mysql" ]; then
|
||||
[ "$(${NCMD} systemctl is-active mariadb)" == "active" ] && mysqlgo=true || mysqlgo=false
|
||||
@@ -201,19 +201,19 @@ STATUS(){
|
||||
if [ ! -f ${TMPFOLDER}/${nip}~${srvc}.down ]; then
|
||||
[ "${ST_ACTION}" != "check" ] && echo -e "${idsCL[Red]}Not Running${idsCL[Default]}"
|
||||
touch ${TMPFOLDER}/${nip}~${srvc}.down
|
||||
# SENDNOTICE "${NM_HOSTNAMES[${nip}]}-${nip}" "${NM_SERVICES[${srvc}]} is down" 1
|
||||
echo "$(date) - ${nip} - ${NM_HOSTNAMES[${nip}]} - ${NM_SERVICES[${srvc}]} is down" >> ${LOGFILE}
|
||||
# SENDNOTICE "${NM_HOSTNAMES[${nip}]}-${nip}" "${NM_SERVICE_DESC[${srvc}]} is down" 1
|
||||
echo "$(date) - ${nip} - ${NM_HOSTNAMES[${nip}]} - ${NM_SERVICE_DESC[${srvc}]} is down" >> ${LOGFILE}
|
||||
else
|
||||
errtime=`date +%s`-$(stat -c %Y ${TMPFOLDER}/${nip}~${srvc}.down)
|
||||
if [ $errtime -gt ${RENOTIFY} ]; then
|
||||
[ ! -f ${TMPFOLDER}/${nip}~${srvc}.errtime ] && mv ${TMPFOLDER}/${nip}~${srvc}.down ${TMPFOLDER}/${nip}~${srvc}.errtime
|
||||
toterrtime=`date +%s`-$(stat -c %Y ${TMPFOLDER}/${nip}~${srvc}.errtime)
|
||||
touch ${TMPFOLDER}/${nip}~${srvc}.down
|
||||
SENDNOTICE "${NM_HOSTNAMES[${nip}]}-${nip}" "${NM_SERVICES[${srvc}]} is down" 1
|
||||
SENDNOTICE "${NM_HOSTNAMES[${nip}]}-${nip}" "${NM_SERVICE_DESC[${srvc}]} is down" 1
|
||||
# ([ "${srvc}" == "mysql" ] || [ "${srvc}" == "mariadb" ]) && ${NCMD} systemctl restart ${srvc} &
|
||||
|
||||
elif [ $errtime -gt 60 ] && [ $errtime -lt 180 ] && [ ! -f ${TMPFOLDER}/${nip}~${srvc}.errtime ]; then
|
||||
SENDNOTICE "${NM_HOSTNAMES[${nip}]}-${nip}" "${NM_SERVICES[${srvc}]} is down" 1
|
||||
SENDNOTICE "${NM_HOSTNAMES[${nip}]}-${nip}" "${NM_SERVICE_DESC[${srvc}]} is down" 1
|
||||
|
||||
fi
|
||||
[ "${ST_ACTION}" != "check" ] && echo -e "${idsCL[Red]}Not running for $(SHOW_TIME ${toterrtime})${idsCL[Default]}"
|
||||
@@ -222,8 +222,8 @@ STATUS(){
|
||||
[ "${ST_ACTION}" != "check" ] && echo -e "${idsCL[Green]}Running${idsCL[Default]}"
|
||||
if [ -f ${TMPFOLDER}/${nip}~${srvc}.down ]; then
|
||||
[ -f ${TMPFOLDER}/${nip}~${srvc}.errtime ] && toterrtime=`date +%s`-$(stat -c %Y ${TMPFOLDER}/${nip}~${srvc}.errtime) || toterrtime=`date +%s`-$(stat -c %Y ${TMPFOLDER}/${nip}~${srvc}.down)
|
||||
SENDNOTICE "${NM_HOSTNAMES[${nip}]}-${nip}" "${NM_SERVICES[${srvc}]} is back UP! It was down for $(SHOW_TIME ${toterrtime})"
|
||||
echo "$(date) - ${nip} - ${NM_HOSTNAMES[${nip}]} - ${NM_SERVICES[${srvc}]} is back up, it was down for $(SHOW_TIME ${toterrtime})" >> ${LOGFILE}
|
||||
SENDNOTICE "${NM_HOSTNAMES[${nip}]}-${nip}" "${NM_SERVICE_DESC[${srvc}]} is back UP! It was down for $(SHOW_TIME ${toterrtime})"
|
||||
echo "$(date) - ${nip} - ${NM_HOSTNAMES[${nip}]} - ${NM_SERVICE_DESC[${srvc}]} is back up, it was down for $(SHOW_TIME ${toterrtime})" >> ${LOGFILE}
|
||||
|
||||
rm -f ${TMPFOLDER}/${nip}~${srvc}.*
|
||||
|
||||
@@ -249,12 +249,12 @@ STATUS(){
|
||||
# if [ "${ST_ACTION}" != "check" ]; then
|
||||
# if [ "${ST_ACTION}" != "report" ]; then
|
||||
# c=0; cw=30; spc=''
|
||||
# spc1=${cw}-${#NM_SERVICES[${srvc}]}
|
||||
# spc1=${cw}-${#NM_SERVICE_DESC[${srvc}]}
|
||||
# until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||
# else
|
||||
# spc=' '
|
||||
# fi
|
||||
# echo -en " ${NM_SERVICES[${srvc}]}$spc: "
|
||||
# echo -en " ${NM_SERVICE_DESC[${srvc}]}$spc: "
|
||||
# fi
|
||||
# srvctst=$(${NCMD} systemctl is-active ${srvc})
|
||||
# if [ "${srvctst}" != "active" ] && [ "${srvc}" = "mysql" ]; then
|
||||
@@ -272,9 +272,9 @@ STATUS(){
|
||||
# if [ "${ST_ACTION}" != "check" ]; then
|
||||
# echo -e "${idsCL[Red]}Not Running${idsCL[Default]}"
|
||||
# fi
|
||||
# SENDNOTICE "${NM_HOSTNAMES[${nip}]}-${nip}" "${NM_SERVICES[${srvc}]} is down" 1
|
||||
# SENDNOTICE "${NM_HOSTNAMES[${nip}]}-${nip}" "${NM_SERVICE_DESC[${srvc}]} is down" 1
|
||||
# touch ${TMPFOLDER}/${nip}~${srvc}.down
|
||||
# echo "$(date) - ${nip} - ${NM_HOSTNAMES[${nip}]} - ${NM_SERVICES[${srvc}]} is down" >> ${LOGFILE}
|
||||
# echo "$(date) - ${nip} - ${NM_HOSTNAMES[${nip}]} - ${NM_SERVICE_DESC[${srvc}]} is down" >> ${LOGFILE}
|
||||
#
|
||||
# else
|
||||
# errtime=`date +%s`-$(stat -c %Y ${TMPFOLDER}/${nip}~${srvc}.down)
|
||||
@@ -302,8 +302,8 @@ STATUS(){
|
||||
# else
|
||||
# toterrtime=`date +%s`-$(stat -c %Y ${TMPFOLDER}/${nip}~${srvc}.down)
|
||||
# fi
|
||||
# SENDNOTICE "${NM_HOSTNAMES[${nip}]}-${nip}" "${NM_SERVICES[${srvc}]} is back UP! It was down for $(SHOW_TIME ${toterrtime})"
|
||||
# echo "$(date) - ${nip} - ${NM_HOSTNAMES[${nip}]} - ${NM_SERVICES[${srvc}]} is back up, it was down for $(SHOW_TIME ${toterrtime})" >> ${LOGFILE}
|
||||
# SENDNOTICE "${NM_HOSTNAMES[${nip}]}-${nip}" "${NM_SERVICE_DESC[${srvc}]} is back UP! It was down for $(SHOW_TIME ${toterrtime})"
|
||||
# echo "$(date) - ${nip} - ${NM_HOSTNAMES[${nip}]} - ${NM_SERVICE_DESC[${srvc}]} is back up, it was down for $(SHOW_TIME ${toterrtime})" >> ${LOGFILE}
|
||||
#
|
||||
# rm -f ${TMPFOLDER}/${nip}~${srvc}.down
|
||||
# rm -f ${TMPFOLDER}/${nip}~${srvc}.errtime
|
||||
|
||||
@@ -342,9 +342,11 @@ SERVICE(){
|
||||
if [ "${checkhost}" != "false" ]; then
|
||||
#$NCMD mount -a > /dev/null 2>&1
|
||||
if [ "${3}" != "q" ]; then
|
||||
if [[ "${NCHOSTS}" == *"${nip}"* ]]; then
|
||||
# if [[ "${NCHOSTS}" == *"${nip}"* ]]; then
|
||||
if [[ " ${NC_HOSTS[*]} " =~ " ${nip} " ]]; then
|
||||
mntpath="/mnt/Nextcloud-Data"
|
||||
elif [[ "${WEBHOSTS}" == *"${nip}"* ]]; then
|
||||
# elif [[ "${WEBHOSTS}" == *"${nip}"* ]]; then
|
||||
elif [[ " ${WEB_HOSTS[*]} " =~ " ${nip} " ]]; then
|
||||
mntpath="/mnt/web-data"
|
||||
fi
|
||||
${NCMD} "test -e ${mntpath}/mounted"
|
||||
@@ -417,7 +419,7 @@ SERVICE(){
|
||||
# fi
|
||||
|
||||
if [ "${3}" != "q" ]; then
|
||||
if [ "${NM_SERVICES[${1}]}" = "" ]; then
|
||||
if [ "${NM_SERVICE_DESC[${1}]}" = "" ]; then
|
||||
echo -e "${idsCL[Red]}(${1}) is not an allowed service.${idsCL[Default]}"
|
||||
exit 1
|
||||
fi
|
||||
@@ -432,7 +434,7 @@ SERVICE(){
|
||||
fi
|
||||
|
||||
echo
|
||||
echo -e "${idsCL[LightGreen]}[[ ${NM_SERVICES[${1}]} ${NM_SRVCOPTS[${2}]}ing ]]${idsCL[Default]}"
|
||||
echo -e "${idsCL[LightGreen]}[[ ${NM_SERVICE_DESC[${1}]} ${NM_SRVCOPTS[${2}]}ing ]]${idsCL[Default]}"
|
||||
echo -e "${idsCL[LightGreen]}-------------------------------------------${idsCL[Default]}"
|
||||
fi
|
||||
|
||||
@@ -577,7 +579,7 @@ SERVICE(){
|
||||
|
||||
if [ "${3}" != "q" ]; then
|
||||
echo
|
||||
echo -e "${idsCL[Green]}${NM_SERVICES[${1}]} has been ${NM_SRVCOPTS[${2}]}ed${idsCL[Default]}"
|
||||
echo -e "${idsCL[Green]}${NM_SERVICE_DESC[${1}]} has been ${NM_SRVCOPTS[${2}]}ed${idsCL[Default]}"
|
||||
echo
|
||||
fi
|
||||
}
|
||||
@@ -1028,8 +1030,8 @@ DOWNLIST(){
|
||||
host=${ditem%%~*}
|
||||
item=${ditem#*~}
|
||||
|
||||
if [[ $ditem == *"~"* ]] && [ "${NM_SERVICES[${item}]}" != "" ]; then
|
||||
itemname=${NM_SERVICES[${item}]}
|
||||
if [[ $ditem == *"~"* ]] && [ "${NM_SERVICE_DESC[${item}]}" != "" ]; then
|
||||
itemname=${NM_SERVICE_DESC[${item}]}
|
||||
elif [[ $ditem == *"~"* ]] && [ "${NM_DOCKERS[${item}]}" != "" ]; then
|
||||
itemname="${NM_DOCKERS[${item}]} (docker)"
|
||||
elif [[ $ditem == *"~"* ]] && [ "${REPL_DESC[${item}]}" != "" ]; then
|
||||
|
||||
Reference in New Issue
Block a user