need a jython script - Websphere

This is a discussion on need a jython script - Websphere ; I'm new to jython and need a script that will recursively run through all the app server instances on a node and change the min and max heap size to values that I pass to the script. Does anyone have ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: need a jython script

  1. need a jython script

    I'm new to jython and need a script that will recursively run through all the app server instances on a node and change the min and max heap size to values that I pass to the script. Does anyone have one handy or could put one together quickly?



    thanks



    Also,does anyone have any recommendations on favorite resources for learning WebSphere 6.1 jython



    Thanks

  2. Re: need a jython script

    The InfoCenter has quite some examples.

    See listServers and setJVMInitialHeapSize / setJVMMaxHeapSize at
    http://publib.boulder.ibm.com/infoce...agement__cmd17


  3. Re: need a jython script

    thanks Ben, but the link you posted does not exist. The page is not found in the infocenter doc.

  4. Re: need a jython script

    My post was correct, it's this ***** forum which is broken.

    Remove the %20 sign it added and you get the page.

  5. Re: need a jython script

    remove the %20 from the url, it should work.



    Here is an example, just change the intial and max heap size of your choice.

    lineSeparator = java.lang.System.getProperty( 'line.separator' )
    st = AdminTask.listServers( '[-serverType APPLICATION_SERVER]' ).split(lineSeparator)
    for aServer in st:
    print 'aServer is :' ,aServer
    sName = AdminConfig.showAttribute(aServer, "name" )
    sID = AdminConfig.getid( "/Server:" +sName+ "/" )
    pDef = AdminConfig.list( "ProcessDef" , sID)
    jvm = AdminConfig.list( "JavaVirtualMachine" , pDef)
    AdminConfig.modify(jvm, [[ "initialHeapSize" , 256]] )
    AdminConfig.modify(jvm, [[ "maximumHeapSize" , 512]] )
    AdminConfig.save()



    Anant

  6. Re: need a jython script

    Help.help() displays the following info:

    attributes given an MBean, returns help for attributes

    operations given an MBean, returns help for operations

    constructors given an MBean, returns help for constructors

    description given an MBean, returns help for description

    notifications given an MBean, returns help for notifications

    classname given an MBean, returns help for classname

    all given an MBean, returns help for all the above

    help returns this help text

    AdminControl returns general help text for the AdminControl object

    AdminConfig returns general help text for the AdminConfig object

    AdminApp returns general help text for the AdminApp object

    wsadmin returns general help text for the wsadmin script

    launcher

    message given a message id, returns explanation and

    user action message



    How do you invoke AdminTask

  7. Re: need a jython script

    AdminTask is a new object added in Version 6.



    http://www.ibm.com/developerworks/we...509_wang/0509_ wang.html

  8. Re: need a jython script

    print AdminTask.listServers()

    WASX7015E: Exception running command: "print AdminTask.listServers()"; exception information:

    com.ibm.bsf.BSFException: exception from Jython: Traceback (innermost last):

    File " print AdminTask.help()

    WASX7015E: Exception running command: "print AdminTask.help()"; exception information:

    com.ibm.bsf.BSFException: exception from Jython: Traceback (innermost last):

    File "", line 1, in ?

    NameError: AdminTask



    any ideas

  9. Re: need a jython script

    Not sure why it does not work for you. I tried on both 6.0.2.23 and 6.1 it works for me.



    This has nothing to do with the error, are you invoking the wsadmin with the following parameters to run the jython commands.



    wsadmin.sh -lang jython

  10. Re: need a jython script

    Hi

    I would be able to delete shared library, if only one shared library is present. Using the scrip below.
    ********
    cellName = AdminControl.getCell()
    node = AdminConfig.getid("/Cell:" + cellName + "/Node:Nodename/")
    lb = AdminConfig.list('Library', node)
    AdminConfig.remove(lb)
    AdminConfig.save()
    **************************
    I have more than one shared libraries, i have to delete specific shared libraries.

    Does anyone have any idea how to get this done.

    Thanks in Advance.

+ Reply to Thread