How to find Websphere Version in python/jython scripts WAS

How to find WebsphereVersion(Exact build number) in python/jython scripts ?

The following lines of code will give the exact WAS version along with build number when used in a jython or python script.

wsadminNode = AdminControl.getNode()
print wsadminNode
wsadminSvr = AdminControl.queryNames("node="+wsadminNode+",type=Server,*")
print wsadminSvr
#wsadminVers = AdminControl.getAttribute(wsadminSvr, "platformVersion")
# The above line also gives us the WAS version but it will not give the exact build number details.
wsadminSvrON = AdminControl.makeObjectName(wsadminSvr)
wsadminVers = wsadminSvrON.getKeyProperty('version')
print  wsadminSvr

Hope this helps in finding the WAS versions in a jython/python script.

The above when run with script some times it throws the following error.
AppSrv01\bin>wsadmin.bat -conntype NONE -javaoption -Xmx384m -f  C:/kb/ -lang jython  -appServerName CDSServer  -logDir C:/kb -logFile test.log  -appFileName "C:\\kb\\test.txt"  -appName CDS -controlFile c:/kb/test.txt

2010-02-25 02:41:40 main ERROR ('Update of application failed:', , AdminControl service not available)

 The above error can be rectified by passing the hostname explicitly or else by changing the connection type to RMI and RMI port. When we run the above lines of code using connType none as below
./  -conntype NONE -javaoption -Xmx384m -f /opt/builds/ -lang jython  -appServerName CDSServer  -logDir /opt/builds -logFile test.log -appFileName /opt/builds/test.txt -appName CDS -controlFile /opt/IBM/WebSphere/AppServer/bin/testctrl.txt
It may through the error above we have seen
Solution for this will be
 -host with complete hostname or ipaddr is the alternate solution, since its a failure with Java
probably we can try  InetAddress.getAllByName(host)  in a standalone Java program and try to resolve it the same solution will apply to wsadmin as well.
Using Connection type RMI
./ -conntype RMI -port 2809 -lang jython -javaoption -Xmx384m -f /opt/builds/ -appServerName CDSServer  -logDir /opt/builds -logFile test.log -appFileName /opt/builds/test.txt -appName CDS -controlFile /opt/IBM/WebSphere/AppServer/bin/testctrl.txt
Using Host name and removing connection type NONE
./  -host -lang jython -javaoption -Xmx384m -f /opt/builds/ -appServerName CDSServer  -logDir /opt/builds -logFile test.log -appFileName /opt/builds/test.txt -appName CDS -controlFile /opt/IBM/WebSphere/AppServer/bin/testctrl.txt

P.S: To find the different connection types and ports used by the Websphere installation, try open the Administration console using the url http://:9060/ibm/console/ in browser.

1 comments to "How to find Websphere Version in python/jython scripts WAS"

Post a Comment

Who ever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs u can at least use Name/URL option which don’t even require any sign-in, good thing is that it can accept your lovely nick name also and URL is not mandatory too.
Thanks for your patience
~Krishna(I love "Transparency")
వీలయితే నాల్గు పోస్టులు ...కుదురితే ఒక కామెంటూ ...


Enter your email address:

Buffs ...


hits counter
View My StatsCheck Google Page Rank

Add to Google Reader or Homepage

Bookmark and Share


Powered by WidgetsForFree