Skip Headers
Oracle® Enterprise Manager Extensibility
10g Release 2 (10.2) for Windows or UNIX

Part Number B16246-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

5 Management Using Web Services and JMX

Enterprise Manager Grid Control can be extended to allow monitoring of Web Services and JMX-instrumented applications for critical events, performance problems, error conditions and statistics.

Enterprise Manager's ability to monitor WSDL and JMX-enabled targets allows you to consolidate monitoring and management operations. When added to the Enterprise Manager framework, Enterprise Manager functionality, such as notifications, jobs, and reporting is automatically extended to these targets.

This chapter covers the following:

Overview

Using Enterprise Manager to monitor targets that expose a Web Services management interface or JMX-instrumented applications and servers entails defining a new target type via Management Plug-ins.

Note:

This chapter assumes knowledge of Management Plug-ins and the requisite target definition files. For information on Management Plug-in concepts, or developing and deploying Management Plug-ins, see Chapter 1, "Extending Monitoring" and Chapter 2, "Developing a Management Plug-in".

Creating a new Management Plug-in consists of four basic steps:

  1. Generate the target metadata and default collection files to be added to the Management Plug-in.

  2. Create a Management Plug-in Archive containing the target definition files for one or more Management Plug-ins. A single archive may contain more than one Management Plug-in.

  3. Import the Management Plug-in into Enterprise Manager.

  4. Deploy the Management Plug-in to the appropriate Management Agent(s).

Monitoring Using Web Services in Enterprise Manager

Web Services are loosely coupled software components that expose an external interface via Web Service Definition Language (WSDL). These components communicate across a network using a standard messaging protocol called Simple Object Access Protocol (SOAP). SOAP communication is supported by the Management Agent's JMX/SOAP fetchlet.

Note:

For more information about the Web Services standard, see the World Wide Web Consortium (W3C) website:

HTTP://www.w3.org

Web Services Command Line Tool

Defining a target type to be monitored via Web Services interface entails defining the requisite target definition files: target metadata and default collection. Enterprise Manager provides an easy-to-use Web Services command line tool to automate generating these files.

The Web Services command line tool simplifies creating new Management Plug-ins by automatically generating the requisite target metadata and collection files, both of which are required to collect metrics from resources that support the WSDL interface. Information retrieval is achieved via the SOAP/JMX fetchlet that is integrated with the Management Agent.

The command line tool works by parsing a specified WSDL file for all operations and allows you to pick one or more operations to be invoked. If there are multiple port types specified in the WSDL file, the tool will prompt you to select one of them. Operations are listed along with their parameters. An operation in a Web Service can be one of four types:

  • One Way

  • Request Response

  • Solicit Response

  • Notification

The Request Response operation type is particularly useful: The selected operation could have primitive or complex parameters and results. The result of Web Service invocation is displayed in a table (the tool prompts you to provide labels for the table columns). You can also filter result attributes by specifying an Xpath expression (see columnOrder property in the generated target metadata, Example 5-2). Filter attributes can be useful for complex return types out of which only few attributes are interesting.

The Web Services command line tool supports Web Services with the following binding and encoding styles:

  • DOC/literal

  • RPC/encoded

Security

The command line tool does not make any invocation of the Web Service; it generates metadata required by Enterprise Manager for target monitoring purposes via the WSDL file. Users running this tool are only expected to have read permission on the WSDL file or URL and permission to save generated files to the appropriate directory.

Syntax

The Web Services command line tool syntax is as follows:

wsperfcli [OPTIONS] < WSDL File | URL to WSDL>

The wsperfcli command accepts the following options:

  • -useSOAP11 Use SOAP version 1.1 instead of default 1.2

  • -useWSIF Useful for WSDL with SOAP type arrays

  • -usePROXY Use proxy to connect to Web Service

  • -useSSL Use SSL to communicate with Web Service

The command line tool optionally accepts a WSDL file name or URL to locate the WSDL for a Web Service. For example, for a card-service Web Service a WSDL URL would be as follows:

http://localhost:44861/card-service/card?WSDL

The command tool script requires access to the Enterprise Manager home directory (EM_HOME) to run. The tool defaults to ORACLE_HOME. The home directory setting can be set using the command line argument -DEM_HOME. For example, -DEM_HOME=/myEMHome. Other optional arguments are -DSOAP11 and -DuseSSL, which allow metadata to be generated to use an older version of the SOAP protocol and SSL for communication with the Web Service. The option -useWSIF is used for WSDL that use the old SOAP style arrays (rpc/encoded Web Services).

The tool parses specified WSDL for all the port types and binding (supported protocols such as HTTP get/post, SOAP) to list all the operations. If there are multiple port types in WSDL, you will first be prompted to choose a port type.

Usage

The following example shows a sample WSDL file passed to the command line tool to generate the target metadata and collection files.

Example 5-1 Sample WSDL File TargetWithWSMgmtInterface

