diff --git a/controllers/brokerscripts/readiness_check.sh b/controllers/brokerscripts/readiness_check.sh index 6e4827c..cc145db 100644 --- a/controllers/brokerscripts/readiness_check.sh +++ b/controllers/brokerscripts/readiness_check.sh @@ -173,6 +173,32 @@ if [ "${BROKER_REDUNDANCY}" = "true" ]; then rm -f ${FINAL_ACTIVITY_LOGGED_TRACKING_FILE}; exit 1 fi fi + broker_version=$(/mnt/disks/solace/semp_query.sh -n admin -p ${password} -u http://localhost:8080 \ + -q "" \ + -v "/rpc-reply/rpc/show/version/current-load[text()]") + broker_version=`echo ${broker_version} | xmllint -xpath "string(returnInfo/valueSearchResult)" - | cut -d'.' -f2` + if [[ "${broker_version}" -ge 8 ]]; then + # DMR cluster operation state + cluster_status=$(/mnt/disks/solace/semp_query.sh -n admin -p ${password} -u http://localhost:8080 \ + -q "*" \ + -v "/rpc-reply/rpc/show/cluster/clusters/cluster/oper-up[text()]") + cluster_status=`echo ${cluster_status} | xmllint -xpath "string(returnInfo/valueSearchResult)" -` + if [ "${cluster_status}" != "true" ] && [ "${cluster_status}" != "" ]; then + echo "$(date) INFO: ${APP}-DMR cluster operational state is down" + exit 1 + fi + fi + if [[ "${broker_version}" -ge 11 ]]; then + # DMR sync state + cluster_sync_status=$(/mnt/disks/solace/semp_query.sh -n admin -p ${password} -u http://localhost:8080 \ + -q "*" \ + -v "/rpc-reply/rpc/show/cluster/clusters/cluster/sync-complete[text()]") + cluster_sync_status=`echo ${cluster_sync_status} | xmllint -xpath "string(returnInfo/valueSearchResult)" -` + if [ "${cluster_sync_status}" != "true" ] && [ "${cluster_sync_status}" != "" ]; then + echo "$(date) INFO: ${APP}-DMR cluster is not in-sync" + exit 1 + fi + fi # Pass readiness check if [ ! -f ${FINAL_ACTIVITY_LOGGED_TRACKING_FILE} ]; then echo "$(date) INFO: ${APP}-Redundancy is up and node is Mate Active"