Update nodemgmt-scripts.sh
This commit is contained in:
@@ -139,6 +139,35 @@ case "$1" in
|
|||||||
echo -e "${idsCL[Yellow]}-------------------------------------------------------------${idsCL[Default]}"
|
echo -e "${idsCL[Yellow]}-------------------------------------------------------------${idsCL[Default]}"
|
||||||
echo ""
|
echo ""
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
status-check)
|
||||||
|
nid=1
|
||||||
|
for nip in "${NODE_HOSTS[@]}"
|
||||||
|
do
|
||||||
|
if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then
|
||||||
|
nip='localhost'
|
||||||
|
NCMD=''
|
||||||
|
else
|
||||||
|
NCMD="ssh root@${nip}"
|
||||||
|
fi
|
||||||
|
for srvc in "${NODE_SERVICES[@]}"
|
||||||
|
do
|
||||||
|
if [ "${srvc}" = "mysql" ]; then SER='MySQL: '
|
||||||
|
elif [ "${srvc}" = "nginx" ]; then SER='NGINX: '
|
||||||
|
elif [ "${srvc}" = "gogs" ]; then SER='Gogs: '
|
||||||
|
elif [ "${srvc}" = "gitea" ]; then SER='Gitea: '
|
||||||
|
elif [ "${srvc}" = "haproxy" ]; then SER='HAProxy:'
|
||||||
|
elif [ "${srvc}" = "keepalived" ]; then SER='Keepalived:'
|
||||||
|
elif [ "${srvc}" = "maxscale" ]; then SER='MaxScale:'
|
||||||
|
else SER="${2}"
|
||||||
|
fi
|
||||||
|
if [ $(${NCMD} pgrep ${srvc} | wc -l) -lt "1" ]; then
|
||||||
|
echo "${SER} is down" | mail -s "iDS-Node${nid}-${nip}" 9208839613@vtext.com
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
nid=`expr $nid + 1`
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
|
||||||
set-permissions)
|
set-permissions)
|
||||||
nid=1
|
nid=1
|
||||||
|
|||||||
Reference in New Issue
Block a user