<?xml version="1.0" encoding="UTF-8" ?>
<definitions
     name="TargetWithWSMgmtInterface"
     targetNamespace="http://tempuri.org"
     xmlns="http://schemas.xmlsoap.org/wsdl/"
     xmlns:tns="http://tempuri.org"
     xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
     xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
     xmlns:ns1="http://mypackage3/MyProdMgmtInterface.wsdl/types"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    >
    <types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema"
 targetNamespace="http://tempuri.org" elementFormDefault="qualified"
             xmlns:tns="http://tempuri.org"
 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"/>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://mypackage3/MyProdMgmtInterface.wsdl/types"
             elementFormDefault="qualified" xmlns:tns="http://mypackage3/MyProdMgmtInterface.wsdl/types"
             xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/">
            <complexType name="ArrayOfstring">
                <complexContent>
                    <restriction base="soap11-enc:Array">
                        <attribute ref="soap11-enc:arrayType" wsdl:arrayType="string[]"/>
                    </restriction>
                </complexContent>
            </complexType>
        </schema>
    </types>
    <message name="TargetWithWSMgmtInterfaceSEI1_getNumActiveThreads"/>
    <message name="TargetWithWSMgmtInterfaceSEI1_getUserSessionID">
        <part name="user" type="xsd:string"/>
    </message>
    <message name="TargetWithWSMgmtInterfaceSEI1_getUserSessionIDResponse">
        <part name="result" type="xsd:string"/>
    </message>
    <message name="TargetWithWSMgmtInterfaceSEI1_getNumActiveThreadsResponse">
        <part name="result" type="xsd:long"/>
    </message>
    <message name="TargetWithWSMgmtInterfaceSEI1_getActiveUsers"/>
    <message name="TargetWithWSMgmtInterfaceSEI1_getActiveUsersResponse">
        <part name="result" type="ns1:ArrayOfstring"/>
    </message>
    <portType name="ManagementInterfaceWS">
        <operation name="getActiveUsers">
            <input message="tns:TargetWithWSMgmtInterfaceSEI1_getActiveUsers"/>
            <output message="tns:TargetWithWSMgmtInterfaceSEI1_getActiveUsersResponse"/>
        </operation>
        <operation name="getNumActiveThreads">
            <input message="tns:TargetWithWSMgmtInterfaceSEI1_getNumActiveThreads"/>
            <output message="tns:TargetWithWSMgmtInterfaceSEI1_getNumActiveThreadsResponse"/>
        </operation>
        <operation name="getUserSessionID" parameterOrder="user">
            <input message="tns:TargetWithWSMgmtInterfaceSEI1_getUserSessionID"/>
            <output message="tns:TargetWithWSMgmtInterfaceSEI1_getUserSessionIDResponse"/>
        </operation>
    </portType>
    <binding name="TargetWithWSMgmtInterfaceSoapHttp" type="tns:ManagementInterfaceWS">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="getActiveUsers">
            <soap:operation soapAction="http://tempuri.org:getActiveUsers"/>
            <input>
                <soap:body use="encoded" namespace="http://tempuri.org" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                     parts=""/>
            </input>
            <output>
                <soap:body use="encoded" namespace="http://tempuri.org" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                     parts="result"/>
            </output>
        </operation>
        <operation name="getNumActiveThreads">
            <soap:operation soapAction="http://tempuri.org:getNumActiveThreads"/>
            <input>
                <soap:body use="encoded" namespace="http://tempuri.org" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                     parts=""/>
            </input>
            <output>
                <soap:body use="encoded" namespace="http://tempuri.org" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                     parts="result"/>
            </output>
        </operation>
        <operation name="getUserSessionID">
            <soap:operation soapAction="http://tempuri.org:getUserSessionID"/>
            <input>
                <soap:body use="encoded" namespace="http://tempuri.org" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                     parts="user"/>
            </input>
            <output>
                <soap:body use="encoded" namespace="http://tempuri.org" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                     parts="result"/>
            </output>
        </operation>
    </binding>
    <service name="ManagementInterfaceWS">
        <port name="TargetWithWSMgmtInterfacePort" binding="tns:TargetWithWSMgmtInterfaceSoapHttp">
            <soap:address location="http://144.25.119.190:8989/WS-MyProdMgmtIntf-context-root/ManagementInterfaceWS"/>
        </port>
    </service>
</definitions>

The following sample Web Services command line tool session uses the WSDL file shown in Example 5-1. First, the tool parses the WSDL for all port types and bindings (supported protocols such as HTTP get/post or SOAP) to list all the operations. If there are multiple port types in the WSDL, the tool will first prompt you to select a port type.

All port types for specified WSDL:
0 TargetWithWSMgmtInterfacePort
All operations for specified port type:
0   long getNumActiveThreads()
1   string getUserSessionID(string user)
2   string [] getActiveUsers()
>> Enter the index of operation to select.: 0

Next, the tool prompts you to pick attributes from the return type to add to the metric.

Return value(s) for operation:
0 /tns:TargetWithWSMgmtInterfaceSEI1_getNumActiveThreadsResponse/result <long>
>> Enter the name for this metric column: ActiveThreads
>> Enter the label for this metric : ActiveThreadsLabel
>> Is this column a key <y/n> [n]: y
>> Do you want to add another metric <y/n>? [n] :
>> Enter value(s) for operation arguments:
>> Is this metric for periodic collection <y/n>? [n] : y
>> Enter the frequency of collections in seconds:12
>> Do you want to pick another operation to add <y/n>? [n] :n
>> Enter the metadata file name (metadata/TargetWithWSMgmtInterface.xml).:

The command line tool generates the metadata required to monitor the target type TargetWithWSMgmtInterface as shown in Example 5-2.

Example 5-2 TargetWithWSMgmtInterface Target Metadata File

<?xml version='1.0'?><!DOCTYPE TargetMetadata SYSTEM "../dtds/TargetMetadata.dtd"><TargetMetadata META_VER="1.0" TYPE="TargetWithWSMgmtInterface" CATEGORY_PROPERTIES="versionCategory">
<Display>
<Label NLSID="TargetWithWSMgmtInterface">TargetWithWSMgmtInterface</Label>
<ShortName NLSID="TargetWithWSMgmtInterface">TargetWithWSMgmtInterface</ShortName>
<Description NLSID="TargetWithWSMgmtInterface">TargetWithWSMgmtInterface</Description>
</Display>
<Metric NAME="Threads" TYPE="TABLE">
<Display>
<Label NLSID="Threads">Threads</Label>
</Display>
<TableDescriptor>
<ColumnDescriptor NAME="activeThreads" TYPE="NUMBER">
<Display>
<Label NLSID="ActiveThreads">ActiveThreads</Label>
</Display>
</ColumnDescriptor>
</TableDescriptor>
<QueryDescriptor FETCHLET_ID="OJMX">
<Property NAME="machine" SCOPE="INSTANCE">HTTPMachine</Property>
<Property NAME="port" SCOPE="INSTANCE">HTTPPort</Property>
<Property NAME="metricType" SCOPE="GLOBAL" OPTIONAL="TRUE">GWS</Property>
<Property NAME="metric" SCOPE="GLOBAL">getNumActiveThreads</Property>
<Property NAME="requestBodyElement" SCOPE="GLOBAL" OPTIONAL="TRUE">tns:getNumActiveThreads</Property>
<Property NAME="authuser" SCOPE="INSTANCE" OPTIONAL="TRUE">authUser</Property>
<Property NAME="authpwd" SCOPE="INSTANCE" OPTIONAL="TRUE">authPasswd</Property>
<Property NAME="documentType" SCOPE="GLOBAL" OPTIONAL="TRUE">rpc/encoded</Property>
<Property NAME="soapVersion" SCOPE="GLOBAL" OPTIONAL="TRUE">SOAP1.1</Property>
<Property NAME="targetNamespace" SCOPE="GLOBAL" OPTIONAL="TRUE"><![CDATA[<namespace prefix="tns" uri="http://tempuri.org" />]]></Property>
<Property NAME="columnOrder" SCOPE="GLOBAL">/tns:getNumActiveThreadsResponse/result</Property>
<Property NAME="additionalNamespaces" SCOPE="GLOBAL" OPTIONAL="TRUE"><![CDATA[<namespaces><namespace prefix="tns" uri="http://tempuri.org" /><namespace prefix="mime" uri="http://schemas.xmlsoap.org/wsdl/mime/" /><namespace prefix="soap12" uri="http://schemas.xmlsoap.org/wsdl/soap12/" /><namespace prefix="ns1" uri="http://mypackage3/MyProdMgmtInterface.wsdl/types" /><namespace prefix="xsd" uri="http://www.w3.org/2001/XMLSchema" /><namespace prefix="soap" uri="http://schemas.xmlsoap.org/wsdl/soap/" /></namespaces>]]></Property>
<Property NAME="delimiter" SCOPE="GLOBAL">|</Property>
<Property NAME="URI" SCOPE="GLOBAL">/WS-MyProdMgmtIntf-context-root/ManagementInterfaceWS</Property>
<Property NAME="soapAction" SCOPE="GLOBAL" OPTIONAL="TRUE">http://tempuri.org:getNumActiveThreads</Property>
<Property NAME="name" SCOPE="GLOBAL">getNumActiveThreads</Property>
<Property NAME="returnType" SCOPE="GLOBAL">long</Property>
<Property NAME="arguments" SCOPE="GLOBAL"><![CDATA[<arguments></arguments>]]></Property>
</QueryDescriptor>
</Metric>
<InstanceProperties>
<InstanceProperty NAME="HTTPMachine"><Display>
<Label NLSID="dms_HTTPMachine_iprop">Machine name</Label>
<ShortName NLSID="dms_HTTPMachine_iprop">Machine name</ShortName>
</Display>
</InstanceProperty>
<InstanceProperty NAME="HTTPPort"><Display>
<Label NLSID="dms_HTTPPort_iprop">Port</Label>
<ShortName NLSID="dms_HTTPPort_iprop">Port</ShortName>
</Display>
</InstanceProperty>
<InstanceProperty NAME="version" OPTIONAL="TRUE"><Display>
<Label NLSID="oc4j_version_iprop">Version of TargetWithWSMgmtInterface</Label>
<ShortName NLSID="oc4j_version_iprop">Version of TargetWithWSMgmtInterface</ShortName>
</Display>
</InstanceProperty>
<InstanceProperty NAME="authUser" OPTIONAL="TRUE"><Display>
<Label NLSID="dms_authUser_iprop">Username for basic authorization</Label>
<ShortName NLSID="dms_authUser_iprop">Username for basic authorization</ShortName>
</Display>
</InstanceProperty>
<InstanceProperty NAME="authPasswd" OPTIONAL="TRUE" CREDENTIAL="TRUE"><Display>
<Label NLSID="dms_authPasswd_iprop">Password for basic authorization</Label>
<ShortName NLSID="dms_authPasswd_iprop">Password for basic authorization</ShortName>
</Display>
</InstanceProperty>
</InstanceProperties>
</TargetMetadata>

