首页 文章

Weblogic - 使用Wlst获取部署类型

提问于
浏览
0

我正在尝试使用wlst监视域中托管服务器上的部署状态 .

我使用的是Weblogic 10.3

这是我到目前为止:

domainRuntime()

applnRtStEuntimeBean = cmo.getAppRuntimeStateRuntime()

servers=domainRuntimeService.getServerRuntimes()

for server in servers:
     serverName = server.getName()
     applns = server.getApplicationRuntimes();
     for appln in applns:
         print 'Application Name          #', appln.getApplicationName()
         print 'Applican Current State    #', applnRtStEuntimeBean.getCurrentState(appName,serverName)
         print 'Applican Intended State   #', applnRtStEuntimeBean.getIntendedState(appName)

This gives me the current state of all applications irrespective of its "type" . Is there a way one can filter applications by its type using wlst ?

例如,我只想检查“企业应用程序”和“Web应用程序”的状态,并忽略所有“库”

我查看了MBeans Java文档但我没有看到任何可以使我获得应用程序类型的内容 .

对于参考应用程序名称,类型,运行状况和状态将在管理控制台的“部署”页面中列出 .

感谢您的反馈/建议/意见!!

1 回答

  • 0

    Mohan是的你可以分两步过滤掉它 . 您可以在for循环中使用if条件,并在遇到库文件时使用'continue'忽略 .

    applname=['test.war','test2.ear','test3.jar']
    wls:/offline> for s in applname:
    ... if s.endswith('jar'):
    ...  print 'ignore'
    ...  continue
    ... print s
        # do your task of monitoring here
    ...
    test.war
    test2.ear
    ignore
    

    请注意,您必须在此处遵循每个块的正确缩进 . HTH

相关问题