Skip to content

Instantly share code, notes, and snippets.

@AKSarav
Created March 29, 2018 06:54
Show Gist options
  • Save AKSarav/7eacd218ef9e53297be61e20d87165be to your computer and use it in GitHub Desktop.
Save AKSarav/7eacd218ef9e53297be61e20d87165be to your computer and use it in GitHub Desktop.
AppStatus.py
connect('weblogic','weblogic1','t3://localhost:17001')
myapps=cmo.getAppDeployments()
outputbuffer=[]
outputbuffer.append("--"*40)
outputbuffer.append(" \t\t\tAPPLICATION STATUS WEBLOGIC\t\t")
outputbuffer.append("--"*40)
outputbuffer.append (" %-50s%20s" %("APPLICATION NAME","STATUS"))
outputbuffer.append("--"*40)
for app in myapps:
bean=getMBean('/AppDeployments/'+app.getName()+'/Targets/')
targetsbean=bean.getTargets()
for target in targetsbean:
domainRuntime()
cd('AppRuntimeStateRuntime/AppRuntimeStateRuntime')
appstatus=cmo.getCurrentState(app.getName(),target.getName())
outputbuffer.append(" %-50s%20s" %(app.getName(),appstatus))
serverConfig()
outputbuffer.append("--"*40)
print '\n'.join(outputbuffer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment