Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Check the Cluster status before start the cluster using WLST

 
Brahma Kolagani
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Brahma Kolagani
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic