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 42 43 44 45 46 47 48 49 50 51 52
| #----------------------------------------------------------------
# Display status info
#----------------------------------------------------------------
def displayStatusFunc ( ):
#----------------------------------------------------------------
# Find all the cell and process them one at a time
#----------------------------------------------------------------
cells = AdminConfig.list("Cell" )
cells = wsadminToList(cells)
for cell in cells:
#-----------------------------------------------------------------------
# Find all the nodes belonging to the cell and
# process them at a time
#-----------------------------------------------------------------------
nodes = AdminConfig.list("Node", cell )
nodes = wsadminToList(nodes)
print ""
print "Server STATE PID AppServer Applications"
print "====== ===== === ========= ============"
for node in nodes:
#--------------------------------------------------------------
# Find all the running servers belonging to the cell
# and node, and process them one at a time
#--------------------------------------------------------------
cname = AdminConfig.showAttribute(cell, "name" )
nname = AdminConfig.showAttribute(node, "name" )
servs = AdminConfig.list("Server", node )
servs = wsadminToList(servs)
for serv in servs:
#---------------------------------------------------------
# Get some attributes from the server to display;
# invoke an operation on the server JVM to display a property.
#---------------------------------------------------------
sname = AdminConfig.showAttribute(serv, "name" )
server = AdminControl.queryNames("type=Server,cell="+cname+",node="+nname+",process="+sname+",*" )
if (len(server) == 0):
# Get Cluster Name
clusterName = AdminConfig.showAttribute(serv, "clusterName" )
if (len(clusterName) !=0):
variableSubstitutionEntries = AdminConfig.getid("/ServerCluster:"+clusterName+"/VariableMap:/VariableSubstitutionEntry:/")
if (len(variableSubstitutionEntries) != 0):
variableSubstitutionEntries = wsadminToList(variableSubstitutionEntries)
for variableSubstitutionEntry in variableSubstitutionEntries:
varName1 = AdminConfig.showAttribute(variableSubstitutionEntry, "symbolicName" )
# Check if it is a active cluster of two cells
if (cmp(varName1, "ACTIVE_CLUSTER") == 0):
activeClusterState = AdminConfig.showAttribute(variableSubstitutionEntry, "value" )
break
#endIf
#endFor
else:
activeClusterState = "true" |
Partager