3 Replies Latest reply on Dec 12, 2012 10:49 AM by 966015

    WLST Script for Disabling/Enabling Global SLA Alerting.

    966015
      Hello,


      I wanna find a way from the WLST to disable and enable the SLA Alerting which is under Operations-->Global Settings in the sbconsole. This is the global setting not per sercive!

      I have found how to create a session and how to disable the alerts per service, but i cannot find which MBean is accessed when throught the sbconsole the global SLA alerting is disabled/enabled.


      Can anybody point me to the right direction or help me to find how to do this from WLST.

      Thanks.
        • 1. Re: WLST Script for Disabling/Enabling Global SLA Alerting.
          966015
          i have found the mbean the setting is com.bea:Name=OperationsConfig,Location=AdminServer,Type=com.bea.wli.sb.management.configuration.operations.OperationsConfigMBean but i dont know how to navigate into it from the wlst.. can anybody help????
          • 2. Re: WLST Script for Disabling/Enabling Global SLA Alerting.
            Ganesh
            I have found how to create a session and how to disable the alerts per service, but i cannot find which MBean is accessed when throught the sbconsole the global SLA alerting is disabled/enabled.
            Hi,

            Is there any sample WLST scripts for changing operational settings per service in the OSB?

            Thanks!
            • 3. Re: WLST Script for Disabling/Enabling Global SLA Alerting.
              966015
              Hi Ganesh,

              I have finally created the script i was looking for.. I copy-paste it below as a sample... For sure you need all the lines of code until the comment i have put "#####you need this code above"

              now the code you see below the comment is for disabling the global sla alerting... you have to write a bit to target a specific service that you want to disable.

              Keep in mind that after you make your change you hava to include those lines in order to activate the changes and disconnect and exit..

              sessionMBean.activateSession(sessionName, "enable SLA")
              disconnect()
              exit()

              If you have access to oracle support search for wlst script for osb it has a lot and you can find how to target a specific service...

              I hope that i help a little bit

              ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
              import sys
              import wlstModule
              from com.bea.wli.sb.management.configuration import SessionManagementMBean
              from com.bea.wli.sb.management.configuration import ALSBConfigurationMBean
              #from com.bea.wli.sb.management.configuration import ProxyServiceConfigurationMBean
              from com.bea.wli.sb.management.configuration.operations import OperationsConfigMBean
              from com.bea.wli.config import Ref
              from com.bea.wli.sb.util import Refs
              # Connect (username, password, URL)
              connect('weblogic', 'password', 't3://localhost:7001')

              domainRuntime()

              # Create a session name
              sessionName =sessionName = String("SessionScript"+Long(System.currentTimeMillis()).toString())

              print('... after session. Session is: ', sessionName)

              # Get the session MBean and create a session
              sessionMBean = findService(SessionManagementMBean.NAME,SessionManagementMBean.TYPE)
              print('-debug-this is the sessionbean',sessionMBean)

              print('SessionMBean is: ', sessionMBean)

              sessionMBean.createSession(sessionName)
              print(String('Session was created ... ').concat(sessionName))

              #####you need this code above

              domainCustom()
              cd('com.bea')
              #path='com.bea:Name=OperationsConfig.'+sessionName+',Location=AdminServer,Type=com.bea.wli.sb.management.configuration.operations.OperationsConfigMBean'
              cd('com.bea:Name=OperationsConfig.'+str(sessionName)+',Location=AdminServer,Type=com.bea.wli.sb.management.configuration.operations.OperationsConfigMBean')
              set('DomainSLAAlertingEnabled',java.lang.Boolean("true"))
              # Now commit (activate) the changes
              sessionMBean.activateSession(sessionName, "enable SLA")
              disconnect()
              exit()