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 | #(c)copyright 2005 # sample code - not supported # get help with this command in interactive mode: AdminConfig.help() server1=AdminConfig.getid('/Node:tux1Node01/Server:server1/') print server1 jvm = AdminConfig.list('JavaVirtualMachine', server1) print ">>>>> variable jvm is" print jvm print ">>>>> AdminConfig.show(jvm)" print AdminConfig.show(jvm) print ">>>>> change jvm settings" AdminConfig.modify(jvm, [['verboseModeGarbageCollection','true' ]] ) AdminConfig.save() print ">>>>> after save:" print AdminConfig.show(jvm) # on my system the output of verbose gc is in the file: # /opt/IBM/WebSphere/AppServer/profiles/default/logs/server1/native_stderr1.log # your milage may vary if you change the log locations # # note - when using jython you must use the string 'true', see below. # #wsadmin>AdminConfig.modify(jvm, [['verboseModeGarbageCollection', 0 ]] ) #WASX7435W: Value 0 is converted to a boolean value of false. #'' #wsadmin>AdminConfig.modify(jvm, [['verboseModeGarbageCollection', 1 ]] ) #WASX7435W: Value 1 is converted to a boolean value of false. #'' |
1 2 3 4 5 6 7 8 9 10 11 12 | <AF[14]; Allocation Failure. need 528 bytes, 6893 ms since last AF> <AF[14]; managing allocation failure, action=1 (0/183731208) (1668600/1668600)> <GC(14); freeing class sun.reflect.GeneratedMethodAccessor18(0x102391b8)> <GC(14); freeing class sun.reflect.GeneratedFieldAccessor1(0x104e9f48)> ..... lines deleted...... <GC(14); freeing class sun.reflect.GeneratedFieldAccessor19(0x10129030)> <GC(14); unloaded and freed 20 classes> <GC(14); GC cycle started Tue Dec 27 16;18;13 2005 <GC(14); freed 77240288 bytes, 42% free (78908888/185399808), in 436 ms> <GC(14); mark; 396 ms, sweep; 40 ms, compact; 0 ms> <GC(14); refs; soft 52 (age > 6), weak 89, final 88, phantom 0> <AF[14]; completed in 456 ms> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #(c)copyright 2005 # sample code - not supported #AdminConfig.help() server1=AdminConfig.getid('/Node:tux1Node01/Server:server1/') print server1 jvm = AdminConfig.list('JavaVirtualMachine', server1) print ">>>>> variable jvm is" print jvm print ">>>>> AdminConfig.show(jvm)" print AdminConfig.show(jvm) print ">>>>> change jvm settings" AdminConfig.modify(jvm, [['initialHeapSize', 512 ], ['maximumHeapSize', 1024 ]]) print ">>>>> AdminConfig.show(jvm)" print AdminConfig.show(jvm) AdminConfig.save() |
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 | #(c)copyright 2005 # sample code - not supported server1=AdminConfig.getid('/Node:tux1Node01/Server:server1/') print server1 jvm = AdminConfig.list('JavaVirtualMachine', server1) print "--> variable jvm is" print jvm print "--> AdminConfig.show(jvm)" myds=AdminConfig.getid('/DataSource:TradeDataSource/') mydslist=AdminConfig.list('ConnectionPool',myds) print "--> before: " print AdminConfig.show(mydslist) AdminConfig.modify(myds, '[[connectionPool [[maxConnections 113]]]]') AdminConfig.save() #AdminConfig.modify(myds, '[[connectionPool [[minConnections 20]]]]') #AdminConfig.save() print "--> after: " mydslist=AdminConfig.list('ConnectionPool',myds) print AdminConfig.show(mydslist) # monitor connections at the database with the command # watch -d -n 5 "db2 list applications | wc -l" # or informix # watch -d -n 5 "onstat -g ses | wc -l" # this will include some irrelevant lines in count -- feel free to egrep them out |
1 2 3 4 5 6 7 8 | server1=AdminConfig.getid('/Node:tux1Node01/Server:server1/') print server1 mywebcont=AdminConfig.list('WebContainer', server1) print AdminConfig.show(mywebcont) print "now modify settings" AdminConfig.modify(mywebcont, [['enableServletCaching', 'true']] ) AdminConfig.save() print AdminConfig.show(mywebcont) |
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 | server1=AdminConfig.getid('/Node:tux1Node01/Server:server1/') # show all thread pools # print AdminConfig.list('ThreadPool', server1) # from all the ThreadPools take the WebContainer # it will look something like this: #webpool='WebContainer(cells/tux1Node01Cell/nodes/tux1Node01 # cont... /servers/server1|server.xml#ThreadPool_1113265230034)' # # here is how to find the thread pool with jython # tpList=AdminConfig.list('ThreadPool', server1).split(lineSeparator) # now loop and find WebContainer # the string.count() tests for a substring # for production please add your own error handling for tp in tpList: if tp.count('WebContainer') == 1: tpWebContainer=tp # # white space is significant in jython, so the un-indented line # ends the code block print tpWebContainer print AdminConfig.show(tpWebContainer) # now that we have the identifier to get to tpWebContainer # adjust the settings # AdminConfig.modify( tpWebContainer, [['maximumSize', 75 ]] ) AdminConfig.save() AdminConfig.modify( tpWebContainer, [['minimumSize', 50 ]] ) AdminConfig.save() print AdminConfig.show(tpWebContainer) |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |