Showing posts with label wsadmin jython. Show all posts
Showing posts with label wsadmin jython. Show all posts

Thursday, July 21, 2011

Jython Snippet - Max Heap or All appServers on Node XYZ

#########
#get max heap size for all JVMs on a given node. Must connect to dmgr for this to work
#########
myNode='mw-node-001'
serverList = AdminServerManagement.listServers("",myNode)
for server in serverList:
   serverName=AdminConfig.showAttribute(server,'name')
   maxHeapL=AdminServerManagement.listJVMProperties(myNode,serverName,'maximumHeapSize')
   maxHeap=str(maxHeapL)
   print serverName + " " + maxHeap

Thursday, June 16, 2011

Complete Idiot's Guide To Jython for Noob Dummies

It's been a long time since I have jython'ed.  Here's a tip...

you can't concatenate an integer and a string.  Make sense, but it's a pain for someone that's used to doing a lot of perl/shell type scripting.


if you try something like this:

cntr=1
print "counter is " +cntr
you're going to get an error similar to:
TypeError: __add__ nor __radd__ defined for these operands

So how do you do this?  It's almost too easy:
cntr=1
print "counter is " +cntr.toString()