Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I determine if an application is running using wsadmin Jython script?

I can get a list of instlled applications but how do I get the status using Jython?

like image 863
blank Avatar asked Nov 18 '11 16:11

blank


People also ask

What is wsadmin script?

The wsadmin tool supports two scripting languages: Jacl and Jython. Five objects are available when you use scripts: AdminControl: Use to run operational commands. AdminConfig: Use to run configurational commands to create or modify WebSphere Application Server configurational elements.

How do I start wsadmin tool?

Run the wsadmin tool with the -f option, and place the commands that you want to run into the file. You can alternatively have two versions of the wsadmin.sh file, one that references the ASCII version of the file and another that references the EBCDIC version of the file.

How do I run a Python script in WebSphere?

To run in script mode, select the script libraries to use and merge them into our own script file. Save the custom script as a Python file, and run it from the command line. Python file containing two script library commands.


1 Answers

I dont think there is any direct method to get the application running status, You can get the object from the AdminControl using the following code

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

If serverstatus returns null, then the application is not running, if the application is running then the details of the applications would be printed.

like image 97
Snehan Solomon Avatar answered Sep 23 '22 20:09

Snehan Solomon