WebSphere Application Server & Liberty

 View Only
  • 1.  wsadmin command line editing

    Posted Wed February 03, 2021 04:53 PM
    Edited by Jason Uppenborn Wed February 03, 2021 06:56 PM
    Hi,

    I have installed WebSphere Application Server Network Deployment traditional 9.0.0 on a Red Hat 8 (RHEL8) Linux box. I'm using Jython wsadmin scripts that came with Maximo to configure things and to see what I can do with wsadmin scripting.

    It would be really helpful if the wsadmin interactive mode / command line supported editing, like Linux or DOS command lines do. Right now, I have one window / terminal open for editing a "HelloWorld.py" script and another for "<up arrow> <enter>" to rerun that script, but that is feeling inefficient. There must be a better way..

    Is there is a way to enable command line editing?

    Even better, does the Integrated Solutions Console have an in-console feature, or an installable app, for developing and running wsadmin scripts?

    Thanks for your time and attention.

    ------------------------------
    Blessings,
    Jason Uppenborn
    Sr. Technical Maximo Consultant
    Ontracks Consulting
    ------------------------------


  • 2.  RE: wsadmin command line editing

    Posted Thu February 04, 2021 10:09 AM
    Wsadmin scripts is a powerful tool for WAS. But there is no interactive shell for editing.

    Currently WAS has command assistance, see article Command assistance simplifies administrative scripting in WebSphere Application Server

    And for automation I suggest you to check my Git Hub repository with some Ansible scripts https://github.com/ebasso/ansible-ibm-websphere that use wsadmin.


    ------------------------------
    ENIO RUBENS BASSO
    ------------------------------



  • 3.  RE: wsadmin command line editing

    IBM Champion
    Posted Fri February 05, 2021 04:20 AM
    Hello Jason,
    unfortunatelly there is - afaik - no command line editing in the wsadmin shell on Linux. Kicking of wsadmin.sh all the time for testing is cumbersome and time consuming. What you can do however is make used of Jython's 'execfile' (https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.base.iseries.doc/ae/cxml_jython.html) which allows you to edit the script in your editor of choice, switch to the shell where the wsadmin.sh is open in interactive mode and run the 'execfile' to load the updates and kick of the function again.

    I remember that in the earlier days of WebSphere Application Server there was something like WebSphere Application Server Development Tools (Eclipse based) where you could integrate wsadmin development with testing and even integrated with the admin console. You can still set the "Enable command assistance notifications" preference:

    The following article https://www.ibm.com/developerworks/websphere/library/techarticles/0812_rhodes/0812_rhodes.html#sec1c describes this, is however pretty old so not sure if that still applies (I still used the execfile approach). But maybe that gives you a hand.


    ------------------------------
    Hermann Huebler
    2innovate IT Consulting GmbH
    Vienna
    Austria

    #IBMChampion
    ------------------------------



  • 4.  RE: wsadmin command line editing

    Posted Fri February 05, 2021 10:14 AM
    Thanks to all. I do have "command assistance" turned on, and I have used it extensively. What I'm hearing is that my current configuration is probably saving as much in terms of mouse clicks and typing as is possible. Maybe IBM's liaison with Red Hat will get us all a better wsadmin command prompt, like Linux and DOS have had for decades.

    ------------------------------
    Blessings,
    Jason Uppenborn
    Sr. Technical Maximo Consultant
    Ontracks Consulting
    ------------------------------



  • 5.  RE: wsadmin command line editing

    Posted Fri February 05, 2021 07:36 AM
    You can run wsadmin.sh under "rlwrap" on linux for basic readline-like editing.

    ------------------------------
    Eric Covener
    ------------------------------