プライマリ・コンテンツに移動
Oracle® Enterprise Manager Cloud Control拡張プログラマーズ・リファレンス
12cリリース4 (12.1.0.4)
B70762-06
  目次へ移動
目次
索引へ移動
索引

前
 
次
 

19 WebサービスおよびJMXを使用した監視

Enterprise Managerを拡張して、クリティカル・イベント、パフォーマンスの問題、エラー状態および統計について、WebサービスおよびJMXインスツルメント処理されたアプリケーションを監視できます。

WSDLおよびJMX対応のターゲットを監視するEnterprise Managerの機能により、監視操作と管理操作を統合できます。Enterprise Managerフレームワークに追加された場合、通知、ジョブ、レポート作成などのEnterprise Manager機能がこれらのターゲットに自動的に拡張されます。

この章の内容は次のとおりです。

19.1 概要

Enterprise Managerを使用して、Webサービス管理インタフェース、JMXインスツルメント処理されたアプリケーションおよびサーバーを公開するターゲット、そしてスタンドアロンJava仮想マシン(JVM)ターゲットを監視すると、メタデータ・プラグインを介して新しいターゲット・タイプを定義することになります。

メタデータ・プラグインの作成は、4つの基本手順から構成されます。

  1. プラグインに追加するターゲット・メタデータ・ファイルおよびデフォルトの収集ファイルを生成します。

  2. 1つ以上のプラグインのターゲット定義ファイルを含むOracleプラグイン・アーカイブを作成します。単一のアーカイブに複数のプラグインが含まれる場合があります。

  3. Enterprise Managerにプラグインをインポートします。

  4. 適切な管理エージェントにプラグインをデプロイします。

    これらの各手順の詳細は、第14章「プラグインの検証、パッケージ化およびデプロイ」を参照してください。

ターゲット監視の手順は、次の各項で説明しています。

  • 第19.2項では、標準メッセージング・プロトコルを使用してネットワーク上で通信する外部インタフェースを公開するソフトウェア・コンポーネントについて説明します。

  • 第19.4項では、JMX MBeanを使用してインスツルメント処理された、OC4Jで稼働するJ2EEアプリケーションについて説明します。

  • 第19.5項では、JMX MBeanを使用してインスツルメント処理された、J2SE5.0以上で稼働するスタンドアロンのJavaアプリケーションについて説明します。

  • 第19.6項では、Oracle WebLogicアプリケーション・サーバー9.x 以上で稼働するJMXアプリケーションについて説明します。

第19.4項および第19.5項では、データの収集に関連するMBeanを紹介し、Enterprise ManagerでMBeanをメトリックとして定義する場合に役立つ情報を提供することにより、JMX対応カスタム・アプリケーションのメタデータ・ファイルとデフォルトの収集ファイルの生成方法について説明します。スタンドアロンのJavaアプリケーションがJMXを介してインスツルメント処理されていない場合でも、第19.7.3項で定義するように組込みJVMターゲット・インスタンスを直接作成することにより、そのアプリケーションが稼働しているJVMもモニターできます。

メタデータ・ファイルおよびデフォルトの収集ファイルを作成したら、通常のメタデータ・プラグイン・メカニズムに従ってプラグインをデプロイし、Javaアプリケーション・ターゲット・タイプのターゲット・インスタンスを作成できます。

19.2 Enterprise ManagerでのWebサービスを使用した監視

Webサービスは、疎結合されたソフトウェア・コンポーネントであり、Webサービス定義言語(WSDL)を介して外部インタフェースを公開します。これらのコンポーネントは、Simple Object Access Protocol(SOAP)と呼ばれる標準メッセージング・プロトコルを使用してネットワーク上で通信します。管理エージェントのWebサービスFetchlet(ID WSFを含む)によってSOAP通信がサポートされます。


注意:

Webサービス標準の詳細は、World Wide Web Consortium(W3C)のWebサイトを参照してください。
http://www.w3.org

前提条件

  • そのホストに管理エージェント・バージョン12.1.0.0.0以降がインストールされていること。

  • Oracle Management Server(OMS)バージョン12.1.0.0.0以降が管理エージェントと通信していること。

19.2.1 メタデータ・ファイルおよびデフォルトの収集ファイルの作成

Webサービス・インタフェースを介して監視するターゲット・タイプを定義すると、WSDLインタフェースをサポートするリソースからメトリックを収集するのに必要なターゲット定義ファイルを作成することになります。

  • ターゲット・メタデータ

  • デフォルト収集

Enterprise Managerでは、使いやすいWebサービス・コマンドライン・ツールが提供されており、これらの必要なファイルを自動的に生成することにより、プラグインの作成が容易になります。情報は、管理エージェントに統合されたWebサービスfetchletで取得されます。

コマンドライン・ツールは、すべての操作について指定されたWSDLファイルを解析することで動作し、起動する1つ以上の操作を選択できるようにします。WSDLファイルに複数のポート・タイプが指定されている場合、ツールにはいずれか1つのポート・タイプの選択を求めるプロンプトが表示されます。操作は、パラメータとともにリストされます。Webサービスの操作は、次の4つのタイプのいずれかです。

  • 一方向

  • リクエスト・レスポンス

  • 請求レスポンス

  • 通知

リクエスト・レスポンス操作タイプは、特に役立ちます。選択された操作には、プリミティブまたは複雑なパラメータや結果が含まれます。Webサービスの呼出し結果が表に表示されます(ツールにより、表の列のラベルの入力を求めるプロンプトが表示されます)。XPath式を指定することで、結果の属性をフィルタ処理することもできます(生成されたターゲットのメタデータのRowTypeプロパティ、例19-3を参照)。フィルタ属性は、関連する属性がわずかしかない場合の複雑な戻り型に役立ちます。

Webサービス・コマンドライン・ツールでは、次のバインディングおよびエンコーディング・スタイルのWebサービスがサポートされます。

  • DOC/リテラル

  • DOC/ラップ

  • RPC/エンコーディング

19.2.1.1 WebサービスCLIコマンドライン・ツールの構文

WebサービスCLIコマンドライン・ツールの構文は次のとおりです。

emctl wscli [-metadata | -help] [-options]

コマンドは、次のオプションを受け入れます。

  • -wsdl=file | URL: WSDLファイルまたはURL(必須)

  • -username=user ID: WSDLが保護される場合のユーザー名

コマンドライン・ツールには、WebサービスのWSDLを特定するためにWSDLファイル名またはURLが必要です。たとえば、CalculatorサービスのWebサービスのWSDL URLは次のようになります。

http://localhost:44861/CalWS/CalculatorPort?WSDL

コマンド・ツール・スクリプトでは、実行するEnterprise Managerホーム・ディレクトリ(EM_HOME)にアクセスする必要があります。ツールは、デフォルトでORACLE_HOMEに設定されます(この環境変数は、ツールを使用する前に適切に設定しておきます)。

ツールは、すべてのポート・タイプおよびバインディング(HTTP get/post、SOAPなどのサポートされているプロトコル)に対して指定されたWSDLを解析して、すべての操作をリストします。WSDLに複数のポート・タイプがある場合は、最初にポート・タイプを選択するプロンプトが表示されます。

19.2.1.2 Webサービス・コマンドライン・ツールのセキュリティ

コマンドライン・ツールでは、Enterprise Managerで必要なメタデータがターゲット監視の目的でWSDLファイルから生成されます。このツールを実行する場合、WSDLファイルまたはURLに対する読取り権限および生成されるファイルを適切なディレクトリに保存する権限のみが必要です。

19.2.1.3 ファイルの生成

例19-1に、ターゲット・メタデータ・ファイルおよび収集ファイルを生成するためにコマンドライン・ツールに渡されるサンプルWSDLファイルを示します。

例19-1 サンプルWSDLファイルCalculatorService.wsdl

<?xml version="1.0" encoding="UTF-8"?>
<!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5. -->
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://tests.jaxws.oracle.com/"
xmlns:ns0="http://www.oracle.com/jaxws/tests"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="CalculatorService" targetNamespace="http://tests.jaxws.oracle.com/">
    <wsdl:types>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://www.oracle.com/jaxws/tests/types">
            <xs:complexType name="calculatorFaultInfo">
                <xs:sequence>
                    <xs:element name="number" type="xs:int"/>
                    <xs:element name="reason" type="xs:string" minOccurs="0"/>
                </xs:sequence>
            </xs:complexType>
        </xs:schema>
        <xs:schema xmlns:ns1="http://www.oracle.com/jaxws/tests/types" xmlns:tns="http://www.oracle.com/jaxws/tests" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://www.oracle.com/jaxws/tests">
            <xs:import namespace="http://www.oracle.com/jaxws/tests/types"/>
            <xs:element name="CalculatorException" nillable="true" type="tns:CalculatorException"/>
            <xs:element name="CalculatorWrapperException" nillable="true" type="ns1:calculatorFaultInfo"/>
            <xs:complexType name="CalculatorException">
                <xs:sequence>
                    <xs:element name="Message" type="xs:string"/>
                    <xs:element name="Number" type="xs:int"/>
                    <xs:element name="Reason" type="xs:string"/>
                </xs:sequence>
            </xs:complexType>
        </xs:schema>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://tests.jaxws.oracle.com/" targetNamespace="http://tests.jaxws.oracle.com/">
            <xsd:complexType name="add">
                <xsd:sequence>
                    <xsd:element name="arg0" type="xsd:int"/>
                    <xsd:element name="arg1" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:element name="add" type="tns:add"/>
            <xsd:complexType name="addResponse">
                <xsd:sequence>
                    <xsd:element name="return" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:element name="addResponse" type="tns:addResponse"/>
            <xsd:complexType name="square">
                <xsd:sequence>
                    <xsd:element name="arg0" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:element name="square" type="tns:square"/>
            <xsd:complexType name="squareResponse">
                <xsd:sequence>
                    <xsd:element name="arg0" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:element name="squareResponse" type="tns:squareResponse"/>
            <xsd:complexType name="checkNumber">
                <xsd:sequence>
                    <xsd:element name="arg0" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:element name="checkNumber" type="tns:checkNumber"/>
            <xsd:complexType name="checkNumberResponse">
                <xsd:sequence>
                    <xsd:element name="return" type="xsd:boolean"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:element name="checkNumberResponse" type="tns:checkNumberResponse"/>
        </schema>
    </wsdl:types>
    <wsdl:message name="addInput">
        <wsdl:part name="parameters" element="tns:add"/>
    </wsdl:message>
    <wsdl:message name="addOutput">
        <wsdl:part name="parameters" element="tns:addResponse"/>
    </wsdl:message>
    <wsdl:message name="squareInput">
        <wsdl:part name="parameters" element="tns:square"/>
    </wsdl:message>
    <wsdl:message name="squareOutput">
        <wsdl:part name="parameters" element="tns:squareResponse"/>
    </wsdl:message>
    <wsdl:message name="checkNumberInput">
        <wsdl:part name="parameters" element="tns:checkNumber"/>
    </wsdl:message>
    <wsdl:message name="checkNumberOutput">
        <wsdl:part name="parameters" element="tns:checkNumberResponse"/>
    </wsdl:message>
    <wsdl:message name="CalculatorWrapperException">
        <wsdl:part name="CalculatorWrapperException" element="ns0:CalculatorWrapperException"/>
    </wsdl:message>
    <wsdl:message name="CalculatorException">
        <wsdl:part name="CalculatorException" element="ns0:CalculatorException"/>
    </wsdl:message>
    <wsdl:portType name="Calculator">
        <wsdl:operation name="add">
            <wsdl:input xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl" message="tns:addInput" ns1:Action=""/>
            <wsdl:output xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl" message="tns:addOutput" ns1:Action=""/>
        </wsdl:operation>
        <wsdl:operation name="square">
            <wsdl:input xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl" message="tns:squareInput" ns1:Action=""/>
            <wsdl:output xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl" message="tns:squareOutput" ns1:Action=""/>
        </wsdl:operation>
        <wsdl:operation name="checkNumber">
            <wsdl:input xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl" message="tns:checkNumberInput" ns1:Action=""/>
            <wsdl:output xmlns:ns1="http://www.w3.org/2006/05/addressing/wsdl" message="tns:checkNumberOutput" ns1:Action=""/>
            <wsdl:fault name="CalculatorWrapperException" message="tns:CalculatorWrapperException"/>
            <wsdl:fault name="CalculatorException" message="tns:CalculatorException"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="CalculatorSoapHttp" type="tns:Calculator">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="add">
            <soap:operation soapAction=""/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="square">
            <soap:operation soapAction=""/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="checkNumber">
            <soap:operation soapAction=""/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
            <wsdl:fault name="CalculatorWrapperException">
                <soap:fault name="CalculatorWrapperException" use="literal" encodingStyle=""/>
            </wsdl:fault>
            <wsdl:fault name="CalculatorException">
                <soap:fault name="CalculatorException" use="literal" encodingStyle=""/>
            </wsdl:fault>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="CalculatorService">
        <wsdl:port name="CalculatorPort" binding="tns:CalculatorSoapHttp">
            <soap:address location="http://localhost:8888/CalWSBA/CalculatorPort"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

例19-2では、例19-2「サンプルWSDLファイルCalculatorService.wsdl」で示したWSDLファイルが使用されます。最初にツールは、すべてのポート・タイプおよびバインディング(HTTP get/post、SOAPなどのサポートされているプロトコル)に対してWSDLを解析して、すべての操作をリストします。WSDLに複数のポート・タイプがある場合は、最初にポート・タイプを選択するプロンプトが表示されます。

コマンドライン・ツールを開始するには、次のようにします。

  1. $AGENT_HOME/binディレクトリに移動します。

  2. 次のコマンドを実行します。

    $ emctl wscli -metadata -wsdl=/tmp/CalculatorWS.wsdl            
                                          
    

起動後に、コマンドライン・ツールは、例19-2「サンプルWebサービス・コマンドライン・ツール・セッション」に示すように、必要な情報を求めるプロンプトを自動的に表示します。コマンドライン・ツール・セッションを終了する必要がある場合は、任意の時点で[Ctrl]+[C]を押して終了できます。セッション情報は保存されません。

例19-2 サンプルWebサービス・コマンドライン・ツール・セッション

Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.1.0
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.

OracleHome : /oracle/oms/agent
EMDROOT    : /oracle/oms/agent

Generate Metric Metadata for Web Service Monitoring

Reading WSDL Document at /tmp/CalculatorWS.wsdl...done.

==> Enter the metadata file name [/tmp/target/metadata/CalculatorService.xml] :

* Selected Service: CalculatorService

* Selected Port: CalculatorPort

All operations for the selected Port "CalculatorPort":
[1]   squareResponse square(int arg0)
[2]   checkNumberResponse checkNumber(int arg0)
[3]   addResponse add(int arg0, int arg1)

==> Enter the index [1-3] of operation to select: 1
* Selected Operation:
    squareResponse square(int arg0)

Define new metric group:
==> Enter the name for this metric group [square]:

Return value(s) for the selected operation:
[1]   //ns0:squareResponse/arg0 <int>

==> Enter the index [1-1] of metric to display: 1
==> Enter the name for this metric [arg0]: SquareResult
==> Enter the label for this metric [SquareResult]:
==> Is this a key metric <y/n>? [n] :
==> Do you want to create threshold for this item <y/n>? [n] :


Setup operation Argument: square.arg0 <type:int>
==>   Enter value [%square.arg00001%] :

==> Do you want to use jps-config-jse.xml <y/n>? [n] :

==> Do you want to add User/Password Credential <y/n>? [n] : y
==> Enter the name for User/Password credential set [UserCredentialSet01] :

==> Do you want to add SSL TrustStore Credential <y/n>? [n] :

==> Do you want to add SSL KeyStore Credential <y/n>? [n] :

==> Do you want to add KeyStore Credential <y/n>? [n] :

==> Do you want to add Encryption Key Credential <y/n>? [n] :

==> Do you want to add Signature Key Credential <y/n>? [n] :

==> Is this metric group for periodic collection <y/n>? [y] :
The following units are for collection frequency:
[1]   Min
[2]   Hr
[3]   Day

==> Enter the index [1-3] of unit for this collection: 1
==> Enter the frequency of collection in Min: 30

==> Do you want to add another metric group <y/n>? [n] :

Files Generated:
- Target Metadata file: /tmp/target/metadata/CalculatorService.xml
- Target Collection file: /tmp/target/metadata/CalculatorServiceCollection.xml

コマンドライン・ツールは、例19-3に示すように、CalculatorServiceターゲット・タイプの監視に必要なメタデータを生成します。

例19-3 CalculatorServiceターゲット・メタデータ・ファイル

<!DOCTYPE TargetMetadata SYSTEM "../dtds/TargetMetadata.dtd">
<TargetMetadata META_VER="1.0" TYPE="CalculatorService">
  <Display>
    <Label NLSID="NLSID_CALCULATOR_SERVICE">CalculatorService</Label>
    <ShortName NLSID="NLSID_CALCULATOR_SERVICE">CalculatorService</ShortName>
    <Description NLSID="NLSID_CALCULATOR_SERVICE">CalculatorService</Description>
  </Display>
  <Metric NAME="square" TYPE="TABLE">
    <Display>
      <Label NLSID="NLSID_SQUARE">square</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor IS_KEY="FALSE" NAME="SquareResult" TYPE="STRING">
        <Display>
          <Label NLSID="COL_SQUARE_RESULT">SquareResult</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="WSF">
      <Property NAME="ProxyHost" SCOPE="INSTANCE" OPTIONAL="TRUE">ProxyHost</Property>
      <Property NAME="ProxyPort" SCOPE="INSTANCE" OPTIONAL="TRUE">ProxyPort</Property>
      <Property NAME="SecurityPolicy" SCOPE="INSTANCE" OPTIONAL="FALSE">square.SecurityPolicy</Property>
      <Property NAME="ServiceEndpoint" SCOPE="INSTANCE" OPTIONAL="FALSE">square.ServiceEndpoint</Property>
      <Property NAME="ServiceName" SCOPE="GLOBAL" OPTIONAL="FALSE">ns0:CalculatorService</Property>
      <Property NAME="PortName" SCOPE="GLOBAL" OPTIONAL="FALSE">ns0:CalculatorPort</Property>
      <Property NAME="OperationName" SCOPE="GLOBAL" OPTIONAL="FALSE">square</Property>      <Property NAME="MessageType" SCOPE="GLOBAL" OPTIONAL="FALSE">SOAP</Property>
      <Property NAME="SOAPBindingStyle" SCOPE="GLOBAL" OPTIONAL="FALSE">DOCUMENT</Property>
      <Property NAME="SOAPBindingUse" SCOPE="GLOBAL" OPTIONAL="FALSE">LITERAL</Property>
      <Property NAME="ParameterStyle" SCOPE="GLOBAL" OPTIONAL="FALSE">WRAPPED</Property>
      <Property NAME="SOAPVersion" SCOPE="GLOBAL" OPTIONAL="FALSE">SOAP_1_1</Property>
      <Property NAME="Namespace" SCOPE="GLOBAL" OPTIONAL="FALSE"><![CDATA[[ns0="http://tests.jaxws.oracle.com/"]]]></Property>
      <Property NAME="RowType" SCOPE="GLOBAL" OPTIONAL="FALSE">//ns0:squareResponse/arg0</Property>
      <Property NAME="ColType" SCOPE="GLOBAL" OPTIONAL="FALSE">SquareResult:STRING</Property>
      <Property NAME="Payload" SCOPE="GLOBAL" OPTIONAL="FALSE"><![CDATA[<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
            <soap:Body xmlns:ns1="http://tests.jaxws.oracle.com/">
              <ns1:square>
                <arg0>%square.arg00001%</arg0>
              </ns1:square>
            </soap:Body>
          </soap:Envelope>]]></Property>
      <Property NAME="UserCredential" SCOPE="GLOBAL" OPTIONAL="FALSE">UserCredentialSet01</Property>
      <CredentialRef NAME="UserCredentialSet01">UserCredentialSet01</CredentialRef>
    </QueryDescriptor>
  </Metric>
  <CredentialInfo>
    <CredentialType NAME="CSFKeyCredential">
      <Display>
        <Label NLSID="CRED_TYPE">CSF-Key Credential Type</Label>
      </Display>
      <CredentialTypeColumn NAME="CSFKey">
        <Display>
          <Label NLSID="CRED_C_S_F_KEY">Alias CSF Key</Label>
        </Display>
      </CredentialTypeColumn>
    </CredentialType>
    <CredentialType NAME="AliasCredential">
      <Display>
        <Label NLSID="CRED_TYPE">Alias Credential Type</Label>
      </Display>
      <CredentialTypeColumn NAME="Alias">
        <Display>
          <Label NLSID="CRED_ALIAS">Alias (i.e. username, encryption key, signature key, etc)</Label>
        </Display>
      </CredentialTypeColumn>
      <CredentialTypeColumn NAME="Password">
        <Display>
          <Label NLSID="CRED_PASSWORD">Password for the alias</Label>
        </Display>
      </CredentialTypeColumn>
    </CredentialType>
    <CredentialSet NAME="UserCredentialSet01" USAGE="MONITORING">
      <AllowedCredType TYPE="CSFKeyCredential"/>
      <AllowedCredType TYPE="AliasCredential"/>
    </CredentialSet>
  </CredentialInfo>
  <InstanceProperties>
    <InstanceProperty NAME="ProxyHost" CREDENTIAL="FALSE" OPTIONAL="TRUE">
      <Display>
        <Label NLSID="PROP_PROXY_HOST">Proxy Server Name</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="ProxyPort" CREDENTIAL="FALSE" OPTIONAL="TRUE">
      <Display>
        <Label NLSID="PROP_PROXY_PORT">Proxy Server Port</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="square.SecurityPolicy" CREDENTIAL="FALSE" OPTIONAL="FALSE">
      <Display>
        <Label NLSID="PROP_SQUARE_SECURITY_POLICY">[square] Authentication/Web Service Policy</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="square.ServiceEndpoint" CREDENTIAL="FALSE" OPTIONAL="FALSE">
      <Display>
        <Label NLSID="PROP_SQUARE_SERVICE_ENDPOINT">[square] Web Service Endpoint URL</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="square.arg00001" CREDENTIAL="FALSE" OPTIONAL="FALSE">
      <Display>
        <Label NLSID="PROP_SQUARE_ARG00001">[square] square.arg0</Label>
      </Display>    </InstanceProperty>  </InstanceProperties></TargetMetadata>

コマンドライン・ツールは、例19-4に示すように、必要な収集ファイルも生成します。

例19-4 デフォルトの収集ファイルCalculatorService

<!DOCTYPE TargetCollection SYSTEM "../dtds/TargetCollection.dtd">
<TargetCollection TYPE="CalculatorService">
  <CollectionItem NAME="square">
    <Schedule>
      <IntervalSchedule TIME_UNIT="Min" INTERVAL="30"/>
    </Schedule>
  </CollectionItem>
</TargetCollection>

ツールによってターゲット・メタデータ・ファイルおよび収集ファイルが生成されたら、Oracleプラグイン・アーカイブを作成できます。詳細は、第14.4項「プラグイン・アーカイブの作成」を参照してください。

19.3 Enterprise ManagerでのWS-Management使用の監視

Enterprise Manager 12c以降では、WS-Management(WS-MAN)準拠リソースは、fetchlet WSManagementFetchletを使用してモニターできます。

fetchletは、WS-Transferプロトコルを使用してWS-MANリソースと通信します。このプロトコルは、管理対象リソースがサポートする必要がある多くの管理操作を定義します。ただし、現在のリリースでfetchletがサポートするのは、WS-Transfer GET操作のみです。


注意:

WS-Managementの監視の規格については、DMTFのWebサイト『Web Services Management』を参照してください。
http://www.dmtf.org/standards/wsman

前提条件

  • そのホストに管理エージェント・バージョン12.1.0.0.0以上がインストールされていること。

  • Oracle Management Server(OMS)バージョン12.1.0.0.0以上が管理エージェントと通信していること。

19.3.1 メタデータ・ファイルおよびデフォルトの収集ファイルの作成

Enterprise Managerでは、使いやすいWS-Management CLIコマンドライン・ツールが提供されており、必要なターゲットのメタデータ・ファイルやデフォルトの収集ファイルを自動的に生成することにより、新しい管理プラグインの作成が容易になります。情報は、管理エージェントに統合されたWSManagementFetchletで取得されます。

WS-Managementインタフェースをサポートするリソースでは、XML Schema Definition(XSD)表現を使用してそのモデルに固有の要素を記述し、WSDLのように、Webサービスにアクセス可能な公共のリンクとしてXSDを公開する必要があります。

コマンドライン・ツールは、管理対象のWS-MANリソースの指定のXSDファイルを解析することで機能し、関連のリソース・プロパティを選択して監視メトリックを構築するプロンプトを表示します。

19.3.1.1 WS-Management CLIコマンドライン・ツールの構文

WS-Management CLIコマンドライン・ツールの構文は次のとおりです。

Usage: emctl wsmancli [-metadata | -help] [-options]

コマンドは、次のオプションを受け入れます。

  • -schema=file | URL: リソースのXSDファイルまたはURL [必須]

  • -username=user ID : スキーマが保護される場合のユーザー名

コマンドライン・ツールには、リソース・スキーマを特定するためにXSDファイル名またはURLが必要です。たとえば、Traffic Light WS-ManagementサービスのXSD URLは次のようになります。

http://localhost:8888/TrafficLight?xsd

コマンド・ツール・スクリプトでは、実行するEnterprise Managerホーム・ディレクトリ(EM_HOME)にアクセスする必要があります。ツールは、デフォルトでORACLE_HOMEに設定されます(この環境変数は、ツールを使用する前に適切に設定しておきます)。

19.3.1.2 コマンドライン・ツールのセキュリティ

コマンドライン・ツールでは、Enterprise Managerで必要なメタデータがターゲット監視の目的でリソースXSDから生成されます。このツールを実行する場合、XSDファイルまたはURLに対する読取り権限および生成されるファイルを適切なディレクトリに保存する権限のみが必要です。

19.3.1.3 ターゲットのメタデータ・ファイルおよび収集ファイルの生成

例19-5に、ターゲット・メタデータ・ファイルおよび収集ファイルを生成するためにコマンドライン・ツールに渡されるサンプルXSDファイルを示します。

例19-5 サンプルXSDファイルTrafficLight.xsd

<?xml version="1.0" encoding="UTF-8"?><xs:schema targetNamespace="http://schemas.wiseman.dev.java.net/traffic/1/light.xsd" elementFormDefault="qualified" blockDefault="#all" xmlns:tl="http://schemas.wiseman.dev.java.net/traffic/1/light.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">     
        <xs:complexType name="TrafficLightType">
                <xs:sequence>
                        <xs:element name="name" type="xs:string"/>
                        <xs:element name="color" type="xs:string"/>
                        <xs:element name="x" type="xs:int"/>
                        <xs:element name="y" type="xs:int"/>
                </xs:sequence>
        </xs:complexType>
        <xs:element name="trafficlight" type="tl:TrafficLightType"/>
</xs:schema>

コマンドライン・ツールを開始するには、次のようにします。

  1. $AGENT_HOME/binディレクトリに移動します。

  2. 次のコマンドを実行します。

    $ emctl wsmancli -metadata -schema= http://localhost:8080/Traffic?xsd
    

起動後に、コマンドライン・ツールでは、例19-6「サンプルWS-Management CLIコマンドライン・ツール・セッション」に示すように、必要な情報を求めるプロンプトが自動的に表示されます。コマンドライン・ツール・セッションを終了する必要がある場合は、任意の時点で[Ctrl]+[C]を押して終了できます。セッション情報は保存されません。

例19-6 サンプルWS-Management CLIコマンドライン・ツール・セッション

Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.0.0
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.

OracleHome : /oracle/oms/agent
EMDROOT    : /oracle/oms/agent

Generate Metric Metadata for WS-Management Resource Monitoring

Reading Resource XSD Document at http://localhost:8080/Traffic?xsd...done.

==> Enter the name for this target type: TrafficLight

==> Enter the metadata file name [/tmp/target/metadata/TrafficLight.xml] :

Define new metric group name:
==> Enter the name for this metric group: trafficLight

WS-Addressing namespaces:
[1]   http://www.w3.org/2005/08/addressing
[2]   http://schemas.xmlsoap.org/ws/2004/08/addressing

==> Enter the index [1-2] to select: 1


SOAP Envelope namespaces:
[1]   http://www.w3.org/2003/05/soap-envelope
[2]   http://schemas.xmlsoap.org/soap/envelope/

==> Enter the index [1-2] to select: 1

Resource properties:
[1]   trafficlight:color
[2]   trafficlight:name
[3]   trafficlight:x
[4]   trafficlight:y

==> Enter the index [1-4] of property to display: 2
==> Enter the name for this metric [name]:
==> Enter the label for this metric [name]:
==> Is this a key metric <y/n>? [n] : y
==> Do you want to add another metric <y/n>? [n] : y

Resource properties:
[1]   trafficlight:color
[2]   trafficlight:x
[3]   trafficlight:y

==> Enter the index [1-3] of property to display: 1
==> Enter the name for this metric [color]:
==> Enter the label for this metric [color]:
==> Is this a key metric <y/n>? [n] :
==> Do you want to create threshold for this item <y/n>? [n] :
==> Do you want to add another metric <y/n>? [n] : y

Resource properties:
[1]   trafficlight:x
[2]   trafficlight:y

==> Enter the index [1-2] of property to display: 1
==> Enter the name for this metric [x]:
==> Enter the label for this metric [x]:
==> Is this a key metric <y/n>? [n] :
==> Do you want to create threshold for this item <y/n>? [n] :
==> Do you want to add another metric <y/n>? [n] : y

Resource properties:
[1]   trafficlight:y

==> Enter the index [1-1] of property to display: 1
==> Enter the name for this metric [y]:
==> Enter the label for this metric [y]:
==> Is this a key metric <y/n>? [n] :
==> Do you want to create threshold for this item <y/n>? [n] :


==> Enter comma-separated list of Selector elements: name

==> Do you want to add User/Password Credential <y/n>? [n] : y
==> Enter the name for User/Password credential set [UserCredentialSet01] :

