至於我,我得到應用現狀在WebSphere 6.1是這樣的:
#--------------------------------------------------------------
# get app object name
#--------------------------------------------------------------
appObjectNames = AdminControl.queryNames('type=Application,cell=' + cellName +
',node=' + nodeName + ',process=' + serverName + ',name=' + appName + ',*')
lineSeparator = java.lang.System.getProperty('line.separator')
appObjectName = appObjectNames.split(lineSeparator)[0]
appObjectName = appObjectName.strip()
#--------------------------------------------------------------
# get application status
#--------------------------------------------------------------
if len(appObjectName) == 0:
tprint(prefix + 'application ' + appName + ' is stopped')
else:
tprint(prefix + 'application ' + appName + ' is started')
我想這應該在WebSphere 7.0正常工作。
這不是一個重複的問題嗎? http://stackoverflow.com/questions/8185866/how-do-i-determine-if-an-application-is-running-using-wsadmin-jython-script – Manglu 2012-03-28 22:43:17
不,它是不一樣的。我需要立即的狀態。有了這個解決方案,我無法獲得狀態「部分運行」。 – RomanB 2012-04-09 17:54:12