Showing posts with label monitoring. Show all posts
Showing posts with label monitoring. Show all posts

Saturday, November 2, 2013

OSB: WLST to enable monitoring on Proxy Services

If there is something boring is having to manually enable/disable monitoring at Pipeline/STage/Action level on Proxy/Business services, with same or different aggregation interval.
Unfortunately OSB configuration API is not very friendly. ProxyServiceConfigurationMBean inherits the method enableMonitoring from its parent class CommonServiceConfigurationMBean.
Unfortunately in the method signature there is no mention of the extra parameters : level and aggregation period.
Here is the code:
#There is a change to do to be able to run this WLST script:
#vi /opt/oracle/fmw11_1_1_5/osb/common/bin/wlst.sh
#change this:
#export CLASSPATH
#into this:
#CLASSPATH=/opt/oracle/fmw11_1_1_5/osb/lib/sb-kernel-api.jar:/opt/oracle/fmw11_1_1_5/osb/lib/sb-kernel-impl.jar:/opt/oracle/fmw11_1_1_5/osb/modules/com.bea.common.configfwk_1.5.0.0.jar:$CLASSPATH
#export CLASSPATH


import javax.management
import java.util
import javax.management.remote
import javax.naming
import weblogic.management.mbeanservers.domainruntime
import com.bea.wli.sb.management.configuration

from java.util import Hashtable
from java.util import HashSet
from javax.management.remote import JMXServiceURL
from weblogic.management.mbeanservers.domainruntime import DomainRuntimeServiceMBean
from javax.naming import Context
from javax.management.remote import JMXConnectorFactory
from javax.management import ObjectName
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 CommonServiceConfigurationMBean
import weblogic.management.jmx.MBeanServerInvocationHandler
from com.bea.wli.config import Ref

from com.bea.wli.config.env import EnvValueQuery
from com.bea.wli.config.env import QualifiedEnvValue
from com.bea.wli.config.resource import DependencyQuery
from com.bea.wli.sb.management.query import ProxyServiceQuery
from com.bea.wli.sb.management.query import BusinessServiceQuery

from com.bea.wli.sb.util import EnvValueTypes
from java.util import Collection
from java.util import Collections


def setMonitoringAllProjectsAndServices(isEnabled):
    refs = configMBean.getRefs(Ref.DOMAIN)
    refsList = ArrayList()
    refsList.addAll(refs)
    
    for ref in refsList :
        if ref.getTypeId() == "ProxyService" or ref.getTypeId() == "BusinessService" :
            if ref.getTypeId() == "ProxyService" :
                isPS = "1"
            else:
                isPS =  "0"
            if isEnabled:
                print "enabling monitoring for ", ref.getFullName()
                proxyServiceConfigurationMBean.enableMonitoring(ref)
            else:
                print "disabling monitoring for ", ref.getFullName()
                proxyServiceConfigurationMBean.disableMonitoring(ref)



sessionName = "Session to enable or disable monitoring"
hostname='myhost.acme.com'
port=9001
username='Pierluigi'
password='pippo'
serviceURL=JMXServiceURL("t3", hostname, port, "/jndi/" + DomainRuntimeServiceMBean.MBEANSERVER_JNDI_NAME)
h=Hashtable()
h.put(Context.SECURITY_PRINCIPAL, username)
h.put(Context.SECURITY_CREDENTIALS, password)
h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote")

conn = JMXConnectorFactory.connect(serviceURL, h)

mbconn = conn.getMBeanServerConnection()

sm = JMX.newMBeanProxy(mbconn, ObjectName.getInstance(SessionManagementMBean.OBJECT_NAME), SessionManagementMBean)

sm.createSession(sessionName)

configMBean = JMX.newMBeanProxy(mbconn, ObjectName.getInstance("com.bea:Name=" + ALSBConfigurationMBean.NAME + "." + sessionName + ",Type=" + ALSBConfigurationMBean.TYPE), ALSBConfigurationMBean)