The command line tool also generates the requisite collection file as shown in Example 5-3.

Example 5-3 TargetWithWSMgmtInterface Default Collection File

<!DOCTYPE TargetMetadata SYSTEM "../dtds/TargetCollection.dtd"><!-- This file is generated by Collector at 2006-01-24 14:00:10 -->

<TargetCollection TYPE="TargetWithWSMgmtInterface" NAME="TargetWithWSMgmtInterface" INCLUDE_DEFAULT="TRUE">
        <CollectionItem NAME="Threads" UPLOAD="5">
                <Schedule>
                        <IntervalSchedule INTERVAL="12" TIME_UNIT="Sec"/>
                </Schedule>
        </CollectionItem>

</TargetCollection>

Once the tool has generated the target metadata and collection files, you are ready to create the Management Plug-in archive. See section "Creating a Management Plug-in Archive".

Monitoring JMX Applications Deployed on Oracle Application Servers

The Java Management Extensions (JMX) framework improves manageability of your JMX-instrumented applications by allowing you to see what is going on inside. You gain insight into your applications and infrastructure through modular plug-ins called Managed Beans (MBeans). Mbeans integrate with your application, components (such as Enterprise Java-Beans), or other resources to expose properties (values) and operations.

The OJMX fetchlet, supplied with 10.2 Management Agents, allows you to monitor key metrics in your JMX-instrumented applications deployed on Oracle Application Server 10.1.3 or above. The fetchlet extends monitoring capabilities via JMX to the J2EE 1.4-compliant Oracle containers for J2EE (OC4J) servers themselves.

Monitoring JMX-instrumented applications/servers with Enterprise Manager entails defining a new target type that Enterprise Manager can monitor via Management Plug-ins. Enterprise Manager provides a command line tool to automate the generation of the target metadata and collection files.

Prerequisites

Known Limitations

JMX Command Line Tool

As with Web Services, the JMX command line tool (emjmxcli) simplifies creating the requisite target definition files. You generate the metadata and default collection file using JMX command line tool; an offline configuration utility that lets you connect to an MbeanServer and browse available Mbeans. During a command line tool session, you select specific Mbeans and then choose the desired attributes/statistical values or operations the Enterprise Manager needs to retrieve or invoke periodically on these Mbeans in order to collect these values. The tool will help define packaging for these collected values as one or more Enterprise Manager metrics (with columns) and also allow you to specify a metric collection interval.

The emjmxcli generates a target metadata and default collection file (it can also append metrics to an existing set of files during a subsequent invocation of the tool).

Syntax

The JMX command line tool syntax is as follows:

emjmxcli <TARGET_HOME>
                [  -h <hostname>
                   -p <port>
                   -u <username>
                   -c <credential/password>
                   -w <work directory>
                   -e <true/false>
                   [-m <MBeanName> | -d <jmx_domain> | -s <mBeanPattern>]
                ]

<TARGET_HOME> is an Oracle Home directory 10.1.3 or greater Oracle Application Server Container for J2EE (OC4J).

The jmxcli command accepts the following options:

  • -h Hostname of the OC4J. Default: "localhost".

  • -p RMI/RMIS port of the OC4J. Default: "23791".

  • -u Valid username for the OC4J. Default: "oc4jadmin".

  • -c Password associated with the OC4J user specified by "-u" option. Default: None. If no password is specified, you are prompted for the password.

  • -w Directory where the metadata and default_collection files created by the JMX command line tool are placed. Default: Current directory. When invoking the command line tool, you must have write permission on this directory in order to be able to create subdirectories and add files. If the metadata and default collection files already exist within that directory, you would have the option of appending to or overwriting the original files.

  • -e Whether or not RMIS connection to the OC4J is enabled (true or false). Default: false.

You can also specify ONE of the following three parameters (-m, -d or -s) to retrieve a subset of MBeans available on the MBeanServer. By default, all MBeans on the MBeanServer are displayed for the you to select from if none of the above three parameters are specified.

  • -m MBean ObjectName of the required MBean that needs to be retrieved and examined. If this is an ObjectName pattern matching multiple MBeans, then you will be shown a list of all MBeans that match the pattern and be able to select one at a time to work on.

  • -d MBean domain of the required application whose MBeans need to be retrieved and examined. For example, you want to browse all MBeans for an application (myApp) . MBeans for this app would be available in the JMX domain "myApp".

  • -s MBean pattern matching an existing set of MBeans from which the metrics are to be defined. If you specify the -s option, the resulting metrics, created during this emjmxcli session would appear as a table in the Enterprise Manager console, with multiple rows, one row representing each MBean that matches the specified pattern, and with the MBean ObjectName as a key column. For example, if you specify -s 'oc4j:j2eeType=Servlet,*' the resulting metric will have multiple rows, one for each servlet that matches the ObjectName pattern. Besides the MBean ObjectName column, other columns would be the attributes or fields from the return object of the operation, selected during the emjmxcli session. In summary, the "-s" option allows bulk retrieval of JMX Attributes/Statistics from multiple Mbeans of a similar type.

