当前位置:文档之家› 使用脚本编制来管理服务器和节点

使用脚本编制来管理服务器和节点

任务主题
最近更新日期:
http://publib.boulder.ibm
任务主题
最近更新日期:
http://publib.boulder.ibm
Application Server, V6.0.x 操作系统:
任务主题
最近更新日期:
http://publib.boulder.ibm
Application Server, V6.0.x 操作系统:
"----------------------------------------------------"
44 puts ""
45
46 }
47 }
48 }
使用 Jython:
* Provide this example as a Jython script file and run it with the "-f" option:
1 #----------------------------------------------------------------
2 # lines 7 and 8 find all the cell and process them one at a time
3 #----------------------------------------------------------------
4 # get line separator
5 import ng.System as sys
6 lineSeparator = sys.getProperty('line.separator')
7 cells = AdminConfig.list('Cell').split(lineSeparator)
8 for cell in cells:
9 #----------------------------------------------------------------
10 # lines 13 and 14 find all the nodes belonging to the cell and
11 # process them at a time
12 #-----------------------------------------------------------------
13 nodes = AdminConfig.list('Node', cell).split(lineSeparator)
14 for node in nodes:
15 #--------------------------------------------------------------
16 # lines 19-23 find all the running servers belonging to the cell
17 # and node, and process them one at a time
18
#--------------------------------------------------------------
19 cname = AdminConfig.showAttribute(cell, 'name')
20 nname = AdminConfig.showAttribute(node, 'name')
21 servs = AdminControl.queryNames('type=Server,cell=' + cname + ',node=' + nname + ',*').split(lineSeparator)
22 print "Number of running servers on node " + nname + ": %s
\n" % (len(servs))
23 for server in servs:
24 #---------------------------------------------------------
25 # lines 28-34 get some attributes from the server to display;
26 # invoke an operation on the server JVM to display a property.
27 #---------------------------------------------------------
28 sname = AdminControl.getAttribute(server, 'name')
29 ptype = AdminControl.getAttribute(server, 'processType')
30 pid = AdminControl.getAttribute(server, 'pid')
31 state = AdminControl.getAttribute(server, 'state')
32 jvm = AdminControl.queryNames('type=JVM,cell='
+
cname + ',node=' + nname + ',process=' + sname + ',*')
33 osname = AdminControl.invoke(jvm, 'getProperty',
'')
34 print " " + sname + " " + ptype + " has pid " + pid + "; state: " + state + "; on " +
osname + "\n"
3536 #---------------------------------------------------------37 # line 40-45 find the applications running on this server and
38 # display the application name.
39 #---------------------------------------------------------
40 apps = AdminControl.queryNames('type=Application,cell=' +
Cname + ',node=' + nname + ',process=' + sname + ',*').
split(lineSeparator)
41 print "Number of applications running on " + sname + ":
%s \n" % (len(apps))
42 for app in apps:
43 aname = AdminControl.getAttribute(app, 'name')
44 print aname + "\n"
任务主题
最近更新日期:
http://publib.boulder.ibm
Application Server, V6.0.x 操作系统:
任务主题
最近更新日期:
http://publib.boulder.ibm
使用脚本设置服务器对象的开发方式/infocenter/wasinfo/v6r0/to...
Application Server, V6.0.x
操作系统:
任务主题
最近更新日期:
http://publib.boulder.ibm
任务主题
最近更新日期:
http://publib.boulder.ibm
任务主题
最近更新日期:
http://publib.boulder.ibm。

相关主题