FilBot3
FilBot3

Reputation: 3718

IBM wsadmin - How to get the status of an application per application server

I'm having issues getting the status of an Application on a specific Application Server inside of IBM's WebSphere product. I can get into the wsadmin scripting console, and issue:

print AdminApp.list("WebSphere:cell=MYCELL,node=NODE01,server=WPS00")

and get a list of applications installed on the AppServer itself, however, when I issue the command:

print AdminApp.isAppReady("Application01")

its obviously looking through the whole cell. Then I attempted to use:

print AdminControl.completeObjectName("WebSphere:type=Application,name=Application01,*")

it won't return anything because its in partial start. So I tested this against an application that was already fully running, and it showed all of my mBeans that it corresponded to. Specifying a server in the completeObjectName option doesn't work even with the fully running application.

How do I reliably get the status of an application on a specific application server so I can restart just what needs to be restarted and not the application across the whole AppTarget?

Upvotes: 2

Views: 2494

Answers (2)

ObiWanKenobi
ObiWanKenobi

Reputation: 92

Try this:

AdminControl.queryNames("type=Application,name=Application01,cell=MYCELL,node=NODE01,server=WPS00,*")

Put the '*' to get you all the attributes defined for the mbean and remove WebSphere from the string.

Upvotes: 1

Bruce T.
Bruce T.

Reputation: 1002

AdminControl.queryNames("WebSphere:type=Application,name=yourappname,*")

will return one mbean for each instance of the app that is running. Each mbean's object name will include the node and server name.

To query an app's status on a specific server, add the Nodename and servername to the above queryNames call. Getting an mbean back means it's running, getting nothing back means it's not.

Upvotes: 1

Related Questions