Operating System - Tru64 Unix
1753882 Members
7230 Online
108809 Solutions
New Discussion юеВ

Re: Script for CAA script

 
Ajay Agarwal
Frequent Advisor

Re: Script for CAA script

Try returning different exit code from this script. If ping succeeds, then return 0 else return 1.

ping -c 1 -t 2 oracleapps >2&1
if [$? -eq 0]; then
...
exit 0
else
exit 1
fi

From your application action acript, check the return value of this script and then take the required action.
Vladimir Fabecic
Honored Contributor

Re: Script for CAA script

The problem is that script has to exit with status 0 in both cases.
If alias is up rsh commands should be executed, if alias is down, rsh commands should not be executed.
This script should be START_APPCMD script which should be executed from CAA script.
In vino veritas, in VMS cluster
Vladimir Fabecic
Honored Contributor

Re: Script for CAA script

This script works:
/apps/proddb/9.2.0/appsutil/scripts/PROD_axpcldb/addbctl.sh start
/apps/proddb/9.2.0/appsutil/scripts/PROD_axpcldb/addlnctl.sh start PROD
STATUS=`/usr/bin/caa_stat oracleapps | grep TARGET`
if test $STATUS = "TARGET=ONLINE" ; then
rsh oracleapps $HOME/stop_prodapp.sh
rsh oracleapps $HOME/start_prodapp.sh
echo $STATUS > /tmp/st.st
else
echo $STATUS > /tmp/st.st
fi

Still do not know what is wrong with script with "ping".
Thanks everybody.
In vino veritas, in VMS cluster