简体   繁体   中英

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?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM