#!/usr/bin/ksh93 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # 61haes_r720 src/43haes/usr/sbin/cluster/sa/wmq/sbin/wmq_cvs.sh 1.5 # # Licensed Materials - Property of IBM # # COPYRIGHT International Business Machines Corp. 2011 # All Rights Reserved # # US Government Users Restricted Rights - Use, duplication or # disclosure restricted by GSA ADP Schedule Contract with IBM Corp. # # IBM_PROLOG_END_TAG # @(#)96 1.5 src/43haes/usr/sbin/cluster/sa/wmq/sbin/wmq_cvs.sh, hacmp, 61haes_r720, 1539B_hacmp720 9/10/15 18:00:37 #################################################################################### # # NAME: # wmq_cvs # # PURPOSE: # this is the custom verification script for the MQM. # and verifies the configuration information of specified MQM # on take over nodes of the MQM RG. # # ARGUMENTS: # # # RETURNS # 0 on success # 1 on Failure ###################################################################################################################### ############## #MAIN ############# [[ "$VERBOSE_LOGGING" == "high" ]] && set -x . /usr/es/sbin/cluster/sa/wmq/sbin/cl_wmq_Globals typeset MQM typeset TO_NODES typeset APPS typeset MQM_LUID typeset MQM_LGID typeset result=0 typeset app typeset mqm_name typeset MQM_RG typeset MQM_NODES APPS=$(clodmget -q "name=APPLICATION_NAME" -f value -n HACMPsa_metadata) #configured apps on local node. for app in $APPS do mqm_name=$(clodmget -q "application_id=$app" -f name HACMPsa_metadata | grep -w "MQM_NAME") if (( $? != 0 ));then continue fi MQM_RG=$(clodmget -n -q name="RESOURCE_GROUP and application_id=$app" -f value HACMPsa_metadata) MQM_NODES=$(clodmget -n -q "group=$MQM_RG" -f nodes HACMPgroup) if [[ " $MQM_NODES " == *+([[:space:]])$localnode+([[:space:]])* ]]; then MQM=$(clodmget -q "name=MQM_NAME and application_id=$app" -f value -n HACMPsa_metadata) TO_NODES=$(clodmget -q "name=TO_NODES and application_id=$app" -f value -n HACMPsa_metadata) MQM_LUID=$(lsuser -a id mqm) #mqm uid on local node MQM_LUID=$(echo $MQM_LUID |awk '{ FS="=";print $2}') MQM_LGID=$(lsgroup -a id mqm) #mqm gid on local node MQM_LGID=$(echo $MQM_LGID |awk '{ FS="=";print $2}') MQM_LVER=$(/usr/mqm/bin/dspmqver|grep Version) MQM_LVER=$(echo $MQM_LVER |awk '{ print $2 }') #MQ version on local node for node in $TO_NODES do cl_rsh $node "/usr/bin/su mqm -c "/usr/mqm/bin/dspmqinf $MQM"" > /dev/null 2>&1 [[ $? != 0 ]] && { KLIB_SA_logmsg ERROR 1 69 wmq_sa.cat "configuration information for the:%1\$s is not found on the node:%2\$s.\n" $MQM $node result=1 } MQM_UID=$(cl_rsh $node "lsuser -a id mqm") MQM_UID=$(echo $MQM_UID|awk '{ FS="=";print $2}') MQM_GID=$(cl_rsh $node "lsgroup -a id mqm") MQM_GID=$(echo $MQM_GID|awk '{ FS="=";print $2}') [[ $MQM_LUID != $MQM_UID ]] && { KLIB_SA_logmsg ERROR 1 70 wmq_sa.cat "The MQM user id on node: %1\$s is not same as on local node.\n" $node result=1 } [[ $MQM_LGID != $MQM_GID ]] && { KLIB_SA_logmsg ERROR 1 71 wmq_sa.cat "The MQM group id on node: %1\$s is not same as on local node.\n" $node result=1 } MQM_VER=$(cl_rsh $node "/usr/mqm/bin/dspmqver|grep Version") MQM_VER=$(echo $MQM_VER |awk '{ print $2 }') [[ $MQM_LVER != $MQM_VER ]] && { KLIB_SA_logmsg ERROR 1 72 wmq_sa.cat "The installed MQ version is different or Not installed on node:%1\$s.\n" $node result=1 } done else exit 0 fi done exit $result