Question : Cluster Status

Hi ,
I got  this exception.
WASX7017E: Exception received while running file "clusterstatus.py"; exception i                                             nformation: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  (no code object) at line 0
  File "", line 9
        clusterObject = AdminControl.completeObjectName("type=Cluster,name="+clu                                             sterName+",*" )
        ^
SyntaxError: invalid syntax.

Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
i = 0
clusterName = sys.argv[i]
clusterId = AdminConfig.getid("/ServerCluster:"+clusterName+"/" )
print "ClusterName is: "+clusterName
 
if (len(clusterId) != 0):
clusterObject = AdminControl.completeObjectName("type=Cluster,name="+clusterName+",*" )
clusterStatus = AdminControl.getAttribute(clusterObject, "state" )
print "clusterStatus="+clusterStatus 
running = "websphere.cluster.running"
partialstart = "websphere.cluster.partial.start"
starting = "websphere.cluster.starting"
stopped = "websphere.cluster.stopped"
 
if (cmp(clusterStatus, starting) == 0):
print "starting"
sys.exit()
#endIf 
 
if (cmp(clusterStatus, stopped) == 0):
print "stopped"
sys.exit()
 
#endIf 
 
if (cmp(clusterStatus, running) == 0):
print "running"
sys.exit()
 
#endIf 
 
if (cmp(clusterStatus, partialstart) == 0):
print "partialstart "
sys.exit()
 
#endIf 
 
 
else:
print "Error"
#endElse

Answer : Cluster Status

>> From that script  how can i start the cluster if the cluster is stopped.

  The script requires the Deployment Manager (DM) and the associated NodeAgents (NAs) to be active in order to run.

  If the DM is inactive, then wsadmin can't connect to it.
  If the associated NAs are inactive, then the Server Manager MBeans are unavailable, and the managed Application Servers are unreachable by the DM.

  Does this help?
Random Solutions  
 
programming4us programming4us