Friday, April 18, 2014

DMS Spy Servlet to monitor/retrieve the metrics - Oracle SOA Suite platform

DMS Spy Servlet to monitor/retrieve the metrics - Oracle SOA Suite platform

This post will explain how to monitor Oracle SOA Suite application through DMS Spy Servlet

The DMS Spy servlet provides access to DMS metric data from a web browser. Data that is created and updated by DMS-enabled applications and components is accessible through the DMS Spy Servlet.

The DMS Spy Servlet is part of the DMS web application. The DMS web application's web archive file is dms.war, and can be found in the same directory as dms.jar: <ORACLE_HOME>/modules/oracle.dms_11.1.1/dms.war.

The DMS web application is deployed by default as part of a JRF-enabled server instance. The URL is: http://host:port/dms/Spy.

Only users who have Administrator role access can view this URL as access is controlled by standard Java EE elements in web.xml.

This can be used to monitor Oracle SOA Composites, SOA Components, JVM, Datasources and MDS etc..

How to get the metrics through wget command:

The required metrics can be retrieved through wget command and exported to a XML format.

Login to server to execute the Spy servlet

wget --save-cookies cookies.txt --keep-session-cookies --post-data "j_username=weblogic&j_password=password&j_character_encoding=UTF-8" --delete-after http://localhost:7201/dms/j_security_check

Invoke the Spy servlet to fetch the required metrics

wget64 --load-cookies cookies.txt "http://localhost:7201/dms/Spy?format=xml&cache=false&prefetch=false&table=JVM&orderby=Name" -O server_JVM_metrics.xml

This will export the JVM metrics in XML format to server_JVM_metrics.xml

<?xml version='1.0' encoding='UTF-8'?>
<tbml xmlns="http://www.oracle.com/AS/collector" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version='11.0' id='7201' host='192.x.x.x' name='AdminServer' timestamp='1514398197366'>
<table name='JVM' keys='Host Name Parent Process' componentId='AdminServer'>
<row>
<column name='Name'><![CDATA[JVM]]></column>
<column name='Parent'><![CDATA[/]]></column>
<column name='Host'><![CDATA[192.x.x.x]]></column>
<column name='Process'><![CDATA[AdminServer:7201]]></column>
<column name='ServerName'><![CDATA[AdminServer]]></column>
<column name='upTime.value' type='LONG'>2400665</column>
<column name='totalMemory.value' type='INTEGER'>1974272</column>
<column name='totalMemory.minValue' type='DOUBLE'>1601536.0</column>
<column name='totalMemory.maxValue' type='DOUBLE'>1974272.0</column>
<column name='startTime.value' type='LONG'>1514395796693</column>
<column name='freeMemory.value' type='INTEGER'>806464</column>
<column name='freeMemory.minValue' type='DOUBLE'>700532.0</column>
<column name='freeMemory.maxValue' type='DOUBLE'>1245019.0</column>
<column name='activeThreads.value' type='INTEGER'>258</column>
<column name='activeThreads.minValue' type='DOUBLE'>43.0</column>
<column name='activeThreads.maxValue' type='DOUBLE'>258.0</column>
<column name='activeThreadGroups.value' type='INTEGER'>102</column>
<column name='activeThreadGroups.minValue' type='DOUBLE'>7.0</column>
<column name='activeThreadGroups.maxValue' type='DOUBLE'>102.0</column>
</row>
</table>
</tbml>

6 comments:

  1. Hello,
    We would like to use Linux shell script where we can run WGET command to obtain the performance metrics using DMS.

    Example:
    wget --timeout=25 --http-user=weblogic --http-password=password "http://server:7001/dms/Spy?format=xml&cache=false&prefetch=false&table=oracle_forms:application&orderby=Name" -O server_forms_sessions.xml

    We are getting the following error in server_forms_sessions.xml file after running wget command in the XML file:
    ….

    loginFailed" JavaScript is required. Enable JavaScript to use DMS SPy

    From other blogs and forums we found that it could be a problem with Authentication method for DMS application which should be set to "basic"

    So we modified web.xml in \user_projects\domains\\servers\\tmp\_WL_user\DMS Application_11.1.1.1.0\\war\WEB-INF and changed the line
    CLIENT-CERT,FORM
    To:
    BASIC
    Even after restarting Weblogic and DMS we are still getting the same error.
    Any suggestion will be highly appreciated
    Thanks and happy holidays!

    ReplyDelete
  2. Updated the post with required details to retrieve the metrics through wget command and export the result to a XML file

    ReplyDelete
  3. It worked fine for me so far. Thank you for this excellent post!

    ReplyDelete
  4. Thanks again Albin for sharing the information. I have one more question. When I am trying to log on to some of our servers this URL http://:/dms/j_security_check doesn't work. Could it be because we've modified web.xml as I explained in my previous post?

    we modified web.xml in\user_projects\domains\\servers\\tmp\_WL_user\DMS Application_11.1.1.1.0\\war\WEB-INF and changed the line
    CLIENT-CERT,FORM
    To:
    BASIC

    Please let me know if you think it can be a reason or it can be something else.
    I would appreciate your help!
    Alex

    ReplyDelete
  5. So before reverting back this change on the production server I have tried to "break" my sandbox by changing auth-method to "BASIC" from "CLIENT-CERT,FORM" in web.xml

    BASIC


    Unfortunately after modifying web.xml restarting DMS and restarting WL server I still can run this URL http://:/dms/j_security_check and get cookies file from this server
    So it should be another reason why I can't run it on production server.
    Any ideas are welcome
    Thanks

    ReplyDelete