Usage

To start the JMX command line tool:

  1. Go to the $AGENT_HOME/bin directory.

  2. Run the following command:

    emjmxcli <Oracle Home of the target 10.1.3 or greater OC4J> [OPTIONS]
    

    Example 5-4 Sample EMJMXCLI Invocation

    ./emjmxcli /scratch/shiphomes/oc4j/1013_SOA_M1/ -h localhost -p 12404 -m 'oc4j:J2EEApplication=orabpel,name=\"ServerBean\",*'
    
    

Once invoked, the command line interface automatically prompts you for the requisite information, as shown in Example 5-5.

Example 5-5 EMJMXCLI Session

oracleHome=/ade/sparmesw_10202_ssm/oracle
targetHome=/scratch/shiphomes/oc4j/1013_SOA_M1/
The Port is 12404

Connecting to server: localhost:12404
Connecting as user: oc4jadmin
Enter the password:         

Obtained 1 MBeans matching pattern oc4j:J2EEApplication=orabpel,name="ServerBean",*. 

Enter the target type for this metric: [myJ2EEApp] myBPELApp

This is the target type for the new J2EE application as it should show up within Enterprise Manager.

Enter the target version: [1.0] 

Enter the target metadata file: [./metadata/myBPELApp.xml] 

This is the location of the metadata file that will be generated by the emjmxcli. You must have write permission on the directories where the target metadata and default collection files are to be created.

Enter the default collections file: [./default_collection/myBPELApp.xml] 
The file ./metadata/myBPELApp.xml already exists. 
Do you want to overwrite the existing file, append to it, or quit <o/a/q>? [a] a
Appending to existing file: ./metadata/myBPELApp.xml.
The available targets are: 
0: Identifies a deployed stateless session bean
        (oc4j:EJBModule="ejb_ob_engine",J2EEApplication=orabpel,J2EEServer=standalone,j2eeType=StatelessSessionBean,name="ServerBean")

Enter the index of target/MBean you wish to monitor or press <Ctrl-C> to quit: 0

If multiple Mbeans matched the -m <Mbean pattern> specified when the emjmxcli was invoked, then all Mbean ObjectNames matching the pattern would be listed during this part of the command line session, at which point you have the option of selecting one among the list. You can choose another Mbean from above list after creating metrics for the first one, without exiting this emjmxcli session.

If you want to append metrics from another Mbean that does not match the above -m pattern, you must exit and start another emjmxcli session with the Mbean ObjectName/Pattern of the latter Mbean, and create metrics from this Mbean which will be appended to the original target metadata and default collection files from the previous emjmxcli session. In this way, you can append metrics created from multiple emjmxcli sessions to the same target metadata and default collection files, if necessary.

Following metric source types are available for selected target(s):
        0: JMX Attributes
        1: JMX Operations
        2: J2EE Statistics
Enter the index of your choice or press <Ctrl-C> to quit: 2

Statistics are: 
        0: CreateCount
        1: ejbCreate()ClientActive
        2: ejbCreate()ClientTime
        3: ejbRemove()ClientActive
        4: ejbRemove()ClientTime
        5: MethodReadyCount
        6: RemoveCount
        7: setSessionContext(javax.ejb.SessionContext)ClientActive
        8: setSessionContext(javax.ejb.SessionContext)ClientTime
Select one or more items as comma separated indices: 0,6

JavaBean is : CreateCount
        0: count
        1: description
        2: lastSampleTime
        3: name
        4: startTime
        5: unit

This indicates that the Statistic call CreateCount is not a simple data type, but has a JavaBean pattern with the above listed properties, some of which you may be interested in.

Select one or more items as comma separated indices: 0
JavaBean is : RemoveCount
        0: count
        1: description
        2: lastSampleTime
        3: name
        4: startTime
        5: unit
Select one or more items as comma separated indices: 0
Number of possible columns in the resultant metric are 2.

Enter the name for this metric column at index=0 : [countOfCreateCount] createCount

You can specify any meaningful name here. If you do not specify a name, the JMX command line tool generates a default name that may not be appropriate in all cases.

Is this column a KEY Column <y/n>? [n] 

In situations where multiple rows can be returned, as might be the case when the Attribute or return value of the Operation is TabularData, then you need to specify one or more of your chosen metrics as "Key" columns.

Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [createCount] 
Enter the NLSID for column: [createCount] 
Enter the UNIT for column "createCount": [count] 
Do you want to create a threshold for this column <y/n>? [n] y
Creating threshold!!
Following operators are available for creating thresholds: 
 0: GT
 1: EQ
 2: LT
 3: LE
 4: GE
 5: CONTAINS
 6: NE
 7: MATCH

If you want to create a threshold on this column, you can specify an operator and then a value that would trigger a CRITICAL or WARNING alert.

Enter the index of your choice or press <Ctrl-C> to quit: 0
Enter the CRITICAL threshold: [NotDefined] 100
Enter the WARNING threshold: [NotDefined] 85
Enter the number of occurrences that trigger threshold: [6] 3

Number of consecutive occurrences of above CRITICAL or WARNING values that would trigger an alert.

Enter the message to be used when threshold is triggered: [createCount is %value%
and has crossed warning (%warning_threshold%) or critical (%critical_threshold%) threshold.] 
Enter NLSID for the message used when threshold is triggered: [createCount_cond] 
Enter the name for this metric column at index=1 : [countOfRemoveCount] removeCount
Is this column a KEY Column <y/n>? [n] 
Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [removeCount] 
Enter the NLSID for column: [removeCount] 
Enter the UNIT for column "removeCount": [count] 
Do you want to create a threshold for this column <y/n>? [n] 
Enter the name of this metric: ServerBeanStats
Enter the label for this metric: [ServerBeanStats] 

Do you want periodic collection for this metric <y/n>? [n] y

If the metric does not have to be collected periodically, as would be the case with real-time-only metrics, you can specify "no".

Enter the collection interval in seconds: 60
Periodic collection interval is: 60 seconds.

Do you want to create another metric <y/n>? [n] y
The available targets are: 
0: Identifies a deployed stateless session bean
        (oc4j:EJBModule="ejb_ob_engine",J2EEApplication=orabpel,J2EEServer=standalone,j2eeType=StatelessSessionBean,name="ServerBean")

Enter the index of target/MBean you wish to monitor or press <Ctrl-C> to quit: 0

If multiple Mbeans match the MBean pattern for the -m option (specified when the emjmxcli was invoked) you can selected a different Mbean from above list for the next iteration of this command line session.

