Shares 56

There is more than 125 shell scripts file included in IBM WebSphere Application Server (WAS) when you install it. Not all of them are useful and if you are learner you may not be aware of some of the powerful scripts to use in daily work. I have listed some of the most useful scripts to ease your life as WebSphere Administrator.

Following scripts are tested in IBM WAS ND 8.5.5 environment and don’t see any reason it won’t work in any other environment.

Stopping & Starting Deployment Manager, Node Agent & JVM

stopManager.sh

You can stop the Deployment Manager using above command.

[[email protected] bin]# ./stopManager.sh
ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/dmgr/stopServer.log
ADMU0128I: Starting tool with the Dmgr01 profile
ADMU3100I: Reading configuration for server: dmgr
ADMU3201I: Server stop request issued. Waiting for stop status.
ADMU4000I: Server dmgr stop completed.
[[email protected] bin]#

Note: this has to be executed in DMGR profile path.

startManager.sh

You can start the Deployment Manager using above command.

[[email protected] bin]# ./startManager.sh
ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/dmgr/startServer.log
ADMU0128I: Starting tool with the Dmgr01 profile
ADMU3100I: Reading configuration for server: dmgr
ADMU3200I: Server launched. Waiting for initialization status.
ADMU3000I: Server dmgr open for e-business; process id is 9183
[[email protected] bin]#

Note: this has to be executed in DMGR profile path.

startServer.sh

To start the JVM, you can use startServer.sh with server name like below.

[[email protected] bin]# ./startServer.sh server1
ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/startServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3200I: Server launched. Waiting for initialization status.
ADMU3000I: Server server1 open for e-business; process id is 10633
[[email protected] bin]#

Note: Node Agent must be started prior to starting JVM.

stopServer.sh

You can shutdown JVM by executing above command along with JVM name.

[[email protected] bin]# ./stopServer.sh server1
ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/stopServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3201I: Server stop request issued. Waiting for stop status.
ADMU4000I: Server server1 stop completed. 
[[email protected] bin]#

stopNode.sh

To stop the respective Node Agent you have to go to that profile and execute stopNode.sh to stop the Node Agent.

[[email protected] bin]# ./stopNode.sh
ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent/stopServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: nodeagent
ADMU3201I: Server stop request issued. Waiting for stop status.
ADMU4000I: Server nodeagent stop completed. 
[[email protected] bin]#

startNode.sh

Go to respective profile and execute startNode.sh to start the Node Agent.

[[email protected] bin]# ./startNode.sh
ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent/startServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: nodeagent
ADMU3200I: Server launched. Waiting for initialization status.
ADMU3000I: Server nodeagent open for e-business; process id is 11363
[[email protected] bin]#

serverStatus.sh

To find out JVM’s status you can use this script with –all argument. This must be executed in respective profile level. If you execute this in DMGR profile level it will just show   the status of DMGR.

[[email protected] bin]# ./serverStatus.sh -all
ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/serverStatus.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU0503I: Retrieving server status for all servers
ADMU0505I: Servers found in configuration:
ADMU0506I: Server name: nodeagent
ADMU0506I: Server name: server1
ADMU0508I: The Node Agent "nodeagent" is STARTED
ADMU0508I: The Application Server "server1" is STARTED
[[email protected] bin]#

Backup & Restore

backupConfig.sh

One of the first things to learn while working in production support is to how to take a backup. When nothing works – backup helps. You can use this script to take a backup of your WebSphere environment configuration. As a best practice, you can use “–nostop” argument so it takes a backup without stopping Deployment Manager.

[[email protected] bin]# ./backupConfig.sh -nostop
ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/backupConfig.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU5001I: Backing up config directory
          /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config to file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/WebSphereConfig_2015-04-12.zip
....................................................................................................................................................................................................................................................................
ADMU5002I: 933 files successfully backed up
[[email protected] bin]#

restoreConfig.sh

If you have changed configuration and things are not as expected and there is a time to restore your configuration. Well, you can use the backup file to restore the configuration.