==> Is this metric group for periodic collection <y/n>? [y] :
The following units are for collection frequency:
[1]   Min
[2]   Hr
[3]   Day

==> Enter the index [1-3] of unit for this collection: 1
==> Enter the frequency of collection in Min: 30

==> Do you want to add another metric group <y/n>? [n] :

Files Generated:
- Target Metadata file: /tmp/target/metadata/TrafficLight.xml
- Target Collection file: /tmp/target/metadata/TrafficLightCollection.xml

コマンドライン・ツールは、例19-7に示すように、ターゲット・タイプTrafficLightの監視に必要なメタデータを生成します。

例19-7 TrafficLightターゲットのメタデータ・ファイル

<!DOCTYPE TargetMetadata SYSTEM "../dtds/TargetMetadata.dtd">
<TargetMetadata META_VER="1.0" TYPE="TrafficLight">
  <Display>
    <Label NLSID="NLSID_TRAFFIC_LIGHT">TrafficLight</Label>
    <ShortName NLSID="NLSID_TRAFFIC_LIGHT">TrafficLight</ShortName>
    <Description NLSID="NLSID_TRAFFIC_LIGHT">TrafficLight</Description>
  </Display>
  <Metric NAME="trafficLight" TYPE="TABLE">
    <Display>
      <Label NLSID="NLSID_TRAFFIC_LIGHT">trafficLight</Label>
    </Display>
    <TableDescriptor>
      <ColumnDescriptor IS_KEY="TRUE" NAME="name" TYPE="STRING">
        <Display>
          <Label NLSID="COL_NAME">name</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor IS_KEY="FALSE" NAME="color" TYPE="STRING">
        <Display>
          <Label NLSID="COL_COLOR">color</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor IS_KEY="FALSE" NAME="x" TYPE="STRING">
        <Display>
          <Label NLSID="COL_X">x</Label>
        </Display>
      </ColumnDescriptor>
      <ColumnDescriptor IS_KEY="FALSE" NAME="y" TYPE="STRING">
        <Display>
          <Label NLSID="COL_Y">y</Label>
        </Display>
      </ColumnDescriptor>
    </TableDescriptor>
    <QueryDescriptor FETCHLET_ID="WSManagementFetchlet">
      <Property NAME="ProxyHost" SCOPE="INSTANCE" OPTIONAL="TRUE">ProxyHost</Property>
      <Property NAME="ProxyPort" SCOPE="INSTANCE" OPTIONAL="TRUE">ProxyPort</Property>
      <Property NAME="SecurityPolicy" SCOPE="INSTANCE" OPTIONAL="TRUE">trafficLight.SecurityPolicy</Property>
      <Property NAME="ResourceURL" SCOPE="INSTANCE" OPTIONAL="FALSE">trafficLight.ResourceURL</Property>
      <Property NAME="To" SCOPE="INSTANCE" OPTIONAL="FALSE">trafficLight.To</Property>
      <Property NAME="OptionSet" SCOPE="INSTANCE" OPTIONAL="TRUE">trafficLight.OptionSet</Property>
      <Property NAME="Locale" SCOPE="INSTANCE" OPTIONAL="TRUE">trafficLight.Locale</Property>
      <Property NAME="MaxEnvelopeSize" SCOPE="INSTANCE" OPTIONAL="TRUE">trafficLight.MaxEnvelopeSize</Property>
      <Property NAME="OperationTimeout" SCOPE="INSTANCE" OPTIONAL="TRUE">trafficLight.OperationTimeout</Property>
      <Property NAME="Namespace" SCOPE="GLOBAL" OPTIONAL="FALSE"><![CDATA[[ns1="http://schemas.wiseman.dev.java.net/traffic/1/light.xsd"][ns0="http://www.w3.org/2001/XMLSchema"][wsa="http://www.w3.org/2005/08/addressing"][env="http://www.w3.org/2003/05/soap-envelope"]]]></Property>
      <Property NAME="RowType" SCOPE="GLOBAL" OPTIONAL="FALSE">
//ns1:trafficlight/ns1:name,//ns1:trafficlight/ns1:color,//ns1:trafficlight/ns1:x,//ns1:trafficlight/ns1:y</Property>
      <Property NAME="ColType" SCOPE="GLOBAL" OPTIONAL="FALSE">name:STRING,color:STRING,x:STRING,y:STRING</Property>
      <Property NAME="ReplyTo" SCOPE="GLOBAL" OPTIONAL="FALSE">http://www.w3.org/2005/08/addressing/role/anonymous</Property>
      <Property NAME="Action" SCOPE="GLOBAL" OPTIONAL="FALSE">http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</Property>
      <Property NAME="TransferOperation" SCOPE="GLOBAL" OPTIONAL="FALSE">GET</Property>
      <Property NAME="SelectorSet" SCOPE="GLOBAL" OPTIONAL="FALSE">[name,%trafficLight.name%]</Property>
      <Property NAME="UserCredential" SCOPE="GLOBAL" OPTIONAL="FALSE">UserCredentialSet01</Property>
      <CredentialRef NAME="UserCredentialSet01">UserCredentialSet01</CredentialRef>
    </QueryDescriptor>
  </Metric>
  <CredentialInfo>
    <CredentialType NAME="CSFKeyCredential">
      <Display>
        <Label NLSID="CRED_TYPE">CSF-Key Credential Type</Label>
      </Display>
      <CredentialTypeColumn NAME="CSFKey">
        <Display>
          <Label NLSID="CRED_C_S_F_KEY">Alias CSF Key</Label>
        </Display>
      </CredentialTypeColumn>
    </CredentialType>
    <CredentialType NAME="AliasCredential">
      <Display>
        <Label NLSID="CRED_TYPE">Alias Credential Type</Label>
      </Display>
      <CredentialTypeColumn NAME="Alias">
        <Display>
          <Label NLSID="CRED_ALIAS">Alias (i.e. username, encryption key, signature key, etc)</Label>
        </Display>
      </CredentialTypeColumn>
      <CredentialTypeColumn NAME="Password">
        <Display>
          <Label NLSID="CRED_PASSWORD">Password for the alias</Label>
        </Display>
      </CredentialTypeColumn>
    </CredentialType>
    <CredentialSet NAME="UserCredentialSet01" USAGE="MONITORING">
      <AllowedCredType TYPE="CSFKeyCredential"/>
      <AllowedCredType TYPE="AliasCredential"/>
    </CredentialSet>
  </CredentialInfo>
  <InstanceProperties>
    <InstanceProperty NAME="ProxyHost" CREDENTIAL="FALSE" OPTIONAL="TRUE">
      <Display>
        <Label NLSID="PROP_PROXY_HOST">Proxy Server Name</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="ProxyPort" CREDENTIAL="FALSE" OPTIONAL="TRUE">
      <Display>
        <Label NLSID="PROP_PROXY_PORT">Proxy Server Port</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="trafficLight.SecurityPolicy"
      CREDENTIAL="FALSE" OPTIONAL="TRUE">
      <Display>
        <Label NLSID="PROP_TRAFFIC_LIGHT_SECURITY_POLICY">[trafficLight] Authentication/Web Service Policy</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="trafficLight.ResourceURL" CREDENTIAL="FALSE" OPTIONAL="FALSE">
      <Display>
        <Label NLSID="PROP_TRAFFIC_LIGHT_RESOURCE_U_R_L">[trafficLight] Resource URL (wsman:ResourceURL)</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="trafficLight.To" CREDENTIAL="FALSE" OPTIONAL="FALSE">
      <Display>
        <Label NLSID="PROP_TRAFFIC_LIGHT_TO">[trafficLight] Network Address of the service (wsa:To)</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="trafficLight.OptionSet" CREDENTIAL="FALSE" OPTIONAL="TRUE">
      <Display>
        <Label NLSID="PROP_TRAFFIC_LIGHT_OPTION_SET">[trafficLight] Set of wsman:Option. Format: [&lt;OptionName1&gt;, value:&lt;value1&gt;, type:&lt;type1&gt;, mustComply:&lt;true|false&gt;][&lt;OptionName2&gt;, value:&lt;value2&gt;, type:&lt;type&gt;, mustComply:&lt;true|false&gt;][...]</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="trafficLight.Locale" CREDENTIAL="FALSE" OPTIONAL="TRUE">
      <Display>
        <Label NLSID="PROP_TRAFFIC_LIGHT_LOCALE">[trafficLight] wsman:Locale (RFC 3066 language code). Format: e.g. en-US</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="trafficLight.MaxEnvelopeSize"
      CREDENTIAL="FALSE" OPTIONAL="TRUE">
      <Display>
        <Label NLSID="PROP_TRAFFIC_LIGHT_MAX_ENVELOPE_SIZE">[trafficLight] wsman:MaxEnvelopeSize in Octets. Format: e.g. 8192</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="trafficLight.OperationTimeout"
      CREDENTIAL="FALSE" OPTIONAL="TRUE">
      <Display>
        <Label NLSID="PROP_TRAFFIC_LIGHT_OPERATION_TIMEOUT">[trafficLight] wsman:OperationTimeout. Format: e.g. PT30S</Label>
      </Display>
    </InstanceProperty>
    <InstanceProperty NAME="trafficLight.name" CREDENTIAL="FALSE" OPTIONAL="FALSE">
      <Display>
        <Label NLSID="PROP_TRAFFIC_LIGHT_NAME">[trafficLight] Value for the Selector "name"</Label>
      </Display>
    </InstanceProperty>
  </InstanceProperties>
</TargetMetadata>

コマンドライン・ツールは、例19-8「デフォルトの収集ファイルTrafficLight」に示すように、必要な収集ファイルも生成します。

例19-8 デフォルトの収集ファイルTrafficLight

<!DOCTYPE TargetCollection SYSTEM "../dtds/TargetCollection.dtd">
<TargetCollection TYPE="TrafficLight">
  <CollectionItem NAME="trafficLight">
    <Schedule>
      <IntervalSchedule TIME_UNIT="Min" INTERVAL="30"/>
    </Schedule>
  </CollectionItem>
</TargetCollection>

コマンドライン・ツールによってターゲットのメタデータ・ファイルおよび収集ファイルが生成されたら、メタデータ・プラグイン・アーカイブを作成できます。第14.4項「プラグイン・アーカイブの作成」を参照してください。

19.4 Oracle Application Server(OC4J)にデプロイされたJMXアプリケーションの監視

Java Management Extensions(JMX)フレームワークは、ユーザーが内部動作を確認できるようにすることで、JMXインスツルメント処理されたアプリケーションの管理性を向上します。アプリケーションおよびインフラストラクチャの内部動作は、Managed Bean(MBean)と呼ばれるモジュール形式のプラグインを通じて確認できます。MBeanは、アプリケーション、コンポーネント(Enterprise Java-Beanなど)またはその他のリソースと統合され、属性(値)および操作を公開します。

10.2の管理エージェントに付属するOJMX fetchletを使用すると、Oracle Application Server 10.1.3以上にデプロイされたJMXインスツルメント処理されたアプリケーションで主要なメトリックを監視できます。fetchletは、JMXを介した監視機能を、J2EE(OC4J)サーバー自体のJ2EE 1.4準拠Oracleコンテナに拡張します。

JMXインスツルメント処理されたアプリケーション/サーバーをEnterprise Managerで監視すると、Enterprise Managerが管理プラグインを介して監視できる新しいターゲット・タイプを定義することになります。Webサービスのwscliコマンドライン・ツールと同様に、Enterprise Managerには、ターゲットのメタデータ・ファイルおよび収集ファイルの生成を自動化するためのjmxcliコマンドライン・ツールが用意されています。

前提条件

  • JMX対応のアプリケーションがデプロイされた特定のホスト上で、Enterprise Managerでターゲットとして監視する必要のあるOracle Application Server 10.1.3インスタンスが稼働していること。

  • そのホストに管理エージェント・バージョン10.2.0.2以上がインストールされていること。

  • Oracle Management Server(OMS)バージョン10.2.0.2以上が管理エージェントと通信していること。

既知の制限事項

現在、jmxcliツールおよびOJMX fetchletでは、ターゲットOC4Jインスタンス上のデフォルトのMBeanserverで使用可能な(システムおよびアプリケーションで定義された)MBeanの参照および監視のみ行うことができます。jmxcliツールは基本的に、属性と、OpenTypeである操作のパラメータおよび戻り値を処理します。たとえば、SimpleType、CompositeType、TabularType、およびSimpleTypeの配列などです。

19.4.1 メタデータ・ファイルおよびデフォルトの収集ファイルの作成

Webサービスの場合と同様に、JMXコマンドライン・ツール(jmxcli)では、必要なターゲット定義ファイル(メタデータとデフォルトの収集ファイル)の作成が容易になります。ツールは、MBeanServerとユーザーをつなぐオフライン構成ユーティリティであり、使用可能なMBeanを参照できます。また、以降のツールの呼出しで既存のファイル・セットにメトリックを追加することもできます。

コマンドライン・ツール・セッション中に、特定のMBeanを選択し、続いてEnterprise Managerがこれらの値を収集するためにこれらのMBeanに対して定期的に取得または起動する必要のある目的の属性/統計値または操作を選択します。ツールは、1つ以上のEnterprise Managerメトリック(列あり)としてのこれらの収集された値のパッケージ化の定義を支援し、またメトリック収集間隔を指定できるようにします。

19.4.1.1 JMXコマンドライン・ツールの構文

JMXコマンドライン・ツール構文は、OC4J上のJMX対応ターゲットの場合、次のようになります。以前のリリースから使用法が変更されていることに注意してください。cliは、管理エージェントのemctlユーティリティに統合されています。

cd Agent Instance Home/bin
emctl jmxcli 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は、Oracleホーム・ディレクトリ10.1.3以降のOracle Application Server Container for J2EE(OC4J)です。

jmxcliコマンドは、次のオプションを受け入れます。

  • -h: OC4Jのホスト名。デフォルト: localhost。

  • -p: OC4JのRMI/RMISポート。デフォルト: 23791。
    アプリケーション・サーバー10.1.3.0以上のインスタンスのORACLE_HOME/opmn/binディレクトリからopmnctl status -1を実行し、MBeanのデプロイ対象となったOC4JのRMIポートを突き止めます。

  • -u: OC4Jの有効なユーザー名。デフォルト: oc4jadmin。

  • -c: -uオプションで指定されたOC4Jユーザーに関連付けられているパスワード。デフォルト: なし。パスワードを指定しない場合、パスワードの入力を求められます。

  • -w: JMXコマンドライン・ツールで作成されたメタデータ・ファイルおよびデフォルトの収集ファイルが置かれるディレクトリ。デフォルト: 現在のディレクトリ。コマンドライン・ツールを起動する場合は、サブディレクトリを作成してファイルを追加するために、このディレクトリに対する書込み権限が必要です。メタデータ・ファイルおよびデフォルトの収集ファイルがそのディレクトリにすでに存在する場合は、元のファイルに追加するか元のファイルを上書きするかを選択できます。

  • -e: OC4JへのRMIS接続が有効になっているかどうか(trueまたはfalse)。デフォルト: false。