Following metric source types are available for selected target(s):
        0: JMX Attributes
        1: JMX Operations
        2: J2EE Statistics

Enter the index of your choice or press <Ctrl-C> to quit: 0

Attributes are:         0: activeInstances       Return Value: int
        1: activeInstancesHighWaterMark  Return Value: int
        2: eventProvider         Return Value: boolean
        3: maxInstances  Return Value: int
        4: minInstances  Return Value: int
        5: ObjectName    Return Value: javax.management.ObjectName
        6: stateManageable       Return Value: boolean
        7: statisticsProvider    Return Value: boolean
        8: stats         Return Value: javax.management.j2ee.statistics.Stats
        9: transactionTimeout    Return Value: int
Select one or more items as comma separated indices: 0,3,4

Number of possible columns in the resultant metric are 3.
Enter the name for this metric column at index=0 : [activeInstances] 
Is this column a KEY Column <y/n>? [n] 
Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [activeInstances] 
Enter the NLSID for column: [activeInstances] 
Enter the UNIT for column "activeInstances": [millisec, kb etc.. ] Do you want to create a threshold for this column <y/n>? [n] 
Enter the name for this metric column at index=1 : [maxInstances] 
Is this column a KEY Column <y/n>? [n] 
Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [maxInstances] 
Enter the NLSID for column: [maxInstances] 
Enter the UNIT for column "maxInstances": [millisec, kb etc.. ] 
Do you want to create a threshold for this column <y/n>? [n] 

Enter the name for this metric column at index=2 : [minInstances] 
Is this column a KEY Column <y/n>? [n] 
Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [minInstances] 
Enter the NLSID for column: [minInstances] 
Enter the UNIT for column "minInstances": [millisec, kb etc.. ] 
Do you want to create a threshold for this column <y/n>? [n] 

Enter the name of this metric: ServerBeanCount
Enter the label for this metric: [ServerBeanCount] 

Do you want periodic collection for this metric <y/n>? [n] y
Enter the collection interval in seconds: 300
Periodic collection interval is: 300 seconds.

Do you want to create another metric <y/n>? [n] n
Written the metadata xml file: ./metadata/myBPELApp.xml.
Updated the default collection file for myBPELApp at location ./default_collection/myBPELApp.xml.
Exiting...

If you need to abort a JMX command line tool session, you can hit CTRL-C at any point to exit. Session information will not be saved.

Displaying Target Status Information: Response Metric

In order for the status information of your targets to appear correctly within the Enterprise Manager console, you must define a metric called "Response" that has a column named "Status" with a critical threshold set. The status of target instances of this type will appear in the console as "Up" (available) if the metric value is below the critical threshold. When the threshold is exceeded, the target status will appear as "Down" in the console.

You can create the Response metric in another emjmxcli session (append the metric to the metadata and collection files created in an earlier session). Example 5-6 illustrates adding a Response metric to previously generated metadata and collection files from a new command line session.

Example 5-6 Adding a Response Metric

./emjmxcli /scratch/shiphomes
//oc4j/1013_PRODUCTION/ -p 12403 -c welcome1 -m 'oc4j:j2eeType=J2EEApplication,n
ame=orabpel,*'

oracleHome=/ade/sparmesw_10202_ssm/oracle
targetHome=/scratch/shiphomes//oc4j/1013_PRODUCTION/
The Port is 12403

Connecting to server: localhost:12403
Connecting as user: oc4jadmin

Obtained 1 MBeans matching pattern oc4j:j2eeType=J2EEApplication,name=orabpel,*.

Enter the target type for this metric: [myJ2EEApp] myBPELApp

Enter the target version: [1.0]

Enter the target metadata file: [./metadata/myBPELApp.xml]

Enter the default collections file: [./default_collection/myBPELApp.xml]
The file ./metadata/myBPELApp.xml already exists.

Do you want to overwrite the existing file, append to it, or quit <o/a/q>? [a] a
Appending to existing file: ./metadata/myBPELApp.xml.
The available targets are:
0: Identifies a J2EE application EAR that has been deployed
        (oc4j:J2EEServer=standalone,j2eeType=J2EEApplication,name=orabpel)

Enter the index of target/MBean you wish to monitor or press <Ctrl-C> to quit: 0
Following metric source types are available for selected target(s):
        0: JMX Attributes
        1: JMX Operations

Enter the index of your choice or press <Ctrl-C> to quit: 0

