update
This commit is contained in:
@@ -130,6 +130,7 @@ case "$1" in
|
|||||||
if [ "${srvc}" = "mysql" ]; then SER='MySQL: '
|
if [ "${srvc}" = "mysql" ]; then SER='MySQL: '
|
||||||
elif [ "${srvc}" = "nginx" ]; then SER='NGINX: '
|
elif [ "${srvc}" = "nginx" ]; then SER='NGINX: '
|
||||||
elif [ "${srvc}" = "gogs" ]; then SER='Gogs: '
|
elif [ "${srvc}" = "gogs" ]; then SER='Gogs: '
|
||||||
|
elif [ "${srvc}" = "gitea" ]; then SER='Gitea: '
|
||||||
elif [ "${srvc}" = "haproxy" ]; then SER='HAProxy:'
|
elif [ "${srvc}" = "haproxy" ]; then SER='HAProxy:'
|
||||||
elif [ "${srvc}" = "keepalived" ]; then SER='Keepalived:'
|
elif [ "${srvc}" = "keepalived" ]; then SER='Keepalived:'
|
||||||
elif [ "${srvc}" = "maxscale" ]; then SER='MaxScale:'
|
elif [ "${srvc}" = "maxscale" ]; then SER='MaxScale:'
|
||||||
|
|||||||
53
run.sh
53
run.sh
@@ -5,44 +5,33 @@ source /opt/idssys/nodemgmt/settings.conf
|
|||||||
source /opt/idssys/defaults/colors.inc
|
source /opt/idssys/defaults/colors.inc
|
||||||
# source /opt/idssys/defaults/default.inc
|
# source /opt/idssys/defaults/default.inc
|
||||||
VERS=`mysql -h 10.5.10.56 -P 3308 -u sqluser -pdcs2057 -s -N -e "SELECT value FROM idssys.nodemgmt WHERE var = 'VERS'"`
|
VERS=`mysql -h 10.5.10.56 -P 3308 -u sqluser -pdcs2057 -s -N -e "SELECT value FROM idssys.nodemgmt WHERE var = 'VERS'"`
|
||||||
|
NODE_SERVICES=mysql,nginx,gitea,haproxy,keepalived,maxscale
|
||||||
|
IFS=,
|
||||||
|
NODE_SERVICES=(${NODE_SERVICES})
|
||||||
|
unset IFS
|
||||||
|
|
||||||
if [ "$1" != "service" ] && [ "$1" != "status" ] && [ "$1" != "" ]; then
|
if [ "$1" != "service" ] && [ "$1" != "status" ] && [ "$1" != "" ]; then
|
||||||
if [ $(pgrep mysql | wc -l) -gt "0" ]; then
|
|
||||||
SER_MYSQL="${idsCL[Green]}Running${idsCL[Default]}"
|
|
||||||
else SER_MYSQL="${idsCL[Red]}Not Running${idsCL[Default]}"
|
|
||||||
fi
|
|
||||||
if [ $(pgrep haproxy | wc -l) -gt "0" ]; then
|
|
||||||
SER_HAP="${idsCL[Green]}Running${idsCL[Default]}"
|
|
||||||
else SER_HAP="${idsCL[Red]}Not Running${idsCL[Default]}"
|
|
||||||
fi
|
|
||||||
if [ $(pgrep nginx | wc -l) -gt "0" ]; then
|
|
||||||
SER_NGINX="${idsCL[Green]}Running${idsCL[Default]}"
|
|
||||||
else SER_NGINX="${idsCL[Red]}Not Running${idsCL[Default]}"
|
|
||||||
fi
|
|
||||||
if [ $(pgrep keepalived | wc -l) -gt "0" ]; then
|
|
||||||
SER_KA="${idsCL[Green]}Running${idsCL[Default]}"
|
|
||||||
else SER_KA="${idsCL[Red]}Not Running${idsCL[Default]}"
|
|
||||||
fi
|
|
||||||
if [ $(pgrep gogs | wc -l) -gt "0" ]; then
|
|
||||||
SER_GOGS="${idsCL[Green]}Running${idsCL[Default]}"
|
|
||||||
else SER_GOGS="${idsCL[Red]}Not Running${idsCL[Default]}"
|
|
||||||
fi
|
|
||||||
if [ $(pgrep maxscale | wc -l) -gt "0" ]; then
|
|
||||||
SER_MS="${idsCL[Green]}Running${idsCL[Default]}"
|
|
||||||
else SER_MS="${idsCL[Red]}Not Running${idsCL[Default]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${idsCL[Yellow]} NodeMgmt - Galera/NGINX Node Management${idsCL[Default]} ${idsCL[DarkGray]}(ver-${VERS})${idsCL[Default]}"
|
echo -e "${idsCL[Yellow]} NodeMgmt - Galera/NGINX Node Management${idsCL[Default]} ${idsCL[DarkGray]}(ver-${VERS})${idsCL[Default]}"
|
||||||
echo -e "${idsCL[Yellow]}-------------------------------------------------------------${idsCL[Default]}"
|
echo -e "${idsCL[Yellow]}-------------------------------------------------------------${idsCL[Default]}"
|
||||||
echo -e "Node hostname: ${node_hostname}"
|
echo -e "Node hostname: ${node_hostname}"
|
||||||
echo -e "MySQL: ${SER_MYSQL}"
|
for srvc in "${NODE_SERVICES[@]}"
|
||||||
echo -e "NGINX: ${SER_NGINX}"
|
do
|
||||||
echo -e "Gogs: ${SER_GOGS}"
|
if [ "${srvc}" = "mysql" ]; then SER='MySQL: '
|
||||||
echo -e "HAProxy: ${SER_HAP}"
|
elif [ "${srvc}" = "nginx" ]; then SER='NGINX: '
|
||||||
echo -e "Keepalived: ${SER_KA}"
|
elif [ "${srvc}" = "gogs" ]; then SER='Gogs: '
|
||||||
echo -e "MaxScale: ${SER_MS}"
|
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
|
||||||
|
echo -en "${SER} "
|
||||||
|
if [ $(pgrep ${srvc} | wc -l) -gt "0" ]; then
|
||||||
|
echo -e "${idsCL[Green]}Running${idsCL[Default]}"
|
||||||
|
else echo -e "${idsCL[Red]}Not Running${idsCL[Default]}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
echo -e "${idsCL[Yellow]}-------------------------------------------------------------${idsCL[Default]}"
|
echo -e "${idsCL[Yellow]}-------------------------------------------------------------${idsCL[Default]}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user