- Tricks & Tips
- Other Features
Sunday, May 24, 2009
Here I am with new idea that colored output according to the state of the Server.
Hope most of you(WLA) knows WLST script for displaying Server status, my idea is when the server state is in SHUTDOWN state let it display in red color, STARTING state in YELLOW, and geen for RUNNING state and so on... colors you can specify as per your choice.
I ran thru google for searching colors in python... it is simple logic print instruction in python putting UNIX shell code way. The color code need to be prefix in the line where color need to appear in the output.
My choice of WLST is that it should have a provision to rerun the script if user wish to run the script after a while. this makes less time to get output because re-initializing of WLST is not required
#Fetch the state of the every WebLogic instance
for name in serverNames:
cd("/ServerLifeCycleRuntimes/" + name.getName())
serverState = cmo.getState()
if serverState == "RUNNING":
print 'Server ' + name.getName() + ' is :\033[1;32m' + serverState + '\033[0m'
elif serverState == "STARTING":
print 'Server ' + name.getName() + ' is :\033[1;33m' + serverState + '\033[0m'
elif serverState == "UNKNOWN":
print 'Server ' + name.getName() + ' is :\033[1;34m' + serverState + '\033[0m'
print 'Server ' + name.getName() + ' is :\033[1;31m' + serverState + '\033[0m'
While trouble shooting administrator need to check the status of all server instances. This is the basic need when the all the servers are...
When first time you started using WLST you might get many of these Python based WLST Errors. Here I had collected few of them which are ve...
Here I prepared few of the "Tips" and some commonly useful "Tricks" for developing the huge WLST scripts. These are all...
Configuring the datasource is one time activity for any project in production environment but where as for development or testing environmen...
This post is continous series of JMS configurations experimenting with Python. Here the JMS module configuration changes for the JMS wil...
Introducing Dynamism Hey all wise WLA welcome to this exclusive WLST blog again! My dear buddies, this week I was invited for a discuss...
This Script has ultimate goal to automate to one-step process for deploying the code onto WebLogic Development environments. Usually the ...
Effective programming could be developed using right decision making in your scripts. Here I would like to share some basics of Python prog...
--> Thread Pool count will give you the idea about the WebLogic Server instance throughput. First let us see how to monitor a serve...
" JDBC Monitoring " script, which I was published 2 days back works good for simple single data source and also multi datasources ...