Search code examples
deploymentmonitoringweblogic-10.xwlst

Weblogic - Get Deployment Type Using Wlst


I am trying to monitor the state of deployments on managed servers in a domain , using wlst.

I am using Weblogic 10.3

Here is what I have so far :

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 ?

For instance I only want to check state of "Enterprise Application" and "Web Application" and ignore all "Library"

I have looked at the MBeans Java docs but I don't see anything that can get me the application type.

For your reference application name , type , health and state are listed in the "Deployment" page on the admin console.

Appreciate your feedback/suggestions/comments !!


Solution

  • Mohan Yes you can filter out that in two step. You can use if condition inside the for loop and 'continue' for ignore when the library file encountered.

    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
    

    Note that you must follow correct indentation for each block here. HTH