In the Matthieu, Cormier script there are a few more changes.
Here we go.
It will work in any line separator. Normally AdminApp.list () will use "\" as a line separator
import string def getAppStatus(appName): # If objectName is blank, then the application is not running. objectName = AdminControl.completeObjectName('type=Application,name='+ appName+',*') if objectName == "": appStatus = 'Stopped' else: appStatus = 'Running' return appStatus def appStatusInfo(): Apps=AdminApp.list().split(java.lang.System.getProperty("line.separator")) print '============================' print ' Status | Application ' print '============================' # Print apps and their status for x in Apps: print "X value", x print getAppStatus(x) + ' | ' + x print '============================' appStatusInfo()
source share