3つのパラメータ(-m-dまたは-s)のいずれかを指定して、MBeanServerで使用可能なMBeanのサブセットを取得することもできます。デフォルトでは、これらの3つのパラメータのいずれも指定されていない場合は、MBeanServer上のすべてのMBeanが表示され、そこから選択できます。

  • -m: 取得して検証する必要のある必須のMBeanのMBean ObjectName。これが複数のMBeanと一致するObjectNameパターンの場合は、パターンと一致するすべてのMBeanのリストが表示され、処理するMBeanを一度に1つずつ選択できます。

  • -d: MBeanを取得して検証する必要のある必須アプリケーションのMBeanドメイン。たとえば、アプリケーション(myApp)のすべてのMBeanを参照するとします。このアプリケーションのMBeanは、JMXドメインmyAppで使用できます。

  • -s: メトリックの定義の基にするMBeanの既存のセットと一致するMBeanパターン。-sパラメータを使用すると、類似するタイプの複数のMbeanからJMX属性/統計を一括して取得することができます。

    -sパラメータを指定した場合、このjmxcliセッション時に作成されるメトリックは、Enterprise Managerコンソールに複数行の表で表示されます。この表の1行は、指定したパターンと一致する各MBeanを表し、MBean ObjectNameがキー列になります。たとえば、-s 'oc4j:j2eeType=Servlet,*'と指定した場合、作成されるメトリックの行は複数になり、1行がObjectNameパターンに一致する各サーブレットを表します。MBean ObjectName列に加えて、jmxcliセッション時に選択された、操作の戻りオブジェクトの属性またはフィールドになる列があります。

19.4.1.2 ファイルの生成

JMXコマンドライン・ツールを開始するには、次のようにします。

  1. $AGENT_HOME/binディレクトリに移動します。

  2. 次のコマンドを実行します。

    emctl jmxcli Oracle Home of the target 10.1.3 or greater OC4J [OPTIONS]
    

    起動後は、例19-10に示すように、コマンドライン・インタフェースによって必要な情報を求めるプロンプトが自動的に表示されます。JMXコマンドライン・ツール・セッションを終了する必要がある場合は、任意の時点で[Ctrl]+[C]を押して終了できます。セッション情報は保存されません。

    例19-9 JMXCLI起動のサンプル

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

例19-10 JMXCLIセッションのサンプル

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

これは、Enterprise Manager内に表示される新規J2EEアプリケーションのターゲット・タイプです。

Enter the target version: [1.0] 

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

これは、jmxcliが生成するメタデータ・ファイルの場所です。ターゲットのメタデータ・ファイルとデフォルトの収集ファイルが作成されるディレクトリに対する書込み権限が必要です。

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

jmxcliの呼出し時に指定された-m <MBeanパターン>に複数のMBeanが一致した場合、そのパターンに一致するすべてのMBean ObjectNameが、コマンドライン・セッションのこの部分でリスト表示されます。この時点で、リストからいずれかのMBean ObjectNameを選択できます。最初のMBeanのメトリックを作成後、このjmxcliセッションを終了せずに前述のリストから別のMBeanを選択できます。

前述の-mパターンに一致しない別のMBeanのメトリックを追加する場合、セッションを終了して、後者の(パターンが一致しない)MBeanのMBean ObjectName/パターンで別のjmxcliセッションを開始し、以前のjmxclセッションの元のターゲットのメタデータ・ファイルとデフォルトの収集ファイルに追加されるMBeanのメトリックを作成する必要があります。この方法では、複数のjmxcliセッションから作成されたメトリックを同じターゲットのメタデータ・ファイルとデフォルトの収集ファイルに必要に応じて追加できます。

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

これは、統計コールCreateCountが単純なデータ型ではなく、前述のプロパティを持つJavaBeanパターンであることを示します(これらのプロパティを指定します)。

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

ここでは、意味のある名前を指定できます。名前を指定しない場合、JMXコマンドライン・ツールでデフォルトの名前が生成されますが、この名前がすべての状況に適しているとは限りません。

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

操作の属性や戻り値がTabularDataの場合のように、複数の行が戻される状況では、選択した1つ以上のメトリックを「キー」列として指定する必要があります。

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

この列に対してしきい値を作成するには、演算子を指定してから、クリティカルまたは警告アラートのトリガーとなる値を指定します。

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

これは、アラートのトリガーとなる前述のクリティカルまたは警告値の連続発生数です。

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

リアルタイムのみのメトリックの場合のようにメトリックを定期的に収集する必要がない場合は、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

複数のMBeanが(jmxcliの起動時に指定された)-mオプションのMBeanパターンと一致する場合は、このコマンドライン・セッションの次の反復のために前述のリストから別のMBeanを選択できます。

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...

JMXコマンドライン・ツールによってターゲット・メタデータ・ファイルおよび収集ファイルが生成されたら、Oracleプラグイン・アーカイブを作成できます。前述のコマンドライン・ツール・セッションから生成された各ファイルのサンプルを、例19-11および例19-12に示します。

例19-11 生成されたターゲット・メタデータ・ファイル

<!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>

例19-12 生成されたメトリック収集ファイル

<!DOCTYPE TargetCollection SYSTEM "../dtds/TargetCollection.dtd">
<!-- This file is generated by Collector at 2011-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>

19.4.2 ターゲット・ステータス情報の表示

ターゲットのステータス情報がEnterprise Managerコンソールに正しく表示されるためには、クリティカルしきい値が設定された「ステータス」という名前の列を持つ「レスポンス」というメトリックを定義する必要があります。メトリック値がクリティカルしきい値を下回っている場合、このタイプのターゲット・インスタンスのステータスはコンソールに「稼働中」(使用可能)として表示されます。しきい値を超えている場合、ターゲット・ステータスはコンソールに「停止中」として表示されます。

「レスポンス」メトリックは別のjmxcliセッションで作成できます(以前のセッションで作成されたメタデータ・ファイルおよび収集ファイルにメトリックを追加します)。例19-13に、以前に生成されたメタデータ・ファイルおよび収集ファイルに新しいコマンドライン・セッションから「レスポンス」メトリックを追加する方法を示します。

例19-13 「レスポンス」メトリックの追加

./emctl jmxcli /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 jmxcli 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

19.5 JMXインスツルメント処理されたスタンドアロンのJavaアプリケーションまたはJVMターゲットの監視


注意:

JMXインスツルメント処理されていないJavaアプリケーションが稼働するJ2SE 5.0 JVMを監視する場合は、直接第19.7.3項「スタンドアロンJavaアプリケーションまたはJVMターゲットの構成」に移動してタイプJVMのターゲット・インスタンスを作成してください。これにより、Enterprise Manager(できれば、JVMと同じホストにインストールされたEnterprise Managerエージェント)で、これらのJVMを監視できるようになります。ただし、後述する前提条件および既知の制限事項が適用されます。

Enterprise Managerには、即時利用可能なJVMターゲット・タイプが用意されています。これを使用することで、Enterprise Managerバージョン10.2.0.3以降でリモート管理に使用できるスタンドアロンJ2SE1.5 JVMのメトリックを追加および構成できます。

Oracle Container for J2EEにデプロイされたJ2EEアプリケーションに関して、使用するスタンドアロンJavaアプリケーションではJMX MBeanを介してデータが公開される場合は、JMXコマンドライン・ツールを使用して、このようなアプリケーションをEnterprise Managerターゲット・タイプとして定義し、このターゲット・タイプのメタデータ・ファイルおよびデフォルトの収集ファイルを生成できます。Enterprise Managerエージェント(JVMと同じホストにインストールすることを推奨)からスタンドアロン・アプリケーション・ターゲットを監視できます。そのホストで実行されている複数のJVMを、同じEnterprise Managerエージェントで監視できます。

(J2SE1.5ベースの)スタンドアロンJVMでユーザー定義のMBeanからメトリックを収集し、JMX fetchletを使用してEnterprise Manager内に配置できます。fetchletは、引数および戻り値としてJMX OpenTypeを使用するユーザー定義のMBeanを含む、スタンドアロンのSun J2SE1.5(またはそれ以降)ベースのJVM用に設計されています。

前提条件

  • 特定のホスト上で稼働するJava仮想マシンJ2SE 1.5以上のインスタンス。このJVMは、Enterprise Managerでターゲットとして監視する必要があるMBeanを介してメトリックを公開する、JMX対応アプリケーションで実行できます。アプリケーションによってMBeanが公開されない場合は、Enterprise Managerで提供される組込みJVMターゲット・タイプを使用して、JVM自体を監視できます。詳細は、第19.7.3項「スタンドアロンJavaアプリケーションまたはJVMターゲットの構成」を参照してください。

  • ローカル・アクセスに対して有効なJMXエージェント。JVMまたはJavaアプリケーションの起動時に、このシステム・プロパティを設定してください。

    com.sun.management.jmxremote

  • 有効なリモート・システムからの監視および管理。JVMの起動時に、このシステム・プロパティを設定してください。

    com.sun.management.jmxremot.port=portNum

    リモート管理用にJVMを有効化する処理の詳細は、次のドキュメントを参照してください。

    http://java.sun.com/j2se/1.5.0/docs/guide/management/
    agent.html#remote

  • そのホストに管理エージェント・バージョン10.2.0.3以降がインストールされていること。

  • Oracle Management Server(OMS)バージョン10.2.0.3以上が管理エージェントと通信していること。

既知の制限事項

現在、jmxcliツールでは、ターゲットJVMインスタンス上のデフォルトのプラットフォームMBeanserverで使用可能な(プラットフォームおよびアプリケーションで定義された)MBeanの参照および監視のみ行うことができます。ターゲットJVMインスタンス上のカスタムMBeanServerの監視はサポートされていません。jmxcliツールは基本的に、属性と、OpenType(SimpleType、CompositeType、TabularTypeおよびSimpleTypeの配列など)である操作のパラメータおよび戻り値を処理します。

19.5.1 メタデータ・ファイルおよびデフォルトの収集ファイルの生成

OC4JのWebサービスやJ2EEアプリケーションの場合と同様に、コマンドライン・ツール(jmxcli)では、JMXインスツルメント処理されたスタンドアロンのJavaアプリケーションの必要なターゲット定義ファイル(メタデータ・ファイルとデフォルトの収集ファイル)の作成が容易になります。ツールは、J2SE1.5以上のJVMのMBeanServerとユーザーをつなぐオフライン構成ユーティリティであり、使用可能なMBeanを参照できます。また、以降のツールの呼出しで既存のファイル・セットにメトリックを追加することもできます。

コマンドライン・ツール・セッション中に、特定のMBeanを選択し、続いてEnterprise Managerがこれらの値を収集するためにこれらのMBeanに対して定期的に取得または起動する必要のある目的の属性/統計値または操作を選択します。ツールは、1つ以上のEnterprise Managerメトリック(列あり)としてのこれらの収集された値のパッケージ化の定義を支援し、またメトリック収集間隔を指定できるようにします。

19.5.1.1 JMXコマンドライン・ツールの構文

JMXコマンドライン・ツールの構文は次のとおりです。

cd Agent Instance dir/bin
emctl jmxcli -t JVM
                [  -l JMXServiceURL
                   -h hostname
                   -p port
                   -u username
                   -c credential/password
                   -w work directory
                   -e true/false
                   [-m MBeanName | -d jmx_domain | -s mBeanPattern]
                ]

jmxcliコマンドは、次のオプションを受け入れます。

  • -t JVM: MBeanServerがスタンドアロンのJVM上にあることを示します。

  • -l: ターゲットJVMのJMXServiceURL。

  • -h: JVMのホスト名。デフォルト: localhost(-lオプションが指定されていない場合)。

  • -p: JVMのRMI/RMISポート。デフォルト: 23791(-lオプションが指定されていない場合)。アプリケーション・サーバー10.1.3.0以上のインスタンスのORACLE_HOME/opmn/binディレクトリからopmnctl status -1を実行し、MBeanのデプロイ対象となったOC4JのRMIポートを突き止めます。

  • -u: JVMの有効なユーザー名。デフォルト: なし。

  • -c: 前述のユーザーのパスワード。デフォルト: なし。このパスワードはデータの取得のみに使用されるもので、どこにも格納されません。

  • -w: メタデータ・ファイルおよびデフォルトの収集ファイルが作成される作業ディレクトリ。デフォルト: 現在のディレクトリ。コマンドライン・ツールを起動する場合は、サブディレクトリを作成してファイルを追加するために、このディレクトリに対する書込み権限が必要です。メタデータ・ファイルおよびデフォルトの収集ファイルがそのディレクトリにすでに存在する場合は、元のファイルに追加するか元のファイルを上書きするかを選択できます。

  • -e: JVMへのSSL接続を有効にする場合はtrueに設定します。デフォルト: false。

3つのパラメータ(-m-dまたは-s)のいずれかを指定して、MBeanServerで使用可能なMBeanのサブセットを取得することもできます。デフォルトでは、これらの3つのパラメータのいずれも指定されていない場合は、MBeanServer上のすべてのMBeanが表示され、そこから選択できます。

  • -m: 取得して検証する必要のある必須のMBeanのMBean ObjectName。これが複数のMBeanと一致するObjectNameパターンの場合は、パターンと一致するすべてのMBeanのリストが表示され、処理するMBeanを一度に1つずつ選択できます。

  • -d: MBeanを取得して検証する必要のある必須アプリケーションのMBeanドメイン。たとえば、アプリケーション(myApp)のすべてのMBeanを参照するとします。このアプリケーションのMBeanは、JMXドメインmyAppで使用できます。

  • -s: メトリックの定義の基にするMBeanのセットと一致するMBeanパターン。-sパラメータを使用すると、類似するタイプの複数のMbeanからJMX属性/統計を一括して取得することができます。

    -sパラメータを指定した場合、このjmxcliセッション時に作成されるメトリックは、Enterprise Managerコンソールに複数行の表で表示されます。この表の1行は、指定したパターンと一致する各MBeanを表し、MBean ObjectNameがキー列になります。たとえば、-s 'oc4j:j2eeType=Servlet,*'と指定した場合、作成されるメトリックの行は複数になり、1行がObjectNameパターンに一致する各サーブレットを表します。MBean ObjectName列に加えて、jmxcliセッション時に選択された、操作の戻りオブジェクトの属性またはフィールドになる列があります。

19.5.1.2 ファイルの生成

