#!/bin/ksh93 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # 61haes_r720 src/43haes/usr/sbin/cluster/sa/tsmclient/sbin/cl_tsm_client_query.sh 1.2 # # Licensed Materials - Property of IBM # # COPYRIGHT International Business Machines Corp. 2010 # 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 # @(#)60 1.2 src/43haes/usr/sbin/cluster/sa/tsmclient/sbin/cl_tsm_client_query.sh, hacmp.assist, 61haes_r720, 1541B_hacmp720 10/5/15 12:20:12 ############################################################################################### # # NAME: # cl_tsm_client_query # # PURPOSE: # Discover PowerHA SystemMirror configuration for TSM client. This script is used in SMIT # discovery and list screens. # # ARGUMENTS: # -f dir of the client dsm.opt # -q Application_id # -c discovers application name and local node name # # RETURNS # 0 on success # 1 on Failure # ################################################################################################# [[ "VERBOSE_LOGGING" == "high" ]] && set -x . /usr/es/sbin/cluster/sa/tsmclient/sbin/cl_tsmcliGlobals . /usr/es/sbin/cluster/sa/tsmclient/sbin/cl_tsmcliUtilities typeset dir application_id prim while getopts f:q:c opt do case $opt in f)#list the file systems from dsm.opt file dir=$OPTARG ;; q)#SMIT output for modifying TSM client Smart Assist application_id=$OPTARG ;; c)#SMIT output for application name and primary node prim="y" ;; esac done #Discovery for filesystem list from dsm.opt [[ -n $dir ]] && { [[ -f $dir/dsm.opt ]]|| exit 1 temp=$(cat $dir/dsm.opt|grep domain|sed "s/domain //g") conf_fs=$(dir_fs_vg $dir 1) temp=$(echo "$temp $conf_fs") list=$(echo $temp|sed 's/ /\\n/g') echo $list|sort -u exit 0 } #Discovery for Application and local node name [[ -n $prim ]] && { echo "#application_name:primary" local_node=$(get_local_nodename) echo "tsmclient_"$local_node":"$local_node exit 0 } #Discovery for modifying the smart assit application [[ -n $application_id ]] && { echo "#configdir:primary:takeover:sharedFS:serviceip:prefix:hsm" rg=$(clodmget -q "name=RESOURCE_GROUP and application_id=$application_id" -f value -n HACMPsa_metadata) [[ -z $rg ]]&& exit 1 nodes=$(clvt query resource_group $rg | grep -w NODES|awk -F= '{ print $2 }' | sed -e "s/\"//g") shared_fs=$(clodmget -q "name=SHARED_FILESYSTEM and application_id=$application_id" -f value -n HACMPsa_metadata) serviceip=$(clvt query resource_group $rg | grep SERVICE_LABEL|awk -F= '{ print $2 }' | sed -e "s/\"//g") prefix=$(clodmget -q "ip_label=$serviceip" -f netmask -n HACMPadapter) hsm=$(clodmget -q "name=HSM_CLIENT and application_id=$application_id" -f value -n HACMPsa_metadata) shared_dir=$(clodmget -q "name=TSM_CONF_DIR and application_id=$application_id" -f value -n HACMPsa_metadata) takeover="" primary="" for n in $nodes do if [[ -z $primary ]] then primary=$n else takeover=$(echo "$takeover $n") fi done echo $shared_dir":"$primary":"$takeover":"$shared_fs":"$serviceip":"$prefix":"$hsm exit 0 }