Monitoring Weblogic using JMX in SiteScope

Using JMX (Java Management Extensions) it is possible to monitor Managed Beans published by MBean servers. Weblogic (WL) provides MBeans for both admin and managed servers.

You can find out more info about WebLogic MBeans and accessing them with JMX here

Following are some augmented instructions for setting up JMX monitors within SiteScope. I used this excellent article as a starting point.

Types
There are two types of MBeans which we’re interested in namely:

1. Configuration MBeans, which expose attributes and operations
for configuring WebLogic Server resources.
2. Runtime MBeans, which provide information about the runtime state of its resources.

In terms of performance monitoring we’re more interested in the latter, but from an overall system level monitoring point of view, sysadmins may also be interested in static config MBeans.

In reality there are 1,000’s of runtime MBeans available for WebLogic and navigating/finding the correct bean inside SiteScope can be difficult due to it’s clunky web interface …

As a starting point refer to the MBean reference previously mentioned to get an overview of runtime beans available. In this case I’m interested in the JMSRuntime bean …

Using the WL Scripting Tool
If you are working on the WL server you can use the WL Scripting Tool to browse the available Runtime beans:
D:\Data\bea\wlserver_10.0\server\bin>setWLSEnv.cmd
D:\Data\bea\wlserver_10.0\server\bin>java weblogic.WLST
connect('username','password','t3://host:8003')
serverRuntime()
ls()
cd("JMSRuntime")
ls()
cd("server01_01.jms")
ls()

dr-\- Connections
dr-\- JMSServers

-r-\- ConnectionsCurrentCount 14
-r-\- ConnectionsHighCount 14
-r-\- ConnectionsTotalCount 18
-r-\- HealthState State:HEALTH_OK,ReasonCode:\[\]
-r-\- JMSServersCurrentCount 2
-r-\- JMSServersHighCount 2
-r-\- JMSServersTotalCount 2
-r-\- Name server01_01.jms
-r-\- Type JMSRuntime

This will help identify the name of the MBean (in this case server01_01.jms) and the indicative path
to that MBean when using JConsole or SiteScope.

Setting up IIOP access on monitored machines
SiteScope relies on the IIOP protocol to talk to the WL server. In order to get remote access with JMX via IIOP you need to provide a default username and password for the IIOP user.

This can be done via the WL admin console as in:
domServiceBus->Environment->Servers->server01_nn->Protocols [tab]\->IIOP->advanced

Then provide a default username and password for the IIOP user.

Note: IIOP is already enabled by default, but a username and pwd is not. This change requires a server restart for WL. You must make sure that the username and password is >= 8 digits, otherwise the CORBA connection will fail when using SiteScope.

Testing connectivity from JConsole
Before setting up a SiteScope monitor it is worth using JConsole to familiarize yourself with the published MBeans.
Assuming you have the Java SDK installed, launch JConsole as per the following:
C:\Program Files\Java\jdk1.5.0_14\bin\jconsole.exe \-J-Dcom.sun.CORBA.transport.ORBTCPReadTimeouts=10:60000:500:10

Note: you must provide the additional read timeout arguments otherwise you will get a connection error like this:
Unable to retrieve counters: Error receiving browse data: java.rmi.MarshalException: CORBA COMM_FAILURE 1398079696 Maybe; nested exception is: org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 208 completed: Maybe

To connect to the target server, click on New Connection->advanced and provide the following details:
JMX URL: service:jmx:rmi:///jndi/iiop://hostname:8003/weblogic.management.mbeanservers.runtime
Username:
Password:

You will then get a tree-like broswer in which you can look at all available MBeans.

Setting up a SiteScope JMX monitor
Before setting up the monitor, make sure you change the following registry key for SiteScope to avoid the aforementioned timeout errors:
@="-server -Xmx256m -showversion -Dcom.sun.CORBA.transport.ORBTCPReadTimeouts=10:30000:500:10
-Dcatalina.home=\"D:\\SiteScope\\Tomcat\" -Dflipper.param.file=..\\conf\\flipperSiteScope.properties
-Dtopaz.home=.. -cp \"D:\\SiteScope\\Tomcat\\bin\\bootstrap.jar\" org.apache.catalina.startup.Bootstrap start"

