WebSphere‎ > ‎

WPS Cluster

WPS Cluster Status

After searching on the internet for the existing scripts for the WPS cluster status,  I found Steve Robinson's site with Jython script. He suggested  the user to enter the cluster name as a command line argument.I also found a jython script from  IBM DeveloperWorks forums, where the script contains cell name hard-coded. To execute the script we need to know the cell name of their WPS environment. My idea here is to make a generic script, that is,  without giving these two inputs after connecting to the DeploymentManager cannot we fetch the status of the cluster? Strugled for two hours to articulate the facts about the JMX runtime beans, that will gives us the status. This is initial step to monitor a WebSphere Process Server.
This automation Jython script will help WPS Developer/Administrators who wish to check the cluster status without connecting to WebSphere console.

  • Human errors can be eliminated no need to remember Cellname, ClusterName
  • For multi-clustered Websphere environment, clusters can be monitored faster

Jython Script

Script File : clustrStat.py

cellName=AdminConfig.showAttribute(cell, 'name')
x=AdminConfig.list('ServerCluster', AdminConfig.getid( '/Cell:'+cellName+'/')).split('\n')
for c in x:
        clusterId = AdminConfig.getid("/ServerCluster:"+cl+"/" )
        print "ClusterName is: "+cl
        if (len(clusterId) != 0):
                clusterObject = AdminControl.completeObjectName("type=Cluster,name="+cl+",*" )
                clusterStatus = AdminControl.getAttribute(clusterObject, "state" )
                print "clusterStatus="+ clusterStatus

Invoking Jython Script

Please replace user, password as per your environment,

Script File: clustrStat.sh

wsadmin.sh -lang jython -f clustrStat.py -user <user> -password <password>

Output resulted as follows:

$ clustrStat.sh
Mon Jun 25 04:57:15 EDT 2012
WASX7209I: Connected to process "dmgr" on node zqMywps01CellManager01 using SOAP connector;  The type of process is: DeploymentManager
ClusterName is: Mywps.AppTarget
ClusterName is: Mywps.Messaging
Mon Jun 25 05:01:11 EDT 2012

Labels: WebSphere Cluster Status,  Jython Script for Monitoring Cluster, IBM WebSphere Process Server, WebSphere Application Server

Pavan BhavaniShekhar Devarakonda,
Jun 25, 2012, 3:12 AM