I can get a list of instlled applications but how do I get the status using Jython?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With