This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes Check the Cluster status before start the cluster using WLST Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Check the Cluster status before start the cluster using WLST " Watch "Check the Cluster status before start the cluster using WLST " New topic
Author

Check the Cluster status before start the cluster using WLST

Brahma Kolagani
Greenhorn

Joined: Nov 27, 2009
Posts: 2
Hi,
I am beginner in writing WLST script, I'm using WebLogic 10.3. and trying to write a WLST script that will start my cluster. but before start the cluster, I need to check the status of cluster and based on the result(running or studown on cluster level ) then start the cluster if it is down else say cluster is already running.
So, Does anyone have solution that will check the status before start the cluster?. I appreciate your help.

Thanks
Brahma.
Pavan BhavaniShekhar
Greenhorn

Joined: Nov 16, 2006
Posts: 9
Hi
1. Connect to your admin URL
2.
3. Hope your domain using NodeManager call the start on the cluster

Further any more info revert back


Thanks & regards<br />Pavan BS Devarakonda<br />WebLogic Admin<br />Hyderabadi
Brahma Kolagani
Greenhorn

Joined: Nov 27, 2009
Posts: 2
Hi Pavan,

Thank you for your help. I guess, if we run the command- state(clusterName, "httpTransPort") the output should be like

There are 2 server(s) in cluster: httpTransport

States of the servers are
httpTransport2---SHUTDOWN
httpTransport1---RUNNING.


But I am looking the status from cluster level just kind of RUNNING or SHUTDOWN. So, i can use the return value and run the below condition.

statusStopped=`java weblogic.WLST cluster_status.py | grep SHUTDOWN`
DEBUG echo "Status: status=$statusStopped"
#If statusStopped is null then it must be running or partially started

if [ "$statusStopped" = "SHUTDOWN" ]
then
DEBUG echo "Status: Cluster $clusterName is stopped."
DEBUG echo -e "\nStatus: Cluster $clusterName is stopped." >> ${outputLog1}
exit 0
else
statusRunning=`java weblogic.WLST cluster_status.py | grep RUNNING`
if [ "$statusRunning" = "RUNNING" ]
then
DEBUG echo "Success: Cluster $clusterName is running"
DEBUG echo -e "\nSuccess: Cluster $clusterName is running" >> ${outputLog1}
exit 0

else
DEBUG echo "Falure: Error when calling cluster_status.py and please contact Middleware oncall person."
DEBUG echo -e "\nFalure: Error when calling cluster_status.py and please contact Middleware oncall person." >> ${outputLog1}
exit 1

fi

fi


I appreciate your help.
Pavan BhavaniShekhar
Greenhorn

Joined: Nov 16, 2006
Posts: 9
In Python you can send mail too If you want to send alert message to mobile.
It is almost similar to shell script with more comfort so why you need 2 scripts instead of single python script can do.
All the above mentioned logic you can have in python script too right??
 
jQuery in Action, 2nd edition
 
subject: Check the Cluster status before start the cluster using WLST
 
Similar Threads
WebLogic Clustering
ANT for prod deployment
Trouble running a WLST snippet
Application Servers and ANT
WLST command to restart cluster?