- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- Script for CAA script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2006 02:22 AM
02-21-2006 02:22 AM
Script for CAA script
I have the following envirement:
TRU64 cluster with two ES47 and EVA.
In normal condition first node has to run Oracle database and second Oracle Application server.
If one of members fail, other have to run both applications.
I made caa scripts and it is working OK, except one little thing: when relocating database, application server has to be restarted. Also, database has to be up when starting application server.
So I made a little script which does not work as it should.
The idea is to check if "oracleapps" cluster alias is up, and if so then do something (restart application server), otherwise do nothing. Problem with my script is that it sends wrong exit code to caa. Please help me and say what I did wrong.
Script (for starting database server):
# /bin/ksh
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
ping -c 1 -t 2 oracleapps
if [ $? -eq 0 ]; then
rsh oracleapps $HOME/stop_prodapp.sh
rsh oracleapps $HOME/start_prodapp.sh
fi
exit 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2006 07:40 PM
02-21-2006 07:40 PM
Re: Script for CAA script
Check your CAA action script to check if you are returning with correct exit code. Try executing the action script from the command line and check the return value (echo $?).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2006 08:01 PM
02-21-2006 08:01 PM
Re: Script for CAA script
This is a script for database startup.
When executed manually, it works. It also works with caa_start when cluster alias oracleapps is up (when $? is 0).
Problem is when cluster alias is down. In that case script must not execute rsh commands. Script does go to "fi" but returns non zero exit code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2006 09:18 PM
02-21-2006 09:18 PM
Re: Script for CAA script
I am wondering if the script reached till that point when the alias was down...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2006 11:06 PM
02-21-2006 11:06 PM
Re: Script for CAA script
I do not need "else ..." , but have tried it. No luck.
I can not see where is the problem.
Maybe to replace "ping" with something else?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 12:27 AM
02-22-2006 12:27 AM
Re: Script for CAA script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 12:46 AM
02-22-2006 12:46 AM
Re: Script for CAA script
I tried to execute the script outside CAA daemon. And it did the job. And "echo $?" returns 0. But when started inside CAA deamon, it fails.
If I comment lines from "ping ..." till end, script works fine inside CAA daemon.
Any other idea how to check if alias oracleapps is up (instead of ping)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 01:43 AM
02-22-2006 01:43 AM
Re: Script for CAA script
What if you remove the exit 0 from the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 01:53 AM
02-22-2006 01:53 AM
Re: Script for CAA script
Yes,if the nodes are down, the rsh will take a long time to finish (and return wrong status). So I must use "if ..."
First version of that script was without "exit 0". No difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 02:55 PM
02-22-2006 02:55 PM
Re: Script for CAA script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 04:05 PM
02-22-2006 04:05 PM
Re: Script for CAA script
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2006 01:05 AM
02-23-2006 01:05 AM
Re: Script for CAA script
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2006 06:12 PM
02-23-2006 06:12 PM
Re: Script for CAA script
/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.