This commit is contained in:
2022-11-26 12:12:26 -06:00
parent c6a9580b51
commit fa8190d302
2 changed files with 20 additions and 1 deletions

View File

@@ -27,6 +27,19 @@ FOLDER=/opt/idssys/nodemgmt
SCRIPT=${FOLDER}/nodemgmt-scripts.sh
RENOTIFY=900
declare -A NM_HOSTNAMES
NM_HOSTNAMES['10.10.1.121']='Webserver-Node1'
NM_HOSTNAMES['10.10.1.122']='Webserver-Node2'
NM_HOSTNAMES['10.10.1.51']='MySQL-Node1'
NM_HOSTNAMES['10.10.1.52']='MySQL-Node2'
NM_HOSTNAMES['10.10.10.81']='LB-Node1'
NM_HOSTNAMES['10.10.10.82']='LB-Node2'
NM_HOSTNAMES['10.10.10.42']='Nextcloud-Server'
NM_HOSTNAMES['159.203.158.51']='PowerDNS-Node1'
NM_HOSTNAMES['146.190.1.194']='PowerDNS-Node3'
NM_HOSTNAMES['10.10.10.50']='MySQL-Manager'
declare -i errtime
IFS=,

View File

@@ -1700,6 +1700,7 @@ SERVICE(){
nid=1
if [ "${3}" != "" ]; then
var2=(${3})
sethost=true;
else
var2=${NTYPE}_HOSTS[@]
IFS=' '
@@ -1712,6 +1713,11 @@ SERVICE(){
# else GO=false;
# fi
# if [ "${GO}" == "true" ]; then
if [ $sethost == true ]; then
nodename=${NM_HOSTNAMES['${3}']};
else
nodename="${NM_NODETYPES[$NTYPE]}-Node${nid}";
fi
if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then
nip='localhost '
NCMD=''
@@ -1728,7 +1734,7 @@ SERVICE(){
if [ "${NOGOCHK}" == "true" ]; then
if [ "${3}" != "q" ]; then
echo -en "${NM_SRVCOPTS[${2}]}ing on ${NM_NODETYPES[$NTYPE]}-Node${nid} ($nip)... ${idsCL[Default]}"
echo -en "${NM_SRVCOPTS[${2}]}ing on ${nodename} ($nip)... ${idsCL[Default]}"
fi
checkhost=$(CHECK_HOST ${nip})
if [ "${checkhost}" != "false" ]; then