[[email protected] bin]# ./restoreConfig.sh WebSphereConfig_2015-04-12.zip -nostop
ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/restoreConfig.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU5502I: The directory /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config
           already exists; renaming to
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config.old
ADMU5504I: Restore location successfully renamed
ADMU5505I: Restoring file WebSphereConfig_2015-04-12.zip to location
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config
.........................................................................................................................................................................
ADMU5506I: 933 files successfully restored
ADMU6001I: Begin App Preparation -
ADMU6009I: Processing complete.
ADMU6002I: Begin Asset Preparation -
ADMU6009I: Processing complete.
[[email protected] bin]#

Do you like it so far? Scroll down for more fun!

Getting version & fix pack information

versionInfo.sh

To find out WAS version, build level, package, architecture & installed features installed on your server.

[[email protected] bin]# ./versionInfo.sh
WVER0010I: Copyright (c) IBM Corporation 2002, 2012; All rights reserved.
WVER0012I: VersionInfo reporter version 1.15.1.48, dated 2/8/12 
--------------------------------------------------------------------------------
IBM WebSphere Product Installation Status Report
-------------------------------------------------------------------------------- 
Report at date and time April 12, 2015 3:18:41 AM PDT 
Installation
--------------------------------------------------------------------------------
Product Directory       /opt/IBM/WebSphere/AppServer
Version Directory       /opt/IBM/WebSphere/AppServer/properties/version
DTD Directory           /opt/IBM/WebSphere/AppServer/properties/version/dtd
Log Directory           /var/ibm/InstallationManager/logs 
Product List
--------------------------------------------------------------------------------
NDTRIAL                 installed
Installed Product
--------------------------------------------------------------------------------
Name                 IBM WebSphere Application Server Network Deployment
Version               8.5.5.0
ID                   NDTRIAL
Build Level           gm1319.01
Build Date           5/14/13
Package               com.ibm.websphere.NDTRIAL.v85_8.5.5000.20130514_1044
Architecture         x86-64 (64 bit)
Installed Features   IBM 64-bit WebSphere SDK for Java
                     WebSphere Application Server Full Profile
                     EJBDeploy tool for pre-EJB 3.0 modules
                     Embeddable EJB container
                     Stand-alone thin clients and resource adapters 
--------------------------------------------------------------------------------
End Installation Status Report
--------------------------------------------------------------------------------
[[email protected] bin]#

Note: you may be interested in following supported arguments.

  • -fixpacks: To display fix packs information
  • -long: To display all fix packs and ifixes
  • -ifixes: To display ifixes information

getHistoryReport.sh

If you are performing auditing or just want to list out components, fixes, refresh pack with dates, you can run this command, which will generate historyReport.html in current working directory, which is usually bin folder.

getVersionReport.sh

To display build version and build date of WebSphere installation. Often asked by IBM support guys to investigate if any suspected issue with a particular version.

Clearing the Cache

There might be various reasons to clear the cache the most obvious one would be after an upgrade. There are two caches that you should consider clearing 1) JVM 2) OSGi.

clearClassCache.sh

To clear JVM’s class cache, you can execute above script.

Note: JVM’s must be stopped prior to clearing class caches.

osgiCfgInit.sh

Execute above command to clear OSGi profile & server cache.

[[email protected] bin]# ./osgiCfgInit.sh
OSGi profile cache successfully cleaned for /opt/IBM/WebSphere/AppServer/profiles/Dmgr01.
OSGi server cache successfully cleaned for /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/servers/dmgr.
[[email protected] bin]#

Note: don’t forget to stop the running processes prior to clearing caches.

Managing Profiles

managesdk.sh

You can toggle the version if you have installed multiple SDK. You can also use this script to find out available associated SDK to your profile. Below example shows a list of available SDK.

[[email protected] bin]# ./managesdk.sh -listAvailable
CWSDK1003I: Available SDKs :
CWSDK1005I: SDK name: 1.6_64
CWSDK1001I: Successfully performed the requested managesdk task.
[[email protected] bin]#