Note the added parameter argument:
-Dcom.sun.CORBA.transport.ORBTCPReadTimeouts=10:30000:500:10

You will need to stop/start the SiteScope windows service for this change to take affect.

Now create a new JMX monitor:
Name: 8003 - Managed server
Frequency: 2 minutes
JMX URL: service:jmx:rmi:///jndi/iiop://host:8003/weblogic.management.mbeanservers.runtime
Domain filter:
Username: weblogic
Password: password

Then click Get Counters …

If you used the WLST you’d now know what path the MBean exists on. In this case:
com.bea/server01_01/server01_01.jms/JMSRuntime

And suggested counters to collect might be:
ConnectionsCurrentCount
ConnectionsHighCount
ConnectionsTotalCount
JMSServersCurrentCount
JMSServersHighCount
JMSServersTotalCount

Now you will be able to use SiteScope as the central repository for collecting metrics (long term monitoring). When running a load test scenario, you will be able to poll these same metrics using the SiteScope monitor available to the Controller.

18 comments to Monitoring Weblogic using JMX in SiteScope

  • Mauricio

    AMAZING! It worked fine in my environment! I spent 2 weeks with technicians to get it solved but nothing!

  • Kevin Redding

    Does increasing the timeout affect how long the SiteScope JMX monitor will be allowed to run once the counters are selected or does it only affect how long it will wait when retrieving the counters during initial setup?

  • Tim

    Changing the timeout affects how long it will wait in order to get the counters during the initial setup. Once the XML file that SiteScope builds for each targeted server has been made, the timeout does not appear to affect performance during ongoing collection.

    However, for real life scenarios on managed servers that have alot of JMX counters, SiteScope performs dismally. I have a good alternative posted here:
    http://90kts.com/blog/2008/monitoring-weblogic-92-with-jmx-and-jruby/

    using JRuby to do the raw collection, and if you search through my posts I also show how to provide SiteScope like functionality for LoadRunner…

    Regards,
    Tim Koopmans

  • Sujith

    hi Tim,

    I am trying to set up weblogic application server version 9 monitor using sitescope 8.8 but I am getting this error:

    SiteScope can monitor these objects.

    ——————————————————————————–
    (Click the to expand, and the to collapse).
    Counters

    Counters

    I have placed the weblogic 9 version JAR file in sitescope but then too no counters visible. Can you please help me.

    Thanks,
    Sujith

  • Raghavendra

    Can I have a similar setup to watch the jboss mbeans using SiteScope? Please Advice.

  • Tim

    @Sujith, confirm the user account u are using has access to monitor the relevant objects.

    @Raghavendra, JMX is a fairly open standard across Java platforms, so my guess is jboss should be able to be monitored. Although I have ditched this approach (using sitescope) and favour using JRuby and the jmx4r gem instead.

  • Sujith

    This user account has the rights. Please help me as I am trying to set it up from past two months

  • DDamo

    Thanks for the post. That is one of doing it, but worries me about setting the default IIOP username/password is it may break EJB’s that use IIOP.

    I have also came up with a work around that is much more cumbersome then the one you suggested.

    There is a work around, by putting a custom SiteScope group file into the group’s directory of the SiteScope root directory. I can send you the one I used. When you add this file into the directory it will pickup the groups and monitors and you can then use the console to add the appropriate username and passwords, etc. The monitor then will be able to connect to Weblogic, but it will display no mbeans. However, unlike when you use the console the connection will not error and you will then be able to add the mbeans monitors into the groups file manually. This process is cumbersome since you have to find the mbeans yourself using a tool like WLST. This functionality has been broken in SiteScope since I started working with SiteScope which was about 2 years ago. The reason is that Weblogic 9 uses a different mbean structure then Weblogic 8 and HP never fixed the tree structure change.

    You may also want to try adding this to the monitors classpath and you may be able to use the old monitor or HTTP to access the JMX mbean:

    Set Up the Classpath for Remote Clients
    If your JMX client runs in its own JVM (that is, a JVM that is not a WebLogic Server instance), include the following JAR file in the client’s classpath:

    WL_HOME\lib\wljmxclient.jar

    where WL_HOME is the directory in which you installed WebLogic Server.

    This JAR contains BEA’s implementation of the HTTP and IIOP protocols and its proprietary T3 protocol. With BEA’s implementation, JMX clients send login credentials with their connection request and the WebLogic Server security framework authenticates the clients. Only authenticated clients can access MBeans that are registered in a WebLogic Server MBean server.

    Note: While BEA recommends that you use its implementation of the HTTP and IIOP protocols or its proprietary T3 protocol, JMX clients can use the IIOP protocol that is defined in the standard JDK. See Remote Connections Using Only JDK Classes on page 4-7.

    http://edocs.bea.com/wls/docs90/jmx/accessWLS.html#1112969

    BEA’s documentation suggested you should be able to access JMX through all sorts of protocols:

    One of the following values as the protocol for communicating with the MBean server:
    t3, t3s, http, https, iiop, iiops

    It would be intresting if you could.

    Thanks,

    David :)

  • Tim

    Hi David,

    Thanks for your detailed suggestions! In short I’ve long since abandoned monitoring JMX via SiteScope as I found it too cumbersome for what I was after. Instead I’ve opted for simple JRuby scripts that use a JMX gem to automatically enum desired counters. This has saved me loads of time in terms of trawling through metrics via WLST and JConsole =)

    Regarding hacking the groups file, I had also done this in the past in response to a different defect, where SiteScope would timeout (actually run out of memory) when trying to enum the entire domainruntime MBeans tree upon first connect. Ugh.

    I wasn’t aware that BEA is serving up via other protocols, I had only ever tried via IIOP … I also wasn’t aware I would break other EJB access via the same protocol, but I guess that makes sense. Since I posted the original entry, I’ve realized you don’t need to make sure the password is >= 8 digits, that was my mistake, as I was using the default weblogic/weblogic account. Since then I’ve got the sysadmin to create me a custom account in the security realm and added it to the monitor & operator groups (not sure if they are default on all instances). In any case that setup works well.

    Thanks again for your tips, if you’re interested in using JRuby to collect the same info, please see this link:
    http://90kts.com/blog/2008/monitoring-weblogic-92-with-jmx-and-jruby/

  • venkat

    We do telephone testing and LR cannot do it. So we have built our own testing tool for it. But we would like integrate transactions data into the LR analysis. As we web testing along with telephony.
    Is there a way to send custom transactions from JMX and those be inserted into the LR while other tests are running.

    I greatly appreciate for coming forward to share your work with us all.

    Thank you very much.
    Venkat

  • Sathyajith.V.K

    Very helpful. Thanks!

  • Sathyajith.V.K

    VERY GOOD INFO!

  • MS

    very helpful ..thanks !

  • Nazeya

    Hi,

    i need help to get the status of AppDeployment that resides in ServerConfig, when i try checking the app deployed throu server runtime i do not find my app under the applicationRuntimes,i can just see it undet the app deployed, hence im unable to check the status of my app,please could you help?

  • ricky

    How about monitoring JBoss using jmx in Sitescope?

  • Thanks. A useful stuff. Can all the application be monitored?

  • vernetto

    you saved our life!
    I struggled 4 hours with Sitescope and only your post allowed us to complete the configuration… Sitescope error messages are inexistent and/or useless!

    See here my comments:

    http://javamonamour.blogspot.com/2009/11/sitescope-and-weblogic.html

  • Sunil

    Hi Tim, good morning.
    is there any way of getting the jconsole data into loadrunner with out the use of sitescope.
    thanks in advance.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">