次の手順は、JMXコマンドライン・ツールでファイルを生成するための準備およびツールの使用方法を説明しています。

  1. MBeanがあるスタンドアロンJVMインスタンスを起動します。次の例はJVMの起動を示しています。

    JDK15/bin/java -Dcom.sun.management.jmxremote
    -Dcom.sun.management.jmxremote.port=6789 
    -Dcom.sun.management.jmxremote 
    -Dcom.sun.management.jmxremote.authenticate=false
    -Dcom.sun.management.jmxremote.ssl=false MyJMXEnabledApp $*
    

    jmxcliツールは、このポート番号にJSR-160クライアントとして接続します。

  2. バージョン10.2.0.3以降のEnterprise Managerエージェントの$ORACLE_HOME/binディレクトリに移動します。

  3. 環境変数を次のように設定します。

    setenv USER_JARS /myAppHome/myJar1.jar;/myAppHome/myJar2.jar
    

    ターゲットMBeanServerに登録されているいずれかのMBeanの属性または操作、もしくはその両方でカスタム・クラスが戻される場合は、この手順を行う必要があります。Enterprise Managerエージェント(fetchlet)は、JMX OpenTypeを戻す属性または操作、もしくはその両方を効率的に監視できますが、任意のカスタム・クラスのJava Beanプロパティを(getterおよびsetterを介して)処理することもできます。


    注意:

    アプリケーション定義のMBeanによってカスタム・クラスが戻される場合は、さらに、このアプリケーションを監視するEnterprise ManagerエージェントのCLASSPATHで、対応するユーザーのjarファイルを設定する必要があります。これを行うには、このjarファイルの場所をEnterprise Managerエージェントの$ORACLE_HOME/sysman/config/classpath.lstファイルに手動で挿入し、Enterprise Managerエージェントを再起動します。

  4. 次のコマンドを実行します。

    ./emctl jmxcli -t JVM -h localhost -p 6789 u user -c password
    

    詳細は次のとおりです。

    • -t JVM: MBeanServerが標準のJVM上で稼働していることを示します。

    • -h: JVMが稼働するホストの名前。

    • -p: JSR-160リモート・アクセス用にJVMを有効化するポート番号。

    -h hostおよび-p portの各オプションのかわりに-l JMXServiceURLオプションを指定することもできます。

    -w work directoryオプションを使用してjmxcliを起動し、指定された作業ディレクトリにメタデータ・ファイルおよびデフォルトの収集ファイルを作成できます。jmxcliの起動時に-wを指定しない場合は、デフォルトで現在のディレクトリ(jmxcliを起動するディレクトリ)が使用されます。

起動後は、例19-14に示すように、コマンドライン・インタフェースによって必要な情報を求めるプロンプトが自動的に表示されます。ほとんどのプロンプトでは、デフォルトを使用するために[Enter]キーを押すだけで構いません。JMXコマンドライン・ツール・セッションを終了する必要がある場合は、任意の時点で[Ctrl]+[C]を押して終了できます。セッション情報は保存されません。

終了後にセッションが終わると、その結果がmetadata/myJ2EEApp.xmlのようなmyJ2EEApp.xmlファイル(または指定したターゲット・タイプ)になり、
定期的な収集を指定した場合はdefault_collection/myJ2EEApp.xmlファイルになります。

JMXCLI起動のサンプル

次のサンプルは、リモートMBeanServerのすべてのMBeanを参照できるようにします。

./emctl jmxcli -t JVM -p 6789 (the host defaults to "localhost")

次のサンプルは、コマンドライン・インタフェースを起動し、-mオプションの引数として指定されたMBeanPatternに基づいてMBeanをフィルタ処理します。

./emctl jmxcli -t JVM -p 6789 -m "java.lang:*"

例19-14 JMXCLIセッションのサンプル

oracleHome=/ade/sparmesw_emas_ml/oracle
userJars=
 
Connecting to server: localhost:6789
Connecting without authentication. For specifying username and password use
the -u and -c options.
 
Obtained 14 MBeans matching pattern java.lang:*. 
 
Enter the target type for this metric: [myJ2EEApp] myJavaApp
 
Enter the target version: [1.0] 
 
Enter the target metadata file: [./metadata/myJavaApp.xml] 
 
Enter the default collections file: [./default_collection/myJavaApp.xml] 
 
Enter a label for this target type: [myJavaApp] 
 
Enter a description for this target type: [myJavaApp] 
The available targets are: 
0: sun.management.CompilationImpl
        (java.lang:type=Compilation)

1: sun.management.MemoryManagerImpl        (java.lang:name=CodeCacheManager,type=MemoryManager)

2: sun.management.GarbageCollectorImpl        (java.lang:name=Copy,type=GarbageCollector)

3: sun.management.MemoryPoolImpl        (java.lang:name=Eden Space,type=MemoryPool)

4: sun.management.RuntimeImpl        (java.lang:type=Runtime)

5: sun.management.ClassLoadingImpl        (java.lang:type=ClassLoading)

6: sun.management.MemoryPoolImpl        (java.lang:name=Survivor Space,type=MemoryPool)

7: sun.management.ThreadImpl        (java.lang:type=Threading)

8: sun.management.GarbageCollectorImpl        (java.lang:name=MarkSweepCompact,type=GarbageCollector)

9: com.sun.management.UnixOperatingSystem        (java.lang:type=OperatingSystem)

10: sun.management.MemoryImpl        (java.lang:type=Memory)

11: sun.management.MemoryPoolImpl        (java.lang:name=Code Cache,type=MemoryPool)

12: sun.management.MemoryPoolImpl        (java.lang:name=Tenured Gen,type=MemoryPool)

13: sun.management.MemoryPoolImpl        (java.lang:name=Perm Gen,type=MemoryPool)

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

Following metric source types are available for selected target(s):
        0: JMX Attributes

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