pmt.sh

PMT (Profile Management Tool) can be used to create WebSphere profiles in GUI mode. Creating profiles using PMT is very easy – all you got to do is create the desired level of profile and follow the wizard. You got to try it!

syncNode.sh

For some reason, if you can’t perform Node Sync through Administration Console, you can use syncNode.sh from profile level. Node Agent must be stopped prior to use this script. You have to pass an argument for DMGR host & SOAP port number.

[[email protected] bin]# ./syncNode.sh localhost 8879
ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/syncNode.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU0401I: Begin syncNode operation for node localhostNode01 with Deployment
           Manager localhost: 8879
ADMU0016I: Synchronizing configuration between node and cell.
ADMU0402I: The configuration for node localhostNode01 has been synchronized
           with Deployment Manager localhost: 8879
[[email protected] bin]#
  • localhost = Deployment Manager hostname
  • 8879 = DMGR SOAP Port number

I hope above scripts are useful to your daily work and make you smart WebSphere administrator.

Shares 56

Reader Interactions

Comments

  1. That’s it??? I really liked this and bookmarked it but you definitely need to include more scripts please in another post.

  2. Hi All,

    Hope all well.

    This is wonderful posting , useful for every one to keep improve.. plz keep post further..

  3. Hi Chandan.

    I appreciate your posting. It’s very useful.
    Can you please add some more scripts Export/import application etc. and regularly used (In real time) linux commands for Websphere Application Server.

    Thanks.

  4. Thank you for the explanations. I work with an automation tool called Tidal Enterprise Scheduler. There is a team in my company that use bladelogic to ripple start or stop/start the jvms.

    I don’t have any experience with WebSphere or Bladelogic. It seems it would be easy to ripple start multiple jvms via scripts?? Is that true? Is there a built-in script or would I need to use the stop and start scripts above and develop my own way to move from one jvm to the next?

    Thank you in Advance.
    Michelle Morris

    • Your Welcome Michelle.

      Yes, it would be easy to setup ripple script to start multiple JVM’s. If you plan to use BladeLogic, you can create a job containing the ripple script which will help you in automating this.

      You can use script as explained here -http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.0.0/com.ibm.websphere.nd.doc/info/ae/ae/txml_startcluster.html

  5. I have two web sphere applications and i want to start and stop from linux command line.
    there is a command to start / stop web sphere application server (was) but i am not able to find the command by which i can start/stop web application individually.

    please assist me.

  6. Thanks Chandan for your valuable time and patience ..

    Putting lot of efforts to replicate the data from multiple websites and putting all together in one place

  7. Hi, Thanks for useful scripts.
    Need your help please.

    Our DNGR server is down, how do we deploy single and multiple applications. Its urgent requirement. Thanks…

  8. Hi Chandan,
    I want notes on Virtual host concept. and How to access .WAR application by virtual host name.
    Could you please help me on step by step process to deploy .War file in to Was7 and how we can assign virtual host and also how we can access that .WAR file by URL.

    Thanks,

  9. Hi,
    Just started working on deployment automation script and i am new to websphere. How to know node profiles i have on a machine and how to switch between them for synchronization
    Through command line.

  10. Hi Chandhan,

    Its a wonderful thought to help others with your wonderful knowledge.
    I have one doubt, please help me on this.
    Is there any way to findout process id of hung threads on which process it is running without looking into Monitoring alerts or Systemout.logs.
    Please advise!

  11. Hi Chandan,

    Please help me on the below.

    How to enable manually clone ID, to serve the request of a particukar JVM?

    Regards,
    Poorna

  12. Hello Chandan Ji

    Your posts on web sphere are very much interesting. Hats-off for your thoughts to help us with your valuable posts.
    Can you please share the posts related to SSL and also share some trouble shooting steps which gets majorly on every topics in was like ssl,application issues etc.

    Thanks in advance 🙂

Comments

Your email address will not be published. Required fields are marked *