From e21e2bfb315910f5e2684d33d61226573fa3f39b Mon Sep 17 00:00:00 2001 From: Rakesh Venkatesh Date: Thu, 5 Nov 2020 09:31:16 +0100 Subject: [PATCH] Check all mgt server connectivity Currently ssvm checks connectivity only for one mgt server. Since we can have multiple mgt servers using comma separated list, make the change in script so that it checks for connectivity for all mgt servers --- systemvm/agent/scripts/ssvm-check.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/systemvm/agent/scripts/ssvm-check.sh b/systemvm/agent/scripts/ssvm-check.sh index c549818d103d..850e71d275f6 100644 --- a/systemvm/agent/scripts/ssvm-check.sh +++ b/systemvm/agent/scripts/ssvm-check.sh @@ -118,15 +118,19 @@ fi # check for connectivity to the management server echo ================================================ echo Management server is $MGMTSERVER. Checking connectivity. -socatout=$(echo | socat - TCP:$MGMTSERVER:8250,connect-timeout=3 | tr -d '\0' 2>&1) -if [ $? -eq 0 ] -then - echo "Good: Can connect to management server port 8250" -else - echo "ERROR: Cannot connect to $MGMTSERVER port 8250" - echo $socatout - exit 4 -fi +IFS=',' read -r -a hosts <<< "$MGMTSERVER" +for host in "${hosts[@]}" +do + socatout=$(echo | socat - TCP:$host:8250,connect-timeout=3 | tr -d '\0' 2>&1) + if [ $? -eq 0 ] + then + echo "Good: Can connect to management server $host port 8250" + else + echo "ERROR: Cannot connect to $host port 8250" + echo $socatout + exit 4 + fi +done # check for the java process running