cat <<-'EOF' > get_cluster_status.sh
#!/bin/bash
HOSTMEI=$1
BEAF=$2
echo "[$(date '+%Y/%m/%d %H:%M:%S')] job start" | tee -a /tmp/get_cluster_status_$(date '+%Y%m').log
ssh ${HOSTMEI} "sudo su - -c '/u01/app/19.0.0/grid/bin/crsctl stat res -t'" > /tmp/get_cluster_status_${BEAF}.tmp
RET=$?
if [ ${RET} -ne 0 ] ; then
echo "[$(date '+%Y/%m/%d %H:%M:%S')] job error( ${RET} )" | tee -a /tmp/get_cluster_status_$(date '+%Y%m').log
exit 100
fi
echo "[$(date '+%Y/%m/%d %H:%M:%S')] job end" | tee -a /tmp/get_cluster_status_$(date '+%Y%m').log
exit 0
EOF
cat get_cluster_status.sh
chmod +x get_cluster_status.sh
./get_cluster_status.sh mmdb131 before
./get_cluster_status.sh mmdb131 after
cat /tmp/get_cluster_status_$(date '+%Y%m').log
cat /tmp/get_cluster_status_before.tmp
cat /tmp/get_cluster_status_after.tmp