Attributes are:
        0: allAccessibleGroups   Return Value: java.util.Set
        1: allAccessibleUsers    Return Value: java.util.Set
        2: applicationRootDirectoryPath  Return Value: java.lang.String
        3: archivePath   Return Value: java.lang.String
        4: childApplicationNames         Return Value: [Ljava.lang.String;
        5: childApplications     Return Value: [Ljavax.management.ObjectName;
        6: dataSourcesDescriptor         Return Value: java.lang.String
        7: deploymentDescriptor  Return Value: java.lang.String
        8: ejbClassLoaderPath    Return Value: java.lang.String
        9: eventProvider         Return Value: boolean
        10: groups       Return Value: java.util.Set
        11: iiopStubs    Return Value: [B
        12: metricRulesDescriptor        Return Value: java.lang.String
        13: Modules      Return Value: [Ljavax.management.ObjectName;
        14: objectName   Return Value: java.lang.String
        15: ohsRouting   Return Value: boolean
        16: parentApplication    Return Value: javax.management.ObjectName
        17: parentApplicationName        Return Value: java.lang.String
        18: properties   Return Value: java.util.Properties
        19: proprietaryDeploymentDescriptor      Return Value: java.lang.String
        20: proxyInterfaceSQLObjects     Return Value: [Ljava.lang.String;
        21: routingId    Return Value: java.lang.String
        22: Server       Return Value: javax.management.ObjectName
        23: sharedLibraryImports   Return Value: [Loracle.oc4j.admin.management.shared.SharedLibraryImport;
        24: startTime    Return Value: long
        25: state        Return Value: int
        26: stateManageable      Return Value: boolean
        27: statisticsProvider   Return Value: boolean
        28: syntheticWebModules  Return Value: oracle.oc4j.admin.management.shared.WebModule
        29: users        Return Value: java.util.Set
        30: webSite      Return Value: java.lang.String
        31: webSiteBindings      Return Value: java.util.Map
Select one or more items as comma separated indices: 25

Number of possible columns in the resultant metric are 1.

Enter the name for this metric column at index=0 : [state] Status
Is this column a KEY Column <y/n>? [n]
Is this column for SUMMARY_UI <y/n>? [n]
Enter the label for column: [Status]
Enter the NLSID for column: [Status]
Enter the UNIT for column "Status": [millisec, kb etc.. ]
Do you want to create a threshold for this column <y/n>? [n] y
Creating threshold!!
Following operators are available for creating thresholds:
 0: GT
 1: EQ
 2: LT
 3: LE
 4: GE
 5: CONTAINS
 6: NE
 7: MATCH
Enter the index of your choice or press <Ctrl-C> to quit: 6
Enter the CRITICAL threshold: [NotDefined] 1
Enter the WARNING threshold: [NotDefined]
Enter the number of occurrences that trigger threshold: [6] 2
Enter the message to be used when threshold is triggered: [Status is %value% and has crossed warning (%warning_threshold%) or critical (%critical_threshold%) threshold.]
Enter NLSID for the message used when threshold is triggered: [Status_cond]

Enter the name of this metric: Response
Enter the label for this metric: [Response]

Do you want periodic collection for this metric <y/n>? [n] y
Enter the collection interval in seconds: 30
Periodic collection interval is: 30 seconds.

Do you want to create another metric <y/n>? [n] n
Written the metadata xml file: ./metadata/myBPELApp.xml.
Updated the default collection file for myBPELApp at location ./default_collecti
on/myBPELApp.xml.
Exiting...

Please note that the Response metric collected in this emjmxcli session would be appended to the metadata and default_collection file created in an earlier session of the tool. (User can chose to overwrite the earlier file as well if they specific  the "o" option to the following prompt)

Do you want to overwrite the existing file, append to it, or quit <o/a/q>? [a] a

Once the JMX command line tool has generated the target metadata and collection files, you are ready to create the Management Plug-in archive. A sample of each generated file from the command line tool session above is shown in Example 5-7 and Example 5-8.

Example 5-7 Generated Target Metadata File

<!DOCTYPE TargetMetadata SYSTEM "../dtds/TargetMetadata.dtd">
<TargetMetadata META_VER="1.0" TYPE="myBPELApp" CATEGORY
_PROPERTIES="VersionCategory">
   <Display>
      <Label NLSID="myBPELAppNLSID">myBPELApp</Label>
      <ShortName NLSID="myBPELAppShortName">myBPELApp</ShortName>
      <Description NLSID="myBPELAppDescription">myBPELApp</Description>
   </Display>

   <Metric NAME="ServerBeanStats" TYPE="TABLE">
      <Display>
         <Label NLSID="ServerBeanStats">ServerBeanStats</Label>
      </Display>
      <TableDescriptor>
         <ColumnDescriptor NAME="createCount" TYPE="NUMBER">
            <Display>
               <Label NLSID="createCount">createCount</Label>
               <Unit NLSID="count">count</Unit>
            </Display>
         </ColumnDescriptor>
         <ColumnDescriptor NAME="removeCount" TYPE="NUMBER">
            <Display>
               <Label NLSID="removeCount">removeCount</Label>
               <Unit NLSID="count">count</Unit>
            </Display>
         </ColumnDescriptor>
      </TableDescriptor>
      <QueryDescriptor FETCHLET_ID="OJMX">
         <Property NAME="machine" SCOPE="INSTANCE">HTTPMachine</Property>
         <Property NAME="OracleHome" SCOPE="INSTANCE">OracleHome</Property>
         <Property NAME="oc4jInstanceName" SCOPE="INSTANCE"  OPTIONAL="TRUE">OC4JInstanceName</Property>
         <Property NAME="jvmId" SCOPE="INSTANCE" OPTIONAL="TRUE">JVMId</Property>
         <Property NAME="mgmtWebSite" SCOPE="INSTANCE" OPTIONAL="TRUE">MgmtWebSite</Property>
         <Property NAME="authuser" SCOPE="INSTANCE" OPTIONAL="TRUE">authUser</Property>
         <Property NAME="authpwd" SCOPE="INSTANCE" OPTIONAL="TRUE">authPasswd</Property>
         <Property NAME="metric" SCOPE="GLOBAL">ServerBeanStats</Property>
         <Property NAME="delimiter" SCOPE="GLOBAL">|</Property>
         <Property NAME="name" SCOPE="GLOBAL">getStatistics</Property>
         <Property NAME="signature" SCOPE="GLOBAL">objectName,statNames,languageCode,countryCode</Property>
<Property NAME="returnType" SCOPE="GLOBAL">arrayOfComplexObjectBean</Property>
         <Property NAME="dontAddDefaultRowKey" SCOPE="GLOBAL">true</Property>
         <Property NAME="columnOrder" SCOPE="GLOBAL">/CreateCount/count,/RemoveCount/count</Property>
         <Property NAME="arguments" SCOPE="GLOBAL">
            <![CDATA[<arguments>
   <argument>
      <value>oc4j:EJBModule="ejb_ob_engine",J2EEApplication=orabpel,J2EEServer=standalone,j2eeType=StatelessSessionBean,name="ServerBean"</value>
   </argument>
   <argument>
      <value>CreateCount</value>
      <value>RemoveCount</value>
   </argument>
   <argument>
      <value>en</value>
   </argument>
   <argument>
      <value>US</value>
   </argument>
</arguments>]]>
         </Property>
      </QueryDescriptor>
   </Metric>

<Metric NAME="ServerBeanCount" TYPE="TABLE">
      <Display>
         <Label NLSID="ServerBeanCount">ServerBeanCount</Label>
      </Display>
      <TableDescriptor>
         <ColumnDescriptor NAME="activeInstances" TYPE="NUMBER">
            <Display>
               <Label NLSID="activeInstances">activeInstances</Label>
            </Display>
         </ColumnDescriptor>
         <ColumnDescriptor NAME="maxInstances" TYPE="NUMBER">
            <Display>
               <Label NLSID="maxInstances">maxInstances</Label>
            </Display>
         </ColumnDescriptor>
         <ColumnDescriptor NAME="minInstances" TYPE="NUMBER">
            <Display>
               <Label NLSID="minInstances">minInstances</Label>
            </Display>
         </ColumnDescriptor>
      </TableDescriptor>
      <QueryDescriptor FETCHLET_ID="OJMX">
         <Property NAME="machine" SCOPE="INSTANCE">HTTPMachine</Property>
         <Property NAME="OracleHome" SCOPE="INSTANCE">OracleHome</Property>
         <Property NAME="oc4jInstanceName" SCOPE="INSTANCE" OPTIONAL="TRUE">OC4JInstanceName</Property>
         <Property NAME="jvmId" SCOPE="INSTANCE" OPTIONAL="TRUE">JVMId</Property>
         <Property NAME="mgmtWebSite" SCOPE="INSTANCE" OPTIONAL="TRUE">MgmtWebSite</Property>
         <Property NAME="authuser" SCOPE="INSTANCE" OPTIONAL="TRUE">authUser</Property>
         <Property NAME="authpwd" SCOPE="INSTANCE" OPTIONAL="TRUE">authPasswd</Property>
         <Property NAME="metric" SCOPE="GLOBAL">ServerBeanCount</Property>
         <Property NAME="delimiter" SCOPE="GLOBAL">|</Property>
         <Property NAME="name" SCOPE="GLOBAL">getAttributes</Property>
         <Property NAME="signature" SCOPE="GLOBAL">objectName,attributeNames,languageCode,countryCode</Property>
         <Property NAME="returnType" SCOPE="GLOBAL">arrayOfComplexObjectBean</Property>
         <Property NAME="dontAddDefaultRowKey" SCOPE="GLOBAL">true</Property>
         <Property NAME="columnOrder" SCOPE="GLOBAL">/activeInstances,/maxInstances,/minInstances</Property>
<Property NAME="arguments" SCOPE="GLOBAL">
            <![CDATA[<arguments>
   <argument>      <value>oc4j:EJBModule="ejb_ob_engine",J2EEApplication=orabpel,J2EEServer=standalone,j2eeType=StatelessSessionBean,name="ServerBean"</value>
   </argument>
   <argument>
      <value>activeInstances</value>
      <value>maxInstances</value>
      <value>minInstances</value>
   </argument>
   <argument>
      <value>en</value>
   </argument>
   <argument>
      <value>US</value>
   </argument>
</arguments>]]>
         </Property>
      </QueryDescriptor>
   </Metric>

<Metric NAME="Response" TYPE="TABLE">
      <Display>
         <Label NLSID="Response">Response</Label>
      </Display>
      <TableDescriptor>
         <ColumnDescriptor NAME="Status" TYPE="NUMBER">
            <Display>
               <Label NLSID="Status">Status</Label>
            </Display>
         </ColumnDescriptor>
      </TableDescriptor>
      <QueryDescriptor FETCHLET_ID="OJMX">
         <Property NAME="machine" SCOPE="INSTANCE">HTTPMachine</Property>
         <Property NAME="OracleHome" SCOPE="INSTANCE">OracleHome</Property>
         <Property NAME="oc4jInstanceName" SCOPE="INSTANCE" OPTIONAL="TRUE">OC4JInstanceName</Property>
         <Property NAME="jvmId" SCOPE="INSTANCE" OPTIONAL="TRUE">JVMId</Property>
         <Property NAME="mgmtWebSite" SCOPE="INSTANCE" OPTIONAL="TRUE">MgmtWebSite</Property>
         <Property NAME="authuser" SCOPE="INSTANCE" OPTIONAL="TRUE">authUser</Property>
         <Property NAME="authpwd" SCOPE="INSTANCE" OPTIONAL="TRUE">authPasswd</Property>
         <Property NAME="metric" SCOPE="GLOBAL">Response</Property>
         <Property NAME="delimiter" SCOPE="GLOBAL">|</Property>
         <Property NAME="name" SCOPE="GLOBAL">getAttributes</Property>
         <Property NAME="signature" SCOPE="GLOBAL">objectName,attributeNames,languageCode,countryCode</Property>
         <Property NAME="returnType" SCOPE="GLOBAL">arrayOfComplexObjectBean</Property>
         <Property NAME="dontAddDefaultRowKey" SCOPE="GLOBAL">true</Property>
         <Property NAME="columnOrder" SCOPE="GLOBAL">/state</Property>
         <Property NAME="arguments" SCOPE="GLOBAL">
            <![CDATA[<arguments>
   <argument>
      <value>oc4j:J2EEServer=standalone,j2eeType=J2EEApplication,name=orabpel</value>
   </argument>
   <argument>
      <value>state</value>
   </argument>
   <argument>
      <value>en</value>
   </argument>
   <argument>
      <value>US</value>
   </argument>
</arguments>]]>
         </Property>
      </QueryDescriptor>
   </Metric>

   <InstanceProperties>
      <InstanceProperty NAME="HTTPMachine">
         <Display>
            <Label NLSID="dms_HTTPMachine_iprop">Machine name</Label>
         </Display>
      </InstanceProperty>
      <InstanceProperty NAME="OracleHome">
         <Display>
            <Label NLSID="dms_OracleHome_iprop">Oracle home path</Label>
         </Display>
      </InstanceProperty>
<InstanceProperty NAME="OC4JInstanceName" OPTIONAL="TRUE"><Display><Label NLSID="OC4JInstanceNameiprop">OC4JInstanceName</Label></Display>home</InstanceProperty>
      <InstanceProperty NAME="JVMId" OPTIONAL="TRUE"><Display><Label NLSID="JVMId_iprop">JVMId</Label></Display>1</InstanceProperty>
      <InstanceProperty NAME="MgmtWebSite" OPTIONAL="TRUE"><Display><Label NLSID="MgmtWebSite_iprop">MgmtWebSite</Label></Display>default-web-site</InstanceProperty>
      <InstanceProperty NAME="URI" OPTIONAL="TRUE"><Display><Label NLSID="URI">URI</Label></Display>/JMXSoapAdapter/JMXSoapAdapter</InstanceProperty>
      <InstanceProperty NAME="authUser" OPTIONAL="TRUE">
         <Display>
            <Label NLSID="dms_authUser_iprop">Username for Basic authorization</Label>
         </Display>
      </InstanceProperty>
      <InstanceProperty NAME="authPasswd" OPTIONAL="TRUE" CREDENTIAL="TRUE">
         <Display>
            <Label NLSID="dms_authPasswd_iprop">Password for Basic authorization</Label>
         </Display>
      </InstanceProperty>
      <InstanceProperty NAME="Version" OPTIONAL="TRUE"><Display><Label NLSID="oc4j_version_iprop">Version of myBPELApp</Label></Display>1.0</InstanceProperty>
   </InstanceProperties>
</TargetMetadata>

Example 5-8 Generated Metric Collection File

<!DOCTYPE TargetCollection SYSTEM "../dtds/TargetCollection.dtd">
<!-- This file is generated by Collector at 2006-04-28 12:11:55 -->

<TargetCollection TYPE="myBPELApp" INCLUDE_DEFAULT="TRUE">
        <CollectionItem NAME="ServerBeanStats" UPLOAD="YES">
                <Schedule>
                        <IntervalSchedule INTERVAL="60" TIME_UNIT="Sec"/>
                </Schedule>
                <MetricColl NAME="ServerBeanStats">
                        <Condition COLUMN_NAME="createCount" CRITICAL="100"           WARNING="85" OPERATOR="GT" OCCURRENCES="3" MESSAGE="createCount is %value% and has crossed warning (%warning_threshold%) or critical (%critical_threshold%) threshold." MESSAGE_NLSID="createCount_cond"/>
                </MetricColl>
        </CollectionItem>
        <CollectionItem NAME="ServerBeanCount" UPLOAD="YES">
                <Schedule>
                        <IntervalSchedule INTERVAL="300" TIME_UNIT="Sec"/>
                </Schedule>
                <MetricColl NAME="ServerBeanCount">
                </MetricColl>
        </CollectionItem>

        <CollectionItem NAME="Response" UPLOAD="YES">
                <Schedule>
                        <IntervalSchedule INTERVAL="30" TIME_UNIT="Sec"/>
                </Schedule>
                <MetricColl NAME="Response">
                        <Condition COLUMN_NAME="Status" CRITICAL="1" WARNING="NotDefined" OPERATOR="NE" OCCURRENCES="2" MESSAGE="Status is %value% and has crossed warning (%warning_threshold%) or critical (%critical_threshold%) threshold." MESSAGE_NLSID="Status_cond"/>
                </MetricColl>
        </CollectionItem>
</TargetCollection>

Creating a Management Plug-in Archive

Note:

The Management Plug-in creation process applies to both Web Service and JMX-instrumented target types. Sections 5.4 through 5.8 use Web Services as an illustrative example.

Using the Enterprise Manager Command Line Interface (EM CLI), you create a Management Plug-in Archive, as shown in the following example. META_FILE and DC_FILE represent the target metadata and default collection files generated by the Web Services Command Line tool.

>./emcli add_mp_to_mpa -mpa=TargetWithWSMgmtInterface.jar -mp_version="1.0" -ttd="{META_FILE} -dc="${DC_FILE}"

For more information about the EM CLI, see Oracle Enterprise Manager Command Line Interface.

Once the archive jar file is created, you are ready to upload the archive to Enterprise Manager and import the Management Plug-in. For more information about Management Plug-in Archives, see Chapter 2, "Developing a Management Plug-in".

Importing the Management Plug-in

The next step is to import the Management Plug-in from the archive file. This operation is performed from the Enterprise Manager console.

  1. From the Enterprise Manager console, click Setup.

  2. Click Management Plug-ins from the left navigation bar.

  3. Click Import.

  4. From the Import page, specify the Management Plug-in Archive file and click List Archive. All Management Plug-ins contained within the archive are displayed.

  5. Select the Web service Management Plug-in from the list and click OK. Enterprise Manager returns you to the Management Plug-ins page with your Web service-specific plug-in added to the list.

Figure 5-1 Importing the TargetWithWSMgmtInterface Management Plug-in

Description of Figure 5-1 follows
Description of "Figure 5-1 Importing the TargetWithWSMgmtInterface Management Plug-in"

Deploying the Management Plug-in to the Management Agent

Once the Management Plug-in has been imported into Enterprise Manager, you are now ready to deploy the plug-in to any number of Management Agents. Deploying the Management Plug-in to an Agent allows that Agent to monitor targets exposing a Web Service management interface.

  1. From the Management Plug-in main page, click the Deploy icon for the Management Plug-in you wish to deploy. The Deploy Management Plug-in: Select Targets page appears, as shown in the following figure.

    Figure 5-2 Deploying the Management Plug-in to Management Agents

    Description of Figure 5-2 follows
    Description of "Figure 5-2 Deploying the Management Plug-in to Management Agents"

  2. Click Add Agents. The Search and Select: Agents page appears.

  3. Choose the desired Management Agent. Use the appropriate search parameters to find the desired Agent.

  4. Click Select. Enterprise Manager returns you to the Deploy Management Plug-in: Select Targets page. The selected Agent(s) appears in the deployment list.

    If deployment issues are detected for one or more the selected Agents, the Deployment Verification page is displayed. Only Agents for which an issue is detected appear in the table on this page. See online help for more information.

  5. Click Next to go to the Review page. The Management Plug-in name and version are shown. This page contains important information pertaining to the deployment process. Ensure that you understand the information before proceeding.

  6. Click Finish.

Adding a Target Instance

Now that the Management Plug-in has been deployed to the appropriate Agent(s), you are ready to begin monitoring target types defined by your Management Plug-in. Because of the different target type properties, separate procedures for adding both target types are covered.

Adding a Web Services Target Instance

Now that the Management Plug-in has been deployed to the appropriate Agent(s), you are ready to begin monitoring targets that expose a Web Service management interface, as defined by your Management Plug-in.

  1. From the Monitored Targets section of the Management Agent home page, choose the desired target type from the Add drop-down menu and click Go. The Add target page appears.

    Note that Username/Password for basic authorization are the login credentials used to access the Web Service.

  2. Enter the requisite target properties and click OK (shown in Figure 5-3). The newly added target appears in the Agent's Monitored Targets list.

Figure 5-3 Adding a Target Instance

Description of Figure 5-3 follows
Description of "Figure 5-3 Adding a Target Instance"

Adding a JMX-instrumented J2EE Target Instance

If deployed a Management Plug-in that defines a JMX-instrumented target type, then you are ready to begin configuring your JMX enabled J2EE application targets so that metrics for these targets can be collected in Enterprise Manager Grid Control.

  1. From the Monitored Targets section of the Management Agent home page, choose the desired target type from the Add drop-down menu and click Go. The Add target page appears.

    Figure 5-4 Selecting a JMX Target Type

    Description of Figure 5-4 follows
    Description of "Figure 5-4 Selecting a JMX Target Type"

  2. Enter the requisite target properties and click OK. See Figure 5-5. The newly added target appears in the Agent's Monitored Targets list.

    Figure 5-5 Specifying JMX Target Properties

    Description of Figure 5-5 follows
    Description of "Figure 5-5 Specifying JMX Target Properties"

    Target Properties

    • Name: Unique name for this target instance.

    • Machine name: Hostname/IpAddress of the machine running the 10.1.3 version or higher of the Oracle Application Server.

    • Oracle Home path: Absolute path to the Oracle_Home of the application server.

    • OC4JinstanceName: Instance name of the OC4J to which this JMX enabled j2ee application is deployed. Default is the "home" instance.

    • JVMId : If this OC4J instance is running multiple JVMs, the index (starts with 1) of the JVM where this metric needs to be collected from (if there are multiple JVMs, a target instance may be added for each JVM instance). Note: A user can create a "Group" from all these target instances running on multiple JVMs and see rolled up values across all the JVMs, dashboards, and other targets where aggregate monitoring is advantageous.

    • MgmtWebSite: This is the http website on which the JMXSoapAdapter is deployed. This is default-web-site by default

    • URI: WebService endpoint for the JMXSoapAdapter (by default this is /JMXSoapAdapter/JMXSoapAdapter.

    • User Name for Basic Authorization: oc4jadmin user name.

    • Password for Basic Authorization: Password for above user.

    • Version of TargetType : default to value from metadata file created via the emjmxcli

Viewing Monitored Metrics

With a target instance added to the Agent for monitoring, you are now ready to view metrics defined for your target type.

  1. From the Agent home page, click on the target instance you added in the previous step in the Monitored Targets list. Enterprise Manager takes you to that target's home page.

  2. In the Related Links section, click All Metrics. The All Metrics page appears for the monitored target. An expandable tree list for each metric allows you to drill down to view specific metric parameters, as show in Figure 5-6.

Figure 5-6 Viewing Metrics

Description of Figure 5-6 follows
Description of "Figure 5-6 Viewing Metrics"