Search code examples
websphere-8ibm-radibm-was

Checklist When IBM WebSphere Application server is running up


I have an IBM WebSphere Application Server v8.5 (WAS) installed on Linux RedHat 6.
My question: how can I check on the following by command (if exist):

  • Is the application server running or not?
  • Is the web application that deployed on it running or not?
  • The database connectivity (using datasource) is connected successfully or not?

Solution

  • The easiest and quickest to check all these things is to use web administrative console available at http://yourHost:9060/ibm/console.

    If you want to use command, then:

    Is the application server running or not?
    You can check that issuing serverStatus command (will check all servers):

    %PROFILE_ROOT%/bin/serverStatus.sh -all
    

    or for specific server:

    %PROFILE_ROOT%/bin/serverStatus.sh serverName
    

    the output will be something like:

    C:\IBM\WebSphere\AppServer85\profiles\AppSrv02\bin>serverstatus server1
    ADMU0116I: Tool information is being logged in file
               C:\IBM\WebSphere\AppServer85\profiles\AppSrv02\logs\server1\serverSta
    tus.log
    ADMU0128I: Starting tool with the AppSrv02 profile
    ADMU0500I: Retrieving server status for server1
    ADMU0508I: The Application Server "server1" is STARTED
    

    Is the web application that deployed on it running or not?
    There is no direct command for this. You can use wsadmin script for that. A simple one could be like the one below, if it returns entry the application is running:

    print AdminControl.completeObjectName('type=Application,name=myApplication,*')
    

    For more details check this question How do I determine if an application is running using wsadmin?

    The database connectivity (using datasource) is connected successfully or not?
    There is no direct command for this. You can use wsadmin script for that also. Here is sample script:

    ds = AdminConfig.getid('/DataSource:Default Datasource/')
    AdminControl.testConnection(ds)
    

    For more details check this page Testing data source connections using wsadmin scripting