3

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?
Gas
  • 17,601
  • 4
  • 46
  • 93

3 Answers3

4

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

Community
  • 1
  • 1
Gas
  • 17,601
  • 4
  • 46
  • 93
0

The serverStatus.sh command is s..l..o..w.. If you want an answer today then there is a file in the logs folder with the process PID:

/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/servername/servername.pid

That file contains the PID of the server process. If it is running:

ps -p pid

Then the server is up.

rghome
  • 8,529
  • 8
  • 43
  • 62
0
1. ps -ef | grep dmgr


2. ps -ef | grep <application name>

Also grep SystemOut.log for e-business and verify latest timestamp.

  1. Log into admin console, browse to DataSource, display from all scopes, select your datasource and then click test. As long as the nodeagent is running and has been restarted at least once since the Datasource config and credentials were added, then this test should be fairly accurate.
T_Man
  • 76
  • 7