domainService = weblogic.management.jmx.MBeanServerInvocationHandler.newProxyInstance(mbconn, ObjectName(DomainRuntimeServiceMBean.OBJECT_NAME), DomainRuntimeServiceMBean, false)

proxyServiceConfigurationMBean = domainService.findService(String("ProxyServiceConfiguration.").concat(sessionName),'com.bea.wli.sb.management.configuration.ProxyServiceConfigurationMBean', None)

setMonitoringAllProjectsAndServices(true)



sm.activateSession(sessionName, "Complete enable/disable service monitoring")
conn.close()




Thursday, May 23, 2013

OSB Operations/Dashboard/Server Health

In PROD we have often stuck threads on the Admin whenever someone accesses the sbconsole at "Operations/Dashboard/Server Health" tab. The function apparently scans plenty of log files:

"[ACTIVE] ExecuteThread: '16' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE
          
               antlr.InputBuffer.LA(InputBuffer.java:86)
          
               antlr.CharScanner.LA(CharScanner.java:166)
          
               weblogic.diagnostics.archive.filestore.LogLexer.mLOGFIELD(LogLexer.java:141)
          
               weblogic.diagnostics.archive.filestore.LogLexer.nextToken(LogLexer.java:83)
          
               antlr.TokenBuffer.fill(TokenBuffer.java:69)
          
               antlr.TokenBuffer.LT(TokenBuffer.java:86)
          
               antlr.LLkParser.LT(LLkParser.java:56)
          
                    weblogic.diagnostics.archive.filestore.ServerLogFileParser.getNextServerLogEntry(ServerLogFileParser.java:109)
          
                    weblogic.diagnostics.archive.filestore.ServerLogRecordParser.parseRecord(ServerLogRecordParser.java:35)
          
                    weblogic.diagnostics.archive.filestore.RecordReader.getRecord(RecordReader.java:199)
          
                    weblogic.diagnostics.archive.filestore.FileRecordIterator.readRecords(FileRecordIterator.java:75)
          
                    weblogic.diagnostics.archive.filestore.FileRecordIterator.fill(FileRecordIterator.java:246)
          
               weblogic.diagnostics.archive.RecordIterator.fetchMore(RecordIterator.java:157)
          
               weblogic.diagnostics.archive.RecordIterator.hasNext(RecordIterator.java:130)
          
               weblogic.diagnostics.archive.DataArchive.countRecords(DataArchive.java:240)
          
                    weblogic.diagnostics.archive.DataArchive.getDataRecordCount(DataArchive.java:273)
          
                    weblogic.diagnostics.accessor.DataAccessRuntime.getDataRecordCount(DataAccessRuntime.java:380)
          
               sun.reflect.GeneratedMethodAccessor76689.invoke(Unknown Source)






Thursday, March 29, 2012

Friday, June 24, 2011

OSB profiling and monitoring your Proxy Service Message Flow

I was quite impressed by what you can achieve with the Monitoring
console, if you activate Monitoring at "Action" level....
you get execution time of every action in your Message Flow, including
execution time of each Service Callout...
Just inject a constant load on your system, and enjoy.

Tuesday, March 16, 2010

Web Services Monitoring

I am investigating on existing open source products to monitor web services, at a minimum to detect if there are changes in their WSDL, being able to navigate in their data type schemas, ping them to check if they are available...

given the high number of Web Services we are going to deal with, it's worth to have some sort of registry.

I am testing this

Hyperic http://www.hyperic.com/  this seems to be excellent, but it seems not specific to Web Service (still investigating)

Membrane http://www.membrane-soa.org/

and of course more in general NAGIOS for IT infrastructure monitoring:   http://www.nagios.org/


I know of Amberpoint, which seems to be quite good, but it's not opensource.



Please shout if you have already done some investigation on this topic


thanks