Attributes are: 

        0: BootClassPath         Return Value: java.lang.String
        1: BootClassPathSupported        Return Value: boolean
        2: ClassPath     Return Value: java.lang.String
        3: InputArguments        Return Value: [Ljava.lang.String;
        4: LibraryPath   Return Value: java.lang.String
        5: ManagementSpecVersion         Return Value: java.lang.String
        6: Name  Return Value: java.lang.String
        7: SpecName      Return Value: java.lang.String
        8: SpecVendor    Return Value: java.lang.String
        9: SpecVersion   Return Value: java.lang.String
        10: StartTime    Return Value: long
        11: SystemProperties     Return Value:
javax.management.openmbean.TabularData
        12: Uptime       Return Value: long
        13: VmName       Return Value: java.lang.String
        14: VmVendor     Return Value: java.lang.String
        15: VmVersion    Return Value: java.lang.String
Select one or more items as comma-separated indices: 6,7,8

Number of possible columns in the resultant metric are 3.

Enter the name for this metric column at index=0 : [Name] 
Is this column a KEY Column <y/n>? [n] y
Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [Name] 
Enter the NLSID for column: [Name] 
Enter the UNIT for column "Name": [millisec, kb etc.. ] 

Enter the name for this metric column at index=1 : [SpecName] 
Is this column a KEY Column <y/n>? [n] 
Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [SpecName] 
Enter the NLSID for column: [SpecName] 
Enter the UNIT for column "SpecName": [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 : [SpecVendor] 
Is this column a KEY Column <y/n>? [n] 
Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [SpecVendor] 
Enter the NLSID for column: [SpecVendor] 
Enter the UNIT for column "SpecVendor": [millisec, kb etc.. ] 
Do you want to create a threshold for this column <y/n>? [n]

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

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] 
Written the metadata xml file: ./metadata/myJavaApp.xml.
Creating new file: ./default_collection/myJavaApp.xml.
Updated the default collection file for myJavaApp at location
./default_collection/myJavaApp.xml.
Exiting...

19.5.2 メタデータ・ファイルおよびデフォルトの収集ファイルの使用方法

currentDir/metadataディレクトリおよびcurrentDir/default_collectionディレクトリで(先に指定したターゲット・タイプの)myTarget.xmlファイルを探します。

これらのファイルは、次のように使用できます。

ターゲットのステータス情報をEnterprise Managerコンソールに正しく表示するには、レスポンス・メトリックを定義する必要があります。詳細は、第19.4.2項「ターゲット・ステータス情報の表示」を参照してください。

19.6 Oracle WebLogic Application ServerにデプロイされたJMXアプリケーションの監視

11.1管理エージェントに付属のJMX fetchletを使用すると、Oracle WebLogic Application Server 9.x以降にデプロイされたJMXインスツルメント処理アプリケーションのキー・メトリックを監視できます。Enterprise ManagerでJMXインスツルメント処理アプリケーションを監視する場合、Enterprise Managerが監視できる新しいターゲット・タイプを管理プラグインから定義する必要があります。Webサービスのwscliコマンドライン・ツールと同様に(Oracle Application Server(OC4J)で可能なように)、Enterprise Managerには、WebLogicサーバー上のカスタムJMXインスツルメント処理アプリケーションのターゲットのメタデータ・ファイルおよび収集ファイルの生成を自動化するためのjmxcliコマンドライン・ツールが用意されています。

前提条件

  • JMX対応のアプリケーションがデプロイされた特定のホスト上で、Enterprise Managerでターゲットとして監視する必要のあるOracle WebLogic Server 9.xのインスタンスが稼働していること。

  • そのホストに管理エージェント・バージョン11.1以上がインストールされていること(推奨)。

  • Oracle Management Server(OMS)バージョン10.2.0.4以上が管理エージェントと通信していること。

  • jmxcliツールは基本的に、属性と、OpenTypeである操作のパラメータおよび戻り値を処理します。たとえば、SimpleType、CompositeType、TabularType、およびSimpleTypeの配列などです。

19.6.1 jmxcliを使用したメタデータ・ファイルおよびデフォルトの収集ファイルの作成

Webサービスの場合と同様に、JMXコマンドライン・ツール(jmxcli)では、必要なターゲット定義ファイル(メタデータとデフォルトの収集ファイル)の作成が容易になります。ツールは、MBeanServerとユーザーをつなぐオフライン構成ユーティリティであり、使用可能なMBeanを参照できます。ツールの以降の呼出しで既存のファイルにメトリックを追加することもできます。コマンドライン・ツールのセッション中に、特定のMBeanを選択し、続いてEnterprise Managerで取得する必要がある目的のJMX属性/統計値、またはこれらの値を収集するために選択したMBeanに対して定期的に起動する必要のあるJMX操作を選択します。ツールは、1つ以上のEnterprise Managerメトリック(列あり)としてのこれらの収集された値のパッケージ化の定義を支援し、また列のメトリック収集間隔やしきい値を指定できるようにします。

19.6.1.1 JMXコマンドライン・ツールの構文

Oracle Weblogic Application Server上にあるJMX対応ターゲットのJMXコマンドライン・ツールの構文は次のとおりです。

./emctl jmxcli -t WebLogic [help|options]
  where options are:           [  -l JMX ServiceURL              
              -u username
              -c credential/password
              -w work directory              
              [-m MBeanName | -d jmx_domain | -s mBeanPattern]
                ]

jmxcliコマンドは、次のオプションを受け入れます。

  • l : カスタムMBeanをフォームでホスティングするWeblogic管理対象サーバーへのJMXServiceURL

    service:jmx:t3://host:t3port/jndi/weblogic.management.mbeanservers.runtime
    
  • u: WebLogicドメインの有効なユーザー名。デフォルト: weblogic

  • c: -uオプションで指定されたユーザーに関連付けられているパスワード。デフォルト: なし。パスワードを指定しない場合、パスワードの入力を求められます。

  • w: JMXコマンドライン・ツールで作成されたメタデータ・ファイルおよびデフォルトの収集ファイルが置かれるディレクトリ。デフォルト: 現在のディレクトリ。

    コマンドライン・ツールを起動する場合は、サブディレクトリを作成してファイルを追加するために、このディレクトリに対する書込み権限が必要です。メタデータ・ファイルおよびデフォルトの収集ファイルがそのディレクトリにすでに存在する場合は、元のファイルに追加するか元のファイルを上書きするかを選択できます。

3つのパラメータ(-m、-dまたは-s)のいずれかを指定して、MBeanServerで使用可能なMBeanのサブセットを取得することもできます。デフォルトでは、これらの3つのパラメータのいずれも指定されていない場合は、MBeanServer上のすべてのMBeanが表示され、そこから選択できます。

  • m: 取得して検証する必要のある必須のMBeanのMBean ObjectName。これが複数のMBeanと一致するObjectNameパターンの場合は、パターンと一致するすべてのMBeanのリストが表示され、処理するMBeanを一度に1つずつ選択できます。

  • d: MBeanを取得して検証する必要のある必須アプリケーションのMBeanドメイン。たとえば、アプリケーション(myApp)のすべてのMBeanを参照するとします。このアプリケーションのMBeanは、JMXドメインmyAppで使用できます。

  • s: メトリックの定義の基にするMBeanの既存のセットと一致するMBeanパターン。-sパラメータを使用すると、類似するタイプの複数のMBeanからJMX属性/統計を1つのメトリック内に取得することができます。

    -sパラメータを指定した場合、このjmxcliセッション時に作成されるメトリックは、Enterprise Managerコンソールに複数行の表で表示されます。この表の1行は、指定したパターンに一致する各MBeanを表し、他にキー列が定義されない場合、MBean ObjectNameがキー列になります。たとえば、-s 'com.bea:Type=ServletRuntime,*'と指定した場合、作成されるメトリックの行は複数になり、1行がObjectNameパターンに一致する各サーブレットを表します。MBean ObjectNameキー列に加えて、jmxcliセッション時に選択された、操作の戻りオブジェクトの属性またはフィールドになる列があります。

19.6.1.2 ファイルの生成

JMXコマンドライン・ツールを開始するには、次のようにします。

  1. $AGENT_HOME/binディレクトリに移動します。

  2. 次のコマンドを実行します。

    ./emctl jmxcli -t WebLogic [オプション]

起動後に、コマンドライン・インタフェースは、次の例に示すように必要な情報を求めるプロンプトを自動的に表示します。JMXコマンドライン・ツール・セッションを終了する必要がある場合は、任意の時点で[Ctrl]+[C]を押して終了できます。セッション情報は保存されません。

次の例は、jmxcliセッションのサンプルです。

例19-15 jmxcliセッション

$ ./emctl jmxcli -t WebLogic -l "service:jmx:t3://stbct14:22048/jndi/weblogic.management.mbeanservers.runtime" -u weblogic -c welcome1 -s "*:type=soainfra_bpel_requests,*"

注意1: 前述の-sオプションでは、エージェントでメトリックが収集されるたびに、指定されたObjectNameパターンに一致するMBeansの数と同じ行数を持つメトリックが生成されます。常に特定のMBeanから収集する必要がある場合は、-m <ObjectName>オプションを、前述の例で使用されている-s <Mbeanパターン>のかわりに使用してください。

注意2: t3sを使用してweblogicサーバーに接続する必要がある場合は次の環境変数を、jmxcliを起動する前に設定します。

setenv USER_JAVA_PROPS=-Dweblogic.security.TrustKeyStore=CustomTrust
 -Dweblogic.security.CustomTrustKeyStoreFileName=$ORACLE_HOME/sysman/config/montrust/AgentTrust.jks
 -Dweblogic.security.SSL.enforceConstraints=off
 -Dweblogic.security.SSL.ignoreHostnameVerification=true
 -Djavax.net.ssl.trustStore=$ORACLE_HOME/sysman/config/montrust/AgentTrust.jks  (or set USER_JAVA_PROP= … equivalent on win32)
setenv USER_JARS  <; separated list of jars needed in classpath if custom authentication modules are involved in SSL connection>

セミコロンがjarファイルのリストのデリミタとして使用されます。

例: setenv USER_JARS "jar1;jar2;jar3"

MBeanがカスタムWeblogicオブジェクトをMBeanInfoで返すようなケースでは、jmxcliを起動する前に、weblogic.jarを前述の環境変数に設定することが必要な場合があります。

例: setenv USER_JARS $BEA_HOME/server/lib/weblogic.jar

oracleHome=/ade/sparmesw_egcli/oracle/work/middleware/oms
userJars=
Connecting to server:
 service:jmx:t3://stbct14:22048/jndi/weblogic.management.mbeanservers.runtime
Connecting as user: weblogic
Obtained 3 MBeans matching pattern *:type=soainfra_bpel_requests,*. 

Enter the target type for this metric: [myJ2EEApp] myCustomWLApp
Enter the target version: [1.0] 
Enter the target metadata file: [./metadata/myCustomWLApp.xml] 
Enter the default collections file: [./default_collection/myCustomWLApp.xml] 
Enter a label for this target type: [myCustomWLApp] 
Enter a description for this target type: [myCustomWLApp] 
The available targets are: 
0: DMS metric mbean
        (oracle.dms:name=/soainfra/engines/bpel/requests/engine,type=soainfra_bpel_requests)
1: DMS metric mbean
        (oracle.dms:name=/soainfra/engines/bpel/requests/system,type=soainfra_bpel_requests)
2: DMS metric mbean
        (oracle.dms:name=/soainfra/engines/bpel/requests/invoke,type=soainfra_bpel_requests)
Following metric source types are available for selected target(s):
        0: JMX Attributes
Enter the index of your choice or press <Ctrl-C> to quit: 0
Attributes are: 
        0: active_count  Return Value: java.lang.Integer
        1: active_maxValue       Return Value: java.lang.Integer
        2: active_minValue       Return Value: java.lang.Integer
        3: active_value  Return Value: java.lang.Integer
        4: Name  Return Value: java.lang.String
        5: Parent        Return Value: java.lang.String
        6: scheduled_count       Return Value: java.lang.Integer
        7: scheduled_maxValue    Return Value: java.lang.Integer
        8: scheduled_minValue    Return Value: java.lang.Integer
        9: scheduled_value       Return Value: java.lang.Integer
        10: threadCount_count    Return Value: java.lang.Integer
        11: threadCount_maxValue         Return Value: java.lang.Integer
        12: threadCount_minValue         Return Value: java.lang.Integer
        13: threadCount_value    Return Value: java.lang.Integer

Select one or more items as comma separated indices: 4,0,1,2
Number of possible columns in the resultant metric are 4.

Enter the name for this metric column at index=0 : [Name] 
Is this column a KEY Column <y/n>? [n] y

"y"を指定すると、複数の行が返されるような場合にこの列の値が一意であることが示されます。

Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [Name] 
Enter the NLSID for column: [Name] 
Enter the UNIT for column "Name": [millisec, kb etc.. ] 

Enter the name for this metric column at index=1 : [active_count] 
Is this column a KEY Column <y/n>? [n] 
Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [active_count] 
Enter the NLSID for column: [active_count] 
Enter the UNIT for column "active_count": [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: 0
Enter the CRITICAL threshold: [NotDefined] 50
Enter the WARNING threshold: [NotDefined] 45
Enter the number of occurrences that trigger threshold: [6] 3
Enter the message to be used when threshold is triggered: [active_count is %value% and has crossed warning (%warning_threshold%) or critical (%critical_threshold%) threshold.] 
Enter NLSID for the message used when threshold is triggered: [active_count_cond] Enter the name for this metric column at index=2 : [active_maxValue] 
Is this column a KEY Column <y/n>? [n] 
Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [active_maxValue] 
Enter the NLSID for column: [active_maxValue] 
Enter the UNIT for column "active_maxValue": [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=3 : [active_minValue] 
Is this column a KEY Column <y/n>? [n] 
Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [active_minValue] 
Enter the NLSID for column: [active_minValue] 
Enter the UNIT for column "active_minValue": [millisec, kb etc.. ] 
Do you want to create a threshold for this column <y/n>? [n] 

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

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]  
Written the metadata xml file: ./metadata/myCustomWLApp.xml.
Creating new file: ./default_collection/myCustomWLApp.xml.
Updated the default collection file for myCustomWLApp at location ./default_collection/myCustomWLApp.xml.
Exiting...

例19-16 jmxcli起動のサンプル(-mを使用し、複数のMBeanの複数のメトリックを1つのjmxcliセッションで定義)

$ ./emctl jmxcli -t WebLogic -l "service:jmx:t3://stbct14:22048/jndi/weblogic.management.mbeanservers.runtime" -u weblogic -c welcome1 -m "com.bea:ApplicationRuntime=soa-infra,WebAppComponentRuntime=soa_server1_/b2b,*"

oracleHome=/ade/sparmesw_egcli/oracle/work/middleware/oms
userJars=
Connecting to server: service:jmx:t3://stbct14:22048/jndi/weblogic.management.mbeanservers.runtime
Connecting as user: weblogic
Obtained 8 MBeans matching pattern com.bea:ApplicationRuntime=soa-infra,WebAppComponentRuntime=soa_server1_/b2b,*. 

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

Enter the target version: [1.0] 

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

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

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

注意: ファイルがすでに存在するため、これは追加されます。

Appending to existing file: ./metadata/myCustomWLApp.xml.
The available targets are: 
0: (com.bea:ApplicationRuntime=soa-infra,Name=JspServlet,ServerRuntime=soa_server1,Type=ServletRuntime,WebAppComponentRuntime=soa_server1_/b2b)
1: (com.bea:ApplicationRuntime=soa-infra,Name=transportServlet,ServerRuntime=soa_server1,Type=ServletRuntime,WebAppComponentRuntime=soa_server1_/b2b)
2: (com.bea:ApplicationRuntime=soa-infra,Name=transportServletV,ServerRuntime=soa_server1,Type=ServletRuntime,WebAppComponentRuntime=soa_server1_/b2b)
3: (com.bea:ApplicationRuntime=soa-infra,Name=b2b_starter_wls,ServerRuntime=soa_server1,Type=ServletRuntime,WebAppComponentRuntime=soa_server1_/b2b)
4: (com.bea:ApplicationRuntime=soa-infra,Name=soa_server1_soa_server1_/b2b,ServerRuntime=soa_server1,Type=PageFlowsRuntime,WebAppComponentRuntime=soa_server1_/b2b)
5 (com.bea:ApplicationRuntime=soa-infra,Name=WebServiceServlet,ServerRuntime=soa_server1,Type=ServletRuntime,WebAppComponentRuntime=soa_server1_/b2b)
6: (com.bea:ApplicationRuntime=soa-infra,Name=RedirectUIServlet,ServerRuntime=soa_server1,Type=ServletRuntime,WebAppComponentRuntime=soa_server1_/b2b)
7: (com.bea:ApplicationRuntime=soa-infra,Name=FileServlet,ServerRuntime=soa_server1,Type=ServletRuntime,WebAppComponentRuntime=soa_server1_/b2b)
Enter the index of target/MBean you wish to monitor or press <Ctrl-C> to quit: 4
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: AppName       Return Value: java.lang.String
        1: ContextPath   Return Value: java.lang.String
        2: HttpServerName        Return Value: java.lang.String
        3: Name  Return Value: java.lang.String
        4: PageFlows     Return Value: [Ljavax.management.ObjectName;
        5: Parent        Return Value: javax.management.ObjectName
        6: ServerName    Return Value: java.lang.String
        7: Type  Return Value: java.lang.String

Select one or more items as comma separated indices: 3,0,1

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

Enter the name for this metric column at index=1 : [AppName] 
Is this column a KEY Column <y/n>? [n] 
Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [AppName] 
Enter the NLSID for column: [AppName] 
Enter the UNIT for column "AppName": [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 : [ContextPath] 
Is this column a KEY Column <y/n>? [n] 
Is this column for SUMMARY_UI <y/n>? [n] 
Enter the label for column: [ContextPath] 
Enter the NLSID for column: [ContextPath] 
Enter the UNIT for column "ContextPath": [millisec, kb etc.. ] 
Do you want to create a threshold for this column <y/n>? [n] 
Enter the name of this metric: PageFlowsRuntime
Enter the label for this metric: [PageFlowsRuntime] 

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

Do you want to create another metric <y/n>? [n] y    

これは、このjmxcliセッションでさらにメトリックを作成する必要があることを示しています。このプロセスは、ユーザーが質問に"n"と答えるまで繰り返されます。

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

JMXコマンドライン・ツールによってターゲット・メタデータ・ファイルおよび収集ファイルが生成されたら、Oracleプラグイン・アーカイブ(OPAR)を作成できます。

19.6.1.3 ターゲット・ステータス情報の表示

ターゲットのステータス情報がEnterprise Managerコンソールに正しく表示されるためには、クリティカルしきい値が設定された「ステータス」という名前の列を持つ 「レスポンス」というメトリックを定義する必要があります。メトリック値がクリティカルしきい値を下回っている場合、このタイプのターゲット・インスタンスのステータスはコンソールに「稼働中」(使用可能)として表示されます。しきい値を超えている場合、ターゲット・ステータスはコンソールに「停止中」として表示されます。

「レスポンス」メトリックは別のjmxcliセッションで作成できます(以前のセッションで作成されたメタデータ・ファイルおよび収集ファイルにメトリックを追加します)。

例19-17 「レスポンス」メトリックの追加

setenv USER_JARS $T_WORK/middleware/wlserver_10.3/server/lib/weblogic.jar

これは、JMXクライアント(jmxcli)がそのクラスパス内で必要とするWeblogic固有クラスを、MBeanが返す場合に必要になります。

$ ./emctl jmxcli -t WebLogic -l "service:jmx:t3://stbct14:22048/jndi/weblogic.management.mbeanservers.runtime" -u weblogic -c welcome1 -m com.bea:Type=ApplicationRuntime,Name=soa-infra,*"

WeblogicにデプロイされたJ2EEアプリケーションに対して、アプリケーションのデプロイに対応するApplicationRuntime MBeanのActiveVersionState JMX属性を、Status列として作成することが適切な場合があります。ただし、アプリケーションに関連するその他のMBeanのその他すべての属性も使用される可能性があります。

oracleHome=/ade/sparmesw_egcli/oracle/work/middleware/oms
userJars=
Connecting to server: service:jmx:t3://stbct14:22048/jndi/weblogic.management.mbeanservers.runtime
Connecting as user: weblogic
Obtained 1 MBeans matching pattern
 com.bea:Type=ApplicationRuntime,Name=soa-infra,*. 
Enter the target type for this metric: [myJ2EEApp] myCustomWLApp
Enter the target version: [1.0] 
Enter the target metadata file: [./metadata/myCustomWLApp.xml] 
Enter the default collections file: [./default_collection/myCustomWLApp.xml] 
The file ./metadata/myCustomWLApp.xml already exists. 

Do you want to overwrite the existing file, append to it, or quit <o/a/q>? [a] 
Appending to existing file: ./metadata/myCustomWLApp.xml.
The available targets are: 
0: (com.bea:Name=soa-infra,ServerRuntime=soa_server1,Type=ApplicationRuntime)
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: ActiveVersionState    Return Value: java.lang.Integer
        1: ApplicationName       Return Value: java.lang.String
        2: ApplicationVersion    Return Value: java.lang.String
        3: ClassRedefinitionRuntime      Return Value: javax.management.ObjectName
        4: ComponentRuntimes     Return Value: [Ljavax.management.ObjectName;
        5: EAR   Return Value: java.lang.Boolean
        6: HealthState   Return Value: weblogic.health.HealthState
        7: KodoPersistenceUnitRuntimes   Return Value: [Ljavax.management.ObjectName;
        8: LibraryRuntimes       Return Value: [Ljavax.management.ObjectName;
        9: MaxThreadsConstraintRuntimes  Return Value: [Ljavax.management.ObjectName;
        10: MinThreadsConstraintRuntimes         Return Value: [Ljavax.management.ObjectName;
        11: Name         Return Value: java.lang.String
        12: OptionalPackageRuntimes      Return Value: [Ljavax.management.ObjectName;
        13: Parent       Return Value: javax.management.ObjectName
        14: QueryCacheRuntimes   Return Value: [Ljavax.management.ObjectName;
        15: RequestClassRuntimes         Return Value: [Ljavax.management.ObjectName;
        16: Type         Return Value: java.lang.String
        17: WorkManagerRuntimes  Return Value: [Ljavax.management.ObjectName;
        18: WseeRuntimes         Return Value: [Ljavax.management.ObjectName;

Select one or more items as comma separated indices: 0

Number of possible columns in the resultant metric are 1.

Enter the name for this metric column at index=0 : [ActiveVersionState] Status

注意: 列名は"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] 2

レスポンス・メトリックのStatus列でCRITICAL THRESHOLDがトリガーされると、ターゲットのステータスが停止中としてマークされます。この場合、if value != ACTIVATED(!= 2など)になります。

Enter the WARNING threshold: [NotDefined] 
Enter the number of occurrences that trigger threshold: [6] 1
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

注意: メトリック名は"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] 
Written the metadata xml file: ./metadata/myCustomWLApp.xml.
Updated the default collection file for myCustomWLApp at location ./default_collection/myCustomWLApp.xml.
Exiting...

19.6.2 メタデータ・ファイルおよびデフォルトの収集ファイルの使用方法

currentDir/metadataディレクトリおよびcurrentDir/default_collectionディレクトリで(先に指定したターゲット・タイプの)myTarget.xmlファイルを探します。

これらのファイルは、次のように使用できます。

ターゲットのステータス情報をEnterprise Managerコンソールに正しく表示するには、レスポンス・メトリックを定義する必要があります。詳細は、第19.6.1.3項「ターゲット・ステータス情報の表示」を参照してください。

19.7 管理エージェントへのターゲットの追加

プラグインがOMSにデプロイされると、メタデータ・プラグインで定義されたターゲットを別の監視管理エージェントに追加する準備ができます。

説明のために、次の手順では、サンプルのCalculatorServiceおよびTrafficLightをターゲットとして追加する方法を示します。

19.7.1 Webサービス・ターゲットの追加: CalculatorService

CalculatorServiceターゲットを追加するには、次の手順を実行します。

  1. 「設定」メニューから、「ターゲットの追加」「ターゲットの手動追加」の順に選択します。

  2. 「ターゲット監視プロパティを指定して非ホスト・ターゲットを追加」を選択します。

  3. 「ターゲット・タイプ」メニューからCalculatorServiceを選択します。

  4. 「監視エージェント」メニューから、必要な監視管理エージェントを選択します。

    画像は、手動によるターゲットの追加を示しています。
  5. 「手動追加」をクリックして続けます。

  6. 監視するターゲットのプロパティ値を入力します。

    画像は、calculatorサービスの追加を示しています。
  7. 「OK」をクリックして、プロセスを完了します。確認ウィンドウに、新しく追加されたターゲットの情報が表示されます。

19.7.2 WS-Managementターゲットの追加: TrafficLight

TrafficLightターゲットを追加するには、次の手順を実行します。

  1. 「設定」メニューから、「ターゲットの追加」「ターゲットの手動追加」の順に選択します。

  2. 「ターゲット監視プロパティを指定して非ホスト・ターゲットを追加」を選択します。

  3. 「ターゲット・タイプ」ドロップダウン・メニューで、TrafficLightを選択します。

  4. 「監視エージェント」ドロップダウン・メニューで、目的のエージェントを選択します。

    ターゲットの手動追加
  5. 「手動追加」をクリックして続けます。

  6. 監視するターゲットのプロパティ値を入力します。

    TrafficLightターゲットの追加
  7. 「OK」をクリックして、プロセスを完了します。確認ウィンドウに、新しく追加されたターゲットの情報が表示されます。

19.7.3 スタンドアロンJavaアプリケーションまたはJVMターゲットの構成

スタンドアロンJavaアプリケーションを定義するプラグインをデプロイした場合や、組込みJVMターゲット・タイプを使用する場合は、これらのターゲットのメトリックをEnterprise Manager Grid Controlで収集できるように、JVMまたはJMX対応のJavaアプリケーション・ターゲットの構成を開始できます。

JVMを実行するシステムに、バージョン10.2.0.3以降のEnterprise Managerエージェントをインストールします。これは推奨される手順ですが、JVMおよびスタンドアロンJavaアプリケーションのターゲットに必要な手順ではありません。

JVMターゲット・インスタンスを追加するには、次の手順を実行します。

  1. Enterprise Managerコンソールの「設定」メニュー(右上)から、「ターゲットの追加」「ターゲットの手動追加」の順に選択します。

  2. 「ターゲット監視プロパティを指定して非ホスト・ターゲットを追加」を選択します。

  3. 「ターゲット・タイプ」メニューから「JVM」を選択します。

  4. 「監視エージェント」リストから、必要な管理エージェント(できれば、監視するJVMにローカルの管理エージェント)を選択します。

    画像は、エージェントを選択するためのメニューの選択内容を示しています。
  5. このJVMまたは管理エージェントで監視する必要のあるJavaアプリケーション・インスタンスのインスタンス・プロパティを入力して、「OK」をクリックします。

    画像は、インスタンス・プロパティの追加を示しています。

    表19-1に、インスタンス・プロパティの定義を示します。

    表19-1 JVMインスタンス・プロパティ

    プロパティ 定義

    名前

    このJVMインスタンスのターゲット名。

    MachineName

    このJVMが稼働するホストの名前。

    管理ポート番号

    JSR-160クライアントがJVMへの接続に使用できるポート番号(リモート・オプションを使用する場合のjconsoleなど)。(これは、リモート管理を有効化するためにJVMが起動されたときに-Dcom.sun.management.jmxremote.portプロパティに対して指定されたポート番号です。)

    ユーザー名

    パスワードおよびアクセス・ファイルを使用し、Dcom.sun.management.jmxremote.authenticate=true
    の設定を使用してJVMを起動した場合は必須です。

    JVM Adminユーザー・パスワード

    前述のユーザー名プロパティを参照してください。

    通信プロトコル

    ターゲットJVM上のMBeanServerへの接続を確立します。これは、ターゲットMBeanServerへのJMX接続を確立するのに必要なJMXサービスURLのプロパティに対応します。デフォルト値であるrmiを保持してください。

    サービス名

    ターゲットJVM上のMBeanServerへの接続を確立します。これは、ターゲットMBeanServerへのJMX接続を確立するのに必要なJMXサービスURLのプロパティに対応します。デフォルト値であるjmxrmiを保持してください。

    SSLTrustストア

    SSL Trustストアの場所。ターゲットJVMの起動時に-Dcom.sun.management.jmxremote.ssl=trueの設定を使用してSSLが有効化されている場合に必要です。

    SSLTrustストアのパスワード

    SSL Trustストアのパスにアクセスするためのパスワード。

    カスタムのルックアップ・プロバイダ・クラス

    Enterprise Managerクライアントに統合し、LDAPまたは他のルックアップ・プロトコルを介してMBeanServerのカスタム・ルックアップを実行するのに使用できる、ユーザー実装Javaルックアップ・クラスの完全なパッケージ名。


  6. 追加したJVM(Javaアプリケーション)ターゲットの「すべてのメトリック」ページにナビゲートして、JVM(Javaアプリケーション)からEnterprise Managerに収集されたメトリックを確認します。これらのメトリックは、JDK1.5以上で使用できるプラットフォームMBeanによって公開されるか、Javaアプリケーションのアプリケーション定義のMBeanから公開されます。

    「ターゲット」メニューからJVMターゲットのホームページにナビゲートするには、「すべてのターゲット」を選択してから、JVMターゲット・インスタンスを選択します。

    「すべてのメトリック」ページにナビゲートするには、「ターゲット」メニューから「監視」を選択して、JVMターゲットのホームページのメニューから「すべてのメトリック」を選択します。

    jvm_metrics_collect.gifの説明が続きます
    図「jvm_metrics_collect.gif」の説明

    次の画像は、収集されたメトリックの詳細を示しています。

    coll_metric_details.gifの説明が続きます
    図「coll_metric_details.gif」の説明

    表19-2 Fetchletが使用するプロパティ

    プロパティ デフォルト 説明

    MachineName

    localhost

    MBeanサーバーのホスト・マシンの名前。

    Port

    8888

    MBeanサーバーが接続をリスニングするポート。

    Username

    NULL

    ユーザー名(接続に必要な場合)。

    Password

    NULL

    パスワード(接続に必要な場合)。

    Protocol

    rmi

    接続に使用するプロトコル。

    Service

    jmxrmi

    接続に使用するサービス。

    SSLTrustStore

    NULL

    SSLTrustストアへのパス。

    SSLTrustStorePassword

    NULL

    SSLTrustストアのパスにアクセスするためのパスワード。


19.7.4 Weblogic上のカスタムJ2EEアプリケーションのターゲット・インスタンスの追加

WebLogicにはカスタムJ2EEアプリケーションがあり、JMX MBeanで公開されるカスタム・メトリックをEnterprise Managerに収集する必要があります。カスタム・ターゲット・タイプを定義するプラグインを一度定義してデプロイすると、プラグインのデプロイ対象の様々な管理エージェントでJMX対応のJ2EEアプリケーション・ターゲット・インスタンスの構成を開始できます。これにより、これらのターゲット・インスタンスのメトリックをEnterprise Managerで収集できるようになります。

  1. 「設定」メニューから、「ターゲットの追加」「ターゲットの手動追加」の順に選択します。「ターゲット監視プロパティを指定して非ホスト・ターゲットを追加」オプションを選択します。

  2. 以前に作成されてOMSにデプロイされたカスタム・ターゲット・タイプを選択します。

  3. このターゲット・タイプのインスタンスを作成する監視管理エージェントを選択します(できれば、ターゲットにローカルなEMエージェントにします)。

    JMXターゲット・タイプの選択
  4. 「手動追加」をクリックします。

  5. 次の画像に示すように、必要なターゲット・プロパティを入力して、「OK」をクリックします。新規に追加したターゲットがエージェントの「すべてのターゲット」リストに表示されます。

    JVMターゲットのプロパティ。

    表19-3 ターゲット・プロパティ

    プロパティ 定義

    名前

    このターゲット・インスタンスの一意の名前。

    MachineName

    バージョン9.x以降のOracle WebLogic Application Serverを実行しているシステムのホスト名/IPアドレス。

    ユーザー名

    WebLogicサーバーへのJMX接続の確立に使用されるユーザー名。これは管理者または監視ユーザーのいずれかになります。

    JVM Adminユーザー・パスワード

    前述のユーザーのパスワード。

    通信プロトコル

    t3(デフォルト)またはt3s。

    サービス名

    weblogic.management.mbeanservers.runtime(またはアプリケーションがそのMBeanを登録しているその他のMbeanServer)。

    メトリック・ソース

    WebLogic


    作成されたメトリックは、ターゲット・インスタンスのホームページにナビゲートして、「すべてのメトリック」ページ(「ターゲット」メニューから「監視」「すべてのメトリック」の順に選択)にナビゲートすることで表示できます。

19.8 モニタリング資格証明の設定

一部のターゲット・タイプでは、ターゲット・インスタンスに設定される資格証明を監視する必要があります。デモ・プラグインでは、CalculatorServiceとTrafficLightのどちらも資格証明の監視が必要です。次の手順で、資格証明の設定方法を示します。

  1. 「設定」メニューから、「セキュリティ」「監視資格証明」の順に選択します。

  2. CalculatorServiceを選択して、「監視資格証明の管理」をクリックします。

    画像は、選択されたCalculatorServiceを示しています。
  3. Calculator1を選択して、「資格証明の設定」をクリックします。

    画像は、Calculator1に設定された資格証明を示しています。
  4. 「資格証明のタイプ」からAliasCredentialを選択します。「別名」「パスワード」の値を入力します。

    画像は、監視資格証明のダイアログを示しています。
  5. 「保存」をクリックして終了します。

  6. ターゲットTrafficLight1に対して前述の手順を繰り返します。

19.9 モニター対象メトリックの表示

監視のために管理エージェントにターゲット・インスタンスが追加されたため、ターゲット・タイプに対して定義されたメトリックを表示できます。前回と同様に、サンプル・ターゲットを使用して手順を示します。

  1. 「すべてのターゲット」ページから、以前の手順で追加したターゲットをクリックします。Enterprise Managerにより、ターゲットのホームページが表示されます。

  2. 「ターゲット」メニューから、「監視」「すべてのメトリック」の順に選択します。「すべてのメトリック」ページが監視対象のターゲットに対して表示されます。各メトリックの展開可能なツリー・リストにより、次に示すようにドリルダウンして特定のメトリック・パラメータを表示できます。

calculator1ターゲットのメトリック
trafficlight1のメトリック

19.10 JMXメトリック拡張の作成

Oracle Fusion Middlewareにデプロイされ、JMX属性によってEnterprise Manager 12cに公開されたカスタムJ2EEアプリケーションからメトリックを収集する場合、Enterprise Managerコンソールまたはjmxcliコマンドライン・ツールのいずれかを使用できます。後者は、JMX操作のメトリック拡張の定義をサポートし、メトリック拡張アーカイブ(MEA)の作成をサポートします。メトリック拡張アーカイブは、コンソールからOMSにインポートしてテストを行い、カスタム・アプリケーションを表す目的のJ2EEアプリケーション・ターゲット・インスタンスにデプロイする必要があります。


注意:

Mbeanブラウザではオープン・タイプではない属性を選択できますが、JMXメトリック拡張UIでサポートされるのは、オープン・タイプの属性のみです。UIを使用する場合にオープン・タイプではない属性を選択してメトリックを作成すると、エラーが発生します。

19.10.1 Enterprise Managerコンソールの使用

  1. 「エンタープライズ」メニューから、「監視」「メトリック拡張」の順に選択します。「メトリック拡張」ページが表示されます。

  2. 「作成」をクリックして、メトリック拡張を作成します。

    画像は、開始されたメトリック拡張プロセスの作成プロセスを示しています。
  3. 「アプリケーション・デプロイメント」ターゲット・タイプ(またはこのメトリックを定義する必要がある他の適切なEnterprise Managerターゲット)を選択して、メトリック拡張に意味のある名前を指定します。このアプリケーションと他のカスタム・アプリケーションの両方について、「アプリケーション・デプロイメント」ターゲット・タイプで追加のメトリック拡張の作成を最終的に終了することを念頭に置いてください。可能なかぎり、メトリック拡張名にはメトリック名とアプリケーション名の両方を取得することをお薦めします。

    さらに、アダプタのJMXを選択します。

    「一般プロパティ」セクションの下にある「収集スケジュール」に注意してください。ここでは、このメトリックの収集頻度や、このメトリックがリアルタイム専用であるかどうかを定義します(この場合、「無効」ボタンを選択する必要があります)。

    「アラートおよび履歴の傾向」を選択する場合、「アップロード間隔」を選択することもできます。これは、履歴の傾向にどのサンプル(その頻度が「繰返し間隔」フィールドに指定される)がEnterprise Managerリポジトリにアップロードされるかを示します。たとえば、収集頻度を15分に指定して、「アップロード間隔」を3にした場合、サンプルが3つおきにリポジトリにアップロードされ(45分ごと)、履歴の傾向に利用できます。ただし、しきい値の違反が原因でトリガーされる可能性のある「アラート」は、収集のたびに(15分ごとに)利用できます。

    画像は、メトリック拡張の一般プロパティ・ページを示しています。
  4. 「次へ」をクリックして、JMXベースのメトリックに必要な必須プロパティを指定します。これらは、「基本プロパティ」セクションで定義され、次のようなプロパティになります。

    • メトリック: Mbeanのオブジェクト名またはパターン

    • 列の順序: 前述のMbeanのセミコロン区切りのJMX属性のリスト(JMX操作でメトリックを定義する必要がある場合、次の項に示すようにjmxcliを使用します)。

    前述の定義されたMbeanオブジェクト名またはパターンに、サーバー固有のキー・プロパティは定義できないことに注意してください。これらのプロパティは、ワイルドカード(*)で置き換えることができます。

    たとえば、Mbeanオブジェクト名がcom.bea:Type=foo,Location=Server1,Name=abcの場合、前述の「メトリック」プロパティでcom.bea:Type=foo,*と定義することが適しています。また、Mbeanオブジェクト名がパターンの場合、このメトリックを複数行の表にして複数のMbeanが返されます(各行は、ObjectNameパターンに一致するMbeanのJMX属性を表します)。この場合、各行が結果のメトリックで一意になるように、少なくとも1つ以上の列をキー列として定義する必要があります。

    画像は、アダプタの選択を示しています。

    前述の手順では、「MBeanの参照」ボタンがあり、これら2つのプロパティの構成が容易になります。このボタンでは、MbeanServerを参照でき、メトリック拡張で定義される該当メトリックで表す必要があるMbeanとそのJMX属性を選択します。

    「MBeanの参照」をクリックする場合、次の操作を順に行う必要があります。

    • ターゲットの選択: このメトリックの定義に使用する必要があるターゲット・タイプのインスタンスを選択します。このターゲット・インスタンスは、メトリックの構成に役立ちます。メトリックが最終的に定義されるターゲット・インスタンスである必要はありません。

    • MBeanパターンの入力: ここでは、監視に関連するMbeanのオブジェクト名とパターンを入力します。

    • 「MBeanをリスト」をクリック: 「MBeanと属性の選択」の下の表に表示されます。Mbeanパターンに一致するMbean、またはテキスト「MBeanがリストされていないか、MBeanパターンと一致するMBeanがありません」(一致がない場合)が表示されます。前述の「MBeanパターンの入力」フィールドを繰り返し更新し、「MBeanをリスト」をクリックして、表示されるMbeanのリストを絞り込むことができます。

      画像は、MBean属性の選択を示しています。
    • 関連するMbeanの選択: 選択したMbeanのJMX属性を含む次の表が自動的に表示されます。

      画像は、MBeanの選択と属性を示しています。

      [Crtl]をクリックしながら複数の属性を選択できます。選択内容を受け入れるには、「選択」をクリックします。

      画像は、複数のMBean属性の選択を示しています。
  5. JMXベースのメトリック拡張の定義に必要なパラメータ「メトリック」と「列の順序」を指定する必要があります。

    前述のMBeanの参照ウィザードを使用してメトリック拡張を構成する際に選択または使用されたサーバーの他に複数のサーバーにこのメトリック拡張を適用できる場合、「メトリック」フィールドに表示されるMbean名のキー・プロパティにインスタンス固有の情報を含めないようにしてください(Location=Server1やServerName=fooなど)。これを有効なMbean ObjectNameパターンにするには、これらのインスタンス固有のキー・プロパティをワイルドカード「*」で適宜置き換えることができます。

    画像は、MBeanのアダプタ作成を示しています。

    指定可能なプロパティの説明

    必須プロパティ:

    • metric: 属性を問い合せるMBean ObjectNameまたはObjectNameパターン。これはメトリックのメタデータとして指定されるため、インスタンスにとらわれないようにする必要があります。そのため、MBean ObjectNameのインスタンス固有のキー・プロパティ(servernameなど)がある場合は、そのプロパティをワイルドカードで置き換える必要があります。

    • columnOrder : これは、メトリック内に存在する必要のある順序で並べられたJMX属性のセミコロン区切りリストです。

    拡張プロパティ:

    • identityCol: JMX属性として使用可能でない場合に列として公開する必要のあるMBeanキー・プロパティ。例: com.myCompany:Name=myName,Dept=deptName, prop1=prop1Val, prop2=prop2Val。この例では、identityColをName;Dept(セパレータはセミコロン)として設定すると、columnOrderプロパティで指定したJMX属性を表す列の他にNameとDeptを表す2つの追加キー列が生成されます。

    • autoRowId: メトリック・プロパティで指定されたMBean ObjectNameパターンが複数のMBeanに一致し、columnOrderで指定されたJMX属性のいずれもそれぞれ一意でない場合は、行が自動的に生成されます。この場合に使用される接頭辞です。ここで指定した autoRowId は、作成される追加のキー列の接頭辞として使用されます。たとえば、メトリックがcom.myCompany:Type=CustomerOrder,*と定義される場合、columnOrderはCustomerName;OrderNumber;DateShippedになります(注文が2つに分けて出荷された場合、customerName;OrderNumber;DateShippedは一意ではないと仮定します)。

      autoRowIdを「ShipItem-」に設定すると、各行のメトリックの追加キー列にShipItem-0、ShipItem-1が表示されます。

    • MetricService: True/Falseで、MetricServiceがターゲットのWeblogicドメインで有効になっているかどうかを示します。Oracle DMS MBeanを介して公開されるメトリックを収集する必要がある場合を除き、このプロパティは、ユーザー定義のメトリックに対してほとんどの場合にfalse(選択解除)になります。trueに設定されている場合、前述の基本プロパティ「metric」はMetricService表の名前になり、基本プロパティ「columnOrder」は前述のMetricService表の列名のセミコロン区切りリストになります。

  6. このメトリックの列を指定します(以前に「MBeanの参照」手順を使用している場合、これらの列は自動的にインポートされます)。キー列である列を指定するには、MBeanの参照ウィザードで、これらのあらかじめ作成されている列を編集する必要があります。これは、「メトリック」プロパティの以前の手順でMbeanパターンが指定された場合に行います。このメトリック拡張が適用されるターゲット・インスタンスでは、複数のMbeanがこのMbeanパターンに一致する可能性があります。

    (「上に移動」と「下に移動」ボタンを使用して)列の順序を変更する場合、以前の手順の「列の順序」プロパティのセミコロン区切り列の対応する順序も適宜更新する必要があります(「戻る」を使用)。

    画像は、列の指定示しています。

    次の図に示すように、必要に応じて、これらをキー列にするように列を編集します。

    画像は、キー列の作成を示しています。

    列にラベルを付けて編集したら、「次へ」をクリックします。これで、メトリック拡張をテストする準備ができました。

  7. 「追加」をクリックして、このメトリック拡張をテストするターゲット・インスタンスを選択します。これは、できればメトリック拡張の定義に使用されたものとは別のターゲット・インスタンスにします(以前にメトリック拡張の定義に「MBeanの参照」ボタンを使用した場合)。

    画像には、ターゲットのテストが表示されています。

    「ターゲットのテスト」表でターゲット・インスタンスを選択して、この表の上にある「テストの実行」をクリックします。

    「テストの実行」表にメトリック値が表示されます(エラーがある場合はエラーも表示されます)。

    エラーがある場合は、「戻る」をクリックしてエラーを修正し、テストを再実行します。

    画像には、成功したテストが表示されています。
  8. テストが成功したら、「次へ」をクリックしてメトリック拡張のサマリーを表示し、「終了」をクリックしてメトリック拡張を定義します。

    画像は、メトリック拡張の確認を示しています。
  9. 選択したターゲット・インスタンスにメトリック拡張をデプロイする前に、「デプロイ可能な下書き」にメトリック拡張を保存する必要があります。これにより、メトリック拡張のデザイナは、選択したターゲット・インスタンスにメトリック拡張をデプロイして、メトリック収集を検証できます。ただし、メトリック拡張がテストされてデザイナが満足する結果になるまで他の管理者がこのメトリック拡張をデプロイすることはできません。

    画像は、デプロイ可能な下書きへのメトリック拡張の保存を示しています。
  10. 作成されてデプロイ可能な下書きに保存されたメトリック拡張を選択します。「アクション」メニューから、「ターゲットにデプロイ」を選択します。

    画像は、ターゲットにデプロイする下書きを示しています。
  11. このメトリック拡張をテストする必要があるターゲット・インスタンスを選択して、「発行」をクリックします。たとえば、メトリック拡張が「アプリケーション・デプロイメント」ターゲット・タイプで定義され、カスタムJ2EEアプリケーションで登録されるカスタムMbeanのメトリックを表す場合、そのカスタム・アプリケーションのインスタンスを選択できます。これにより、選択したターゲットを監視する管理エージェントにメトリック拡張を非同期にデプロイするジョブがスケジュールされます。

    画像は、ターゲットのデプロイメントを示しています。
  12. このページを定期的にリフレッシュすることで、選択したターゲットへのメトリック拡張のデプロイが保留になっている操作のステータスを監視し、デプロイメントで発生する可能性のあるエラーについて「ステータス」列と「失敗したデプロイ操作」表を監視します。

    画像は、保留中のデプロイ操作ページを示しています。
  13. 「エンタープライズ」メニューから、「監視」「メトリック拡張」の順に選択します。「メトリック拡張」ホームページには、メトリック拡張が表の行として表示されます。この表の「デプロイされたターゲット」列は、このメトリック拡張がデプロイされるターゲットの数を表します。

    「アクション」メニューで、目的のメトリック拡張の選択後に表から「ターゲット・デプロイメントの管理」を選択します。これにより、このメトリック拡張がデプロイされるターゲット・インスタンスが表示されます。

    画像は、MEページの新しいメトリック拡張を示しています。
  14. メトリック拡張を検証するターゲット・インスタンスの「ターゲット名」列で値をクリックします。ターゲットのホームページに移動します。

    画像は、ターゲット・デプロイメントの管理ページを示しています。
  15. ミドルウェア・ターゲットの場合、「ターゲット・タイプ」→「監視」→「パフォーマンス・サマリー」(または、一般的に「ターゲット・タイプ」→「監視」→「すべてのメトリック」)ページにナビゲートします。

    画像は、ミドルウェア・ターゲットの監視を示しています。
  16. 「パフォーマンス・サマリー」ページでは、新しく作成されたメトリックが「メトリック・パレット」に表示され、このページでそのメトリックを選択してチャート化できます。

    画像は、パフォーマンス・サマリー・ページを示しています。
  17. 1つ以上のターゲット・インスタンスでメトリック拡張のテストが成功すると、「メトリック拡張」ページ(「アクション」メニューで「メトリック拡張の公開」を選択)からメトリック拡張を公開して、残りのターゲット・インスタンスにデプロイできます。

19.10.2 JMXCLIを使用したメトリック拡張アーカイブの作成

Enterprise Managerコンソールを使用しない場合(またはJMX操作から公開されたEnterprise Managerメトリックを公開しない場合)、コマンドライン・ツールJMXCLIを使用して、メトリック拡張アーカイブを作成できます。メトリック拡張アーカイブは、OMSにインポートして、編集、テスト、公開してから、そのアーカイブが定義されるターゲット・タイプの必要なインスタンスにデプロイできます。次に、JMXCLIを使用したメトリック拡張アーカイブの作成について示します。

  1. cd Agent_Instance_Home/bin

  2. setenv USER_JARS $T_WORK/middleware/wlserver_10.3/server/lib/weblogic.jar(使用するMbeanがJMXオープン・タイプを返し、カスタム・クラスを返さない場合は不要)。

  3. emctl jmxcli -t WebLogic -MEXT -l "service:jmx:t3://sta00338:7018/jndi/weblogic.management.mbeanservers.runtime" -u weblogic -c welcome1 -m "*:Type=ThreadPoolRuntime,*" -w /scratch/TEMP/

    オプション:

    -l : WebLogicサーバーに接続するJMX serviceURL。前述のhost:portを、使用するインスタンスに適したものに置き換えます。

    -u : 必要なMBeanへのアクセス権を持つWebLogicユーザー

    -c : WebLogicユーザーのパスワード

    -m : Mbean ObjectNameまたはパターン。

    -w : メトリック拡張アーカイブ(後からOMSコンソールにインポート可能)が作成される一時作業ディレクトリ。

    Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.0.0  
    Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.
    Using Plugin Root /ade/sparmesw_egc802/oracle/emagent/gcagent/plugins/oracle.sysman.emas.agent.plugin_12.1.0.0.0
    Connecting to server: service:jmx:t3://sta00338:7018/jndi/weblogic.management.mbeanservers.runtimeConnecting as user: weblogic
    Obtained 1 MBeans matching pattern *:Type=ThreadPoolRuntime,*. 
    Enter an existing target type for this Metric Extension: [j2ee_application] 
    Enter the name of the Metric Extension: [myMEXT] myAppME_1
    Enter the Metric Extension version: [1.0] 
    Enter the Metric Extension metadata file location: [./metadata/ME#24#myAppME_1.xml] 
    Enter the Metric Extension collection file location: [./collection/ME#24#myAppME_1.xml] 
    Enter a label for this Metric Extension: [myAppME_1] 
    Enter a description for this Metric Extension: [myAppME_1] 
    The available targets are: 
    0: This bean is used to monitor the self-tuning queue  <h3 class="TypeSafeDeprecation">Deprecation of MBeanHome and Type-Safe Interfaces</h3>  
    <p class="TypeSafeDeprecation">This is a type-safe interface for a WebLogic Server MBean,
    which you can import into your client classes and access through <code>weblogic.management.MBeanHome</code>.
    As of 9.0, the <code>MBeanHome</code> interface and all type-safe interfaces for WebLogic Server MBeans are deprecated. 
    Instead, client classes that interact with WebLogic Server MBeans should use standard JMX design patterns in which clients use the
    <code>javax.management.MBeanServerConnection</code> interface to discover MBeans, attributes, and attribute types at runtime. 
    For more  information, see "Developing Manageable Applications with JMX" on <a href="http://www.oracle.com/technology/products/weblogic/index.html" shape="rect">http://www.oracle.com/technology/products/weblogic/index.html</a>.</p> 
            (com.bea:Name=ThreadPoolRuntime,ServerRuntime=EMGC_ADMINSERVER,Type=ThreadPoolRuntime)
    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: CompletedRequestCount         Return Value: java.lang.Long
            1: ExecuteThreadIdleCount        Return Value: java.lang.Integer
            2: ExecuteThreads        Return Value: [Lweblogic.management.runtime.ExecuteThread;
            3: ExecuteThreadTotalCount       Return Value: java.lang.Integer
            4: HealthState   Return Value: weblogic.health.HealthState
            5: HoggingThreadCount    Return Value: java.lang.Integer
            6: MinThreadsConstraintsCompleted        Return Value: java.lang.Long
            7: MinThreadsConstraintsPending  Return Value: java.lang.Integer
            8: Name  Return Value: java.lang.String
            9: Parent        Return Value: javax.management.ObjectName
            10: PendingUserRequestCount      Return Value: java.lang.Integer
            11: QueueLength  Return Value: java.lang.Integer
            12: SharedCapacityForWorkManagers        Return Value: java.lang.Integer
            13: StandbyThreadCount   Return Value: java.lang.Integer
            14: Suspended    Return Value: java.lang.Boolean
            15: Throughput   Return Value: java.lang.Double
            16: Type         Return Value: java.lang.String
    Select one or more items as comma separated indices: 5,13
    Number of possible columns in the resultant metric are 2.
    Enter the name for this metric column at index=0 : [HoggingThreadCount] 
    Is this column a KEY Column <y/n>? [n] 
    Is this column for SUMMARY_UI <y/n>? [n] 
    Enter the label for column: [HoggingThreadCount] 
    Enter the NLSID for column: [HoggingThreadCount] 
    Enter the UNIT for column "HoggingThreadCount": [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 : [StandbyThreadCount] 
    Is this column a KEY Column <y/n>? [n] 
    Is this column for SUMMARY_UI <y/n>? [n] 
    Enter the label for column: [StandbyThreadCount] 
    Enter the NLSID for column: [StandbyThreadCount] 
    Enter the UNIT for column "StandbyThreadCount": [millisec, kb etc.. ] 
    Do you want to create a threshold for this column <y/n>? [n] 
    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.
    Written the metadata xml file: ./metadata/ME#24#myAppME_1.xml.
    Creating new file: ./collection/ME#24#myAppME_1.xml.
    Updated the default collection file for j2ee_application at location ./collection/ME#24#myA
    ppME_1.xml.
    createMextArchive: Adding metadata
    createMextArchive: Adding collection file
    createMextArchive: Adding mea.xml file
    
    Creating Metric Extension zip archive: ./MEA_ME$myAppME_1.zip
    Please import this into Enterprise Manager Cloud Control using the console.
    Exiting...
    

    前述のセッションでは、jmxcliを起動すると、-wオプションで指定されたディレクトリ(または-wオプションを指定しない場合は現在のディレクトリ)にZipファイルMEA_ME$myAppME_1.zipが作成されます。

    次に示すように、これをEnterprise Managerコンソールにインポートします。「エンタープライズ」メニューから、「監視」「メトリック拡張」を選択して「メトリック拡張」ホームページにアクセスします。

    画像は、Enterprise Managerのメトリック拡張を示しています。

    前述の例のようにメトリック拡張アーカイブをインポートすると、そのアーカイブを編集(および修正)、テスト、公開およびデプロイできます。

19.11 スタンドアロンのJVMまたはOracle Coherenceのメトリックの公開

ユーザーは、前の項で概要を示したメカニズムを使用して、Oracle CoherenceやJVMターゲットで設定なしではすぐに使用できない追加メトリック、およびJMX Mbean属性から使用可能なデータを作成することもできます。

19.11.1 Enterprise Managerコンソールの使用

手順は、j2eeアプリケーション・ターゲット・タイプでメトリックを拡張する場合に前項で行われた手順と似ています。ただし、JVMまたはOracle Coherenceターゲット・タイプでメトリック拡張を定義する場合に手順3でターゲット・タイプ「JVM」または「Oracle Coherence xxx」を選択する必要があります。

19.11.2 JMXCLIの使用

手順は、JMXCLIを使用してカスタムJ2EEアプリケーションのメトリック拡張アーカイブを定義する場合と似ています。ただし、jmxcliを起動する場合の起動引数は次のようになります。

emctl jmxcli -t JVM -MEXT  -h adc2180736 -p 6789 -m "*:*"  -w /scratch/TEMP/

メトリック拡張が、(デフォルトのj2ee_applicationではなく)JVMまたはoracle_coherenceになるように定義されるターゲット・タイプを適宜指定する必要があります。