18 WebサービスおよびJMXを使用した監視
Enterprise Managerを拡張して、クリティカル・イベント、パフォーマンスの問題、エラー状態および統計について、WebサービスおよびJMXインスツルメント処理されたアプリケーションを監視できます。
WSDLおよびJMX対応のターゲットを監視するEnterprise Managerの機能により、監視操作と管理操作を統合できます。Enterprise Managerフレームワークに追加された場合、通知、ジョブ、レポート作成などのEnterprise Manager機能がこれらのターゲットに自動的に拡張されます。
この章のトピックは、次のとおりです:
概要
Enterprise Managerを使用して、Webサービス管理インタフェース、JMXインスツルメント処理されたアプリケーションおよびサーバーを公開するターゲット、そしてスタンドアロンJava仮想マシン(JVM)ターゲットを監視すると、メタデータ・プラグインを介して新しいターゲット・タイプを定義することになります。
メタデータ・プラグインの作成は、4つの基本ステップから構成されます。
ターゲット監視の手順は、次の各項で説明しています。
-
「Enterprise ManagerでのWebサービスを使用した監視」では、標準メッセージング・プロトコルを使用してネットワーク上で通信する外部インタフェースを公開するソフトウェア・コンポーネントについて説明します。
-
「JMXインスツルメント処理されたスタンドアロンのJavaアプリケーションまたはJVMターゲットの監視」では、JMX MBeanを使用してインスツルメント処理された、J2SE5.0以上で稼働するスタンドアロンJavaアプリケーションについて説明します。
-
「Oracle Weblogic Application ServerにデプロイされたJMXアプリケーションの監視」では、Oracle WebLogic Application Server 9.x以上で稼働するJMXアプリケーションについて説明します。
「JMXインスツルメント処理されたスタンドアロンのJavaアプリケーションまたはJVMターゲットの監視」では、JMX対応カスタム・アプリケーションのメタデータ・ファイルとデフォルトの収集ファイルの生成方法について説明します。データの収集に関連するMBeanを紹介したり、Enterprise ManagerでMBeanをメトリックとして定義する場合に役立つ情報を提供します。スタンドアロンのJavaアプリケーションがJMXを介してインスツルメント処理されていない場合でも、「スタンドアロンJavaアプリケーションまたはJVMターゲットの構成」で定義するように組込みJVMターゲット・インスタンスを直接作成することにより、そのアプリケーションが稼働しているJVMを監視できます。
メタデータ・ファイルおよびデフォルトの収集ファイルを作成したら、通常のメタデータ・プラグイン・メカニズムに従ってプラグインをデプロイし、Javaアプリケーション・ターゲット・タイプのターゲット・インスタンスを作成できます。
Enterprise ManagerでのWebサービスを使用した監視
Webサービスは、疎結合されたソフトウェア・コンポーネントであり、Webサービス定義言語(WSDL)を介して外部インタフェースを公開します。これらのコンポーネントは、Simple Object Access Protocol(SOAP)と呼ばれる標準メッセージング・プロトコルを使用してネットワーク上で通信します。管理エージェントのWebサービスFetchlet(ID WSFを含む)によってSOAP通信がサポートされます。
前提条件
-
そのホストに管理エージェント・バージョン12.1.0.0.0以降がインストールされていること。
-
Oracle Management Server(OMS)バージョン12.1.0.0.0以降が管理エージェントと通信していること。
メタデータ・ファイルおよびデフォルトの収集ファイルの作成
Webサービス・インタフェースを介して監視するターゲット・タイプを定義すると、WSDLインタフェースをサポートするリソースからメトリックを収集するのに必要なターゲット定義ファイルを作成することになります。
-
ターゲット・メタデータ
-
デフォルト収集
Enterprise Managerでは、使いやすいWebサービス・コマンドライン・ツールが提供されており、これらの必要なファイルを自動的に生成することにより、プラグインの作成が容易になります。情報は、管理エージェントに統合されたWebサービスfetchletで取得されます。
コマンドライン・ツールは、すべての操作について指定されたWSDLファイルを解析することで動作し、起動する1つ以上の操作を選択できるようにします。WSDLファイルに複数のポート・タイプが指定されている場合、ツールにはいずれか1つのポート・タイプの選択を求めるプロンプトが表示されます。操作は、パラメータとともにリストされます。Webサービスの操作は、次の4つのタイプのいずれかです。
-
一方向
-
リクエスト・レスポンス
-
請求レスポンス
-
通知
リクエスト・レスポンス操作タイプは、特に役立ちます。選択された操作には、プリミティブまたは複雑なパラメータや結果が含まれます。Webサービスの呼出し結果が表に表示されます(ツールにより、表の列のラベルの入力を求めるプロンプトが表示されます)。XPath式を指定することで、結果の属性をフィルタ処理することもできます(「CalculatorServiceのターゲット・メタデータ・ファイル」の例の、生成されたターゲット・メタデータのRowTypeプロパティを参照)。フィルタ属性は、関連する属性がわずかしかない場合の複雑な戻り型に役立ちます。
Webサービス・コマンドライン・ツールでは、次のバインディングおよびエンコーディング・スタイルのWebサービスがサポートされます。
-
DOC/リテラル
-
DOC/ラップ
-
RPC/エンコーディング
WebサービスCLIコマンドライン・ツールの構文
-
-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に複数のポート・タイプがある場合は、最初にポート・タイプを選択するプロンプトが表示されます。
Webサービス・コマンドライン・ツールのセキュリティ
コマンドライン・ツールでは、Enterprise Managerで必要なメタデータがターゲット監視の目的でWSDLファイルから生成されます。このツールを実行する場合、WSDLファイルまたはURLに対する読取り権限および生成されるファイルを適切なディレクトリに保存する権限のみが必要です。
ファイルの生成
次の例に、ターゲットのメタデータ・ファイルおよび収集ファイルを生成するためにコマンドライン・ツールに渡されるサンプルWSDLファイルを示します。
例: サンプル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>
次の例では、前述の例で示したWSDLファイルを使用します。最初にツールは、すべてのポート・タイプおよびバインディング(HTTP get/post、SOAPなどのサポートされているプロトコル)に対してWSDLを解析して、すべての操作をリストします。WSDLに複数のポート・タイプがある場合は、最初にポート・タイプを選択するプロンプトが表示されます。
コマンドライン・ツールを開始するには、次のようにします。
起動後に、コマンドライン・ツールは、次の例に示すように必要な情報を求めるプロンプトを自動的に表示します。コマンドライン・ツール・セッションを終了する必要がある場合は、任意の時点で[Ctrl]+[C]を押して終了できます。セッション情報は保存されません。
例: サンプル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
コマンドライン・ツールは、次の例に示すように、CalculatorServiceターゲット・タイプの監視に必要なメタデータを生成します。
例: 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>
コマンドライン・ツールは、次の例に示すように、必要な収集ファイルも生成します。
例: CalculatorServiceのデフォルトの収集ファイル
<!DOCTYPE TargetCollection SYSTEM "../dtds/TargetCollection.dtd">
<TargetCollection TYPE="CalculatorService">
<CollectionItem NAME="square">
<Schedule>
<IntervalSchedule TIME_UNIT="Min" INTERVAL="30"/>
</Schedule>
</CollectionItem>
</TargetCollection>
ツールによってターゲット・メタデータ・ファイルおよび収集ファイルが生成されたら、Oracleプラグイン・アーカイブを作成できます。詳細は、「プラグイン・アーカイブの作成」を参照してください。
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以上が管理エージェントと通信していること。
メタデータ・ファイルおよびデフォルトの収集ファイルの作成
Enterprise Managerでは、使いやすいWS-Management CLIコマンドライン・ツールが提供されており、必要なターゲットのメタデータ・ファイルやデフォルトの収集ファイルを自動的に生成することにより、新しい管理プラグインの作成が容易になります。情報は、管理エージェントに統合されたWSManagementFetchletで取得されます。
WS-Managementインタフェースをサポートするリソースでは、XML Schema Definition(XSD)表現を使用してそのモデルに固有の要素を記述し、WSDLのように、Webサービスにアクセス可能な公共のリンクとしてXSDを公開する必要があります。
コマンドライン・ツールは、管理対象のWS-MANリソースの指定のXSDファイルを解析することで機能し、関連のリソース・プロパティを選択して監視メトリックを構築するプロンプトを表示します。
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に設定されます(この環境変数は、ツールを使用する前に適切に設定しておきます)。
コマンドライン・ツールのセキュリティ
コマンドライン・ツールでは、Enterprise Managerで必要なメタデータがターゲット監視の目的でリソースXSDから生成されます。このツールを実行する場合、XSDファイルまたはURLに対する読取り権限および生成されるファイルを適切なディレクトリに保存する権限のみが必要です。
ターゲットのメタデータ・ファイルおよび収集ファイルの生成
次の例に、ターゲットのメタデータ・ファイルおよび収集ファイルを生成するためにコマンドライン・ツールに渡されるサンプルXSDファイルを示します。
例: サンプル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>
コマンドライン・ツールを開始するには、次のようにします。
起動後に、コマンドライン・ツールは、次の例に示すように必要な情報を求めるプロンプトを自動的に表示します。コマンドライン・ツール・セッションを終了する必要がある場合は、任意の時点で[Ctrl]+[C]を押して終了できます。セッション情報は保存されません。
例: サンプル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
コマンドライン・ツールは、次の例に示すように、ターゲット・タイプTrafficLightの監視に必要なメタデータを生成します。
例: 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: [<OptionName1>, value:<value1>, type:<type1>, mustComply:<true|false>][<OptionName2>, value:<value2>, type:<type>, mustComply:<true|false>][...]</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>
コマンドライン・ツールは、次の例に示すように、必要な収集ファイルも生成します。
例: TrafficLightのデフォルトの収集ファイル
<!DOCTYPE TargetCollection SYSTEM "../dtds/TargetCollection.dtd">
<TargetCollection TYPE="TrafficLight">
<CollectionItem NAME="trafficLight">
<Schedule>
<IntervalSchedule TIME_UNIT="Min" INTERVAL="30"/>
</Schedule>
</CollectionItem>
</TargetCollection>
コマンドライン・ツールによってターゲットのメタデータ・ファイルおよび収集ファイルが生成されたら、メタデータ・プラグイン・アーカイブを作成できます。「プラグイン・アーカイブの作成」を参照してください。
JMXインスツルメント処理されたスタンドアロンのJavaアプリケーションまたはJVMターゲットの監視
ノート:
JMXインスツルメント処理されていないJavaアプリケーションが稼働するJ2SE 1.5以上のJVMを監視する場合は、直接「スタンドアロン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自体を監視できます。詳細は、「スタンドアロンJavaアプリケーションまたはJVMターゲットの構成」を参照してください。
-
有効なリモート・システムからの監視および管理。JVMの起動時に、このシステム・プロパティを設定してください。
com.sun.management.jmxremote.port=portNumリモート管理用にJVMを有効化する処理の詳細は、次のドキュメントを参照してください。
http://docs.oracle.com/javase/7/docs/technotes/guides/management/agent.html -
そのホストに管理エージェント・バージョン10.2.0.3以降がインストールされていること。
-
Oracle Management Server(OMS)バージョン10.2.0.3以上が管理エージェントと通信していること。
既知の制限事項
現在、jmxcliツールでは、ターゲットJVMインスタンス上のデフォルトのプラットフォームMBeanserverで使用可能な(プラットフォームおよびアプリケーションで定義された)MBeanの参照および監視のみ行うことができます。ターゲットJVMインスタンス上のカスタムMBeanServerの監視はサポートされていません。jmxcliツールは基本的に、属性と、OpenType(SimpleType、CompositeType、TabularTypeおよびSimpleTypeの配列など)である操作のパラメータおよび戻り値を処理します。
メタデータ・ファイルおよびデフォルトの収集ファイルの生成
Webサービスの場合と同様に、コマンドライン・ツール(jmxcli)では、JMXインスツルメント処理されたスタンドアロンのJavaアプリケーションの必要なターゲット定義ファイル(メタデータ・ファイルとデフォルトの収集ファイル)の作成が容易になります。ツールは、J2SE1.5以上のJVMのMBeanServerとユーザーをつなぐオフライン構成ユーティリティであり、使用可能なMBeanを参照できます。また、以降のツールの呼出しで既存のファイル・セットにメトリックを追加することもできます。
コマンドライン・ツール・セッション中に、特定のMBeanを選択し、続いてEnterprise Managerがこれらの値を収集するためにこれらのMBeanに対して定期的に取得または起動する必要のある目的の属性/統計値または操作を選択します。ツールは、1つ以上のEnterprise Managerメトリック(列あり)としてのこれらの収集された値のパッケージ化の定義を支援し、またメトリック収集間隔を指定できるようにします。
JMXコマンドライン・ツールの構文
cdAgent Instance dir/bin emctl jmxcli -t JVM [ -lJMXServiceURL-hhostname-pport-uusername-ccredential/password-wwork directory-etrue/false[-mMBeanName| -djmx_domain| -smBeanPattern] ]
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セッション時に選択された、操作の戻りオブジェクトの属性またはフィールドになる列があります。
ファイルの生成
次のステップは、JMXコマンドライン・ツールでファイルを生成するための準備およびツールの使用方法を説明しています。
起動後に、コマンドライン・インタフェースは、「JMXCLIセッションのサンプル」の例に示すように必要な情報を求めるプロンプトを自動的に表示します。ほとんどのプロンプトでは、デフォルトを使用するために[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:*"
例: 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...
メタデータ・ファイルおよびデフォルトの収集ファイルの使用方法
currentDir/metadataディレクトリおよびcurrentDir/default_collectionディレクトリで(先に指定したターゲット・タイプの) myTarget.xmlファイルを探します。
これらのファイルは、次のように使用できます。
-
ファイルをOracle プラグイン・アーカイブ(OPAR)に変換して、OMSからエージェントおよびOMSから作成されたターゲット・インスタンスへプッシュします。「プラグインの検証、パッケージ化およびデプロイ」および「スタンドアロンJavaアプリケーションまたはJVMターゲットの構成」を参照してください。
-
ファイルを編集し、メトリック定義および
QueryDescriptorsを抽出して他のメタデータ・ファイルおよびデフォルトの収集ファイルへ移し、必要に応じてExecutionDescriptorsを作成して後処理を行います。
ターゲットのステータス情報をEnterprise Managerコンソールに正しく表示するには、レスポンス・メトリックを定義する必要があります。詳細は、「ターゲット・ステータス情報の表示」を参照してください。
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の配列などです。
jmxcliを使用したメタデータ・ファイルおよびデフォルトの収集ファイルの作成
Webサービスの場合と同様に、JMXコマンドライン・ツール(jmxcli)では、必要なターゲット定義ファイル(メタデータとデフォルトの収集ファイル)の作成が容易になります。ツールは、MBeanServerとユーザーをつなぐオフライン構成ユーティリティであり、使用可能なMBeanを参照できます。ツールの以降の呼出しで既存のファイルにメトリックを追加することもできます。コマンドライン・ツールのセッション中に、特定のMBeanを選択し、続いてEnterprise Managerで取得する必要がある目的のJMX属性/統計値、またはこれらの値を収集するために選択したMBeanに対して定期的に起動する必要のあるJMX操作を選択します。ツールは、1つ以上のEnterprise Managerメトリック(列あり)としてのこれらの収集された値のパッケージ化の定義を支援し、また列のメトリック収集間隔やしきい値を指定できるようにします。
JMXコマンドライン・ツールの構文
Oracle Weblogic Application Server上にあるJMX対応ターゲットのJMXコマンドライン・ツールの構文は次のとおりです。
./emctl jmxcli -t WebLogic [help|options] where options are: [ -lJMX ServiceURL-uusername-ccredential/password-wwork directory[-mMBeanName| -djmx_domain| -smBeanPattern] ]
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セッション時に選択された、操作の戻りオブジェクトの属性またはフィールドになる列があります。
ファイルの生成
JMXコマンドライン・ツールを開始するには、次のようにします。
起動後に、コマンドライン・インタフェースは、次の例に示すように必要な情報を求めるプロンプトを自動的に表示します。JMXコマンドライン・ツール・セッションを終了する必要がある場合は、任意の時点で[Ctrl]+[C]を押して終了できます。セッション情報は保存されません。
次の例は、jmxcliセッションのサンプルです。
例: jmxcliセッション
$ ./emctl jmxcli -t WebLogic -l "service:jmx:t3://host:22048/jndi/weblogic.management.mbeanservers.runtime" -u weblogic -c password -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://host1: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...
例: jmxcli起動のサンプル(-mを使用し、複数のMBeanの複数のメトリックを1つのjmxcliセッションで定義)
$ ./emctl jmxcli -t WebLogic -l "service:jmx:t3://host1:22048/jndi/weblogic.management.mbeanservers.runtime" -u weblogic -c password -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://host1: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)を作成できます。
ターゲット・ステータス情報の表示
ターゲットのステータス情報がEnterprise Managerコンソールに正しく表示されるためには、クリティカルしきい値が設定された「ステータス」という名前の列を持つ 「レスポンス」というメトリックを定義する必要があります。メトリック値がクリティカルしきい値を下回っている場合、このタイプのターゲット・インスタンスのステータスはコンソールに「稼働中」(使用可能)として表示されます。しきい値を超えている場合、ターゲット・ステータスはコンソールに「停止中」として表示されます。
「レスポンス」メトリックは別のjmxcliセッションで作成できます(以前のセッションで作成されたメタデータ・ファイルおよび収集ファイルにメトリックを追加します)。
例: レスポンス・メトリックの追加
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://host1:22048/jndi/weblogic.management.mbeanservers.runtime" -u weblogic -c password -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://host1: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"にしてください。
この場合は、Enterprise Managerターゲットがアプリケーションであるため、コンテナが停止している場合、つまりJMX接続を確立できない場合でも、ターゲットを停止中としてマークする必要があります。これ(サーバーも停止中である場合にアプリケーションを停止中として示す)を行うには、次のQueryDescriptorプロパティを、メタデータ・ファイルに生成されるレスポンス・メトリックに追加します。
<Property NAME="valueWhenDown" SCOPE="GLOBAL">0</Property>
ここで、0は、サーバーとのJMX接続を確立できない(サーバー自体が停止している)場合に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...
メタデータ・ファイルおよびデフォルトの収集ファイルの使用方法
currentDir/metadataディレクトリおよびcurrentDir/default_collectionディレクトリで(先に指定したターゲット・タイプの) myTarget.xmlファイルを探します。
これらのファイルは、次のように使用できます。
-
Oracleプラグイン・アーカイブ(OPAR)をアップロードするには、次のようにします。「プラグイン・アーカイブの作成」を参照してください。
-
OPARをOMSに移動します。Enterprise Managerへのプラグイン・アーカイブのインポートおよびデプロイに関する説明を参照してください。
-
OPARをエージェントにプッシュします。Enterprise Managerへのプラグイン・アーカイブのインポートおよびデプロイに関する説明を参照してください。
-
カスタム・ターゲット・インスタンスを作成します。詳細は、「Weblogic上のカスタムJ2EEアプリケーションのターゲット・インスタンスの追加」を参照してください。
ターゲットのステータス情報をEnterprise Managerコンソールに正しく表示するには、レスポンス・メトリックを定義する必要があります。詳細は、「ターゲット・ステータス情報の表示」を参照してください。
管理エージェントへのターゲットの追加
プラグインがOMSにデプロイされると、メタデータ・プラグインで定義されたターゲットを別の監視管理エージェントに追加する準備ができます。
説明のために、次のステップでは、サンプルのCalculatorServiceおよびTrafficLightをターゲットとして追加する方法を示します。
スタンドアロンJavaアプリケーションまたはJVMターゲットの構成
スタンドアロンJavaアプリケーションを定義するプラグインをデプロイした場合や、組込みJVMターゲット・タイプを使用する場合は、これらのターゲットのメトリックをEnterprise Manager Grid Controlで収集できるように、JVMまたはJMX対応のJavaアプリケーション・ターゲットの構成を開始できます。
JVMを実行するシステムに、バージョン10.2.0.3以降のEnterprise Managerエージェントをインストールします。これは推奨される手順ですが、JVMおよびスタンドアロンJavaアプリケーションのターゲットに必要な手順ではありません。監視エージェントがターゲットJVMに対してローカルである必要はありません。
JVMターゲット・インスタンスを追加するには、次のステップを実行します。
資格証明設定の監視
一部のターゲット・タイプでは、ターゲット・インスタンスに設定される資格証明を監視する必要があります。デモ・プラグインでは、CalculatorServiceとTrafficLightのどちらも資格証明の監視が必要です。次のステップで、資格証明の設定方法を示します。
監視対象メトリックの表示
監視のために管理エージェントにターゲット・インスタンスが追加されたため、ターゲット・タイプに対して定義されたメトリックを表示できます。前回と同様に、サンプル・ターゲットを使用して手順を示します。
- 「すべてのターゲット」ページから、以前のステップで追加したターゲットをクリックします。Enterprise Managerにより、ターゲットのホームページが表示されます。
- 「ターゲット」メニューから、「監視」、「すべてのメトリック」の順に選択します。「すべてのメトリック」ページが監視対象のターゲットに対して表示されます。各メトリックの展開可能なツリー・リストにより、次に示すようにドリルダウンして特定のメトリック・パラメータを表示できます。


JMXメトリック拡張の作成
Oracle Fusion Middlewareにデプロイされ、JMX属性によってEnterprise Managerに公開されたカスタムJ2EEアプリケーションからメトリックを収集する場合、Enterprise Managerコンソールまたはjmxcliコマンドライン・ツールのいずれかを使用できます。後者は、JMX操作のメトリック拡張の定義をサポートし、メトリック拡張アーカイブ(MEA)の作成をサポートします。メトリック拡張アーカイブは、コンソールからOMSにインポートしてテストを行い、カスタム・アプリケーションを表す目的のJ2EEアプリケーション・ターゲット・インスタンスにデプロイする必要があります。
ノート:
Mbeanブラウザではオープン・タイプではない属性を選択できますが、JMXメトリック拡張UIでサポートされるのは、オープン・タイプの属性のみです。UIを使用する場合にオープン・タイプではない属性を選択してメトリックを作成すると、エラーが発生します。
スタンドアロンのJVMまたはOracle Coherenceのメトリックの公開
ユーザーは、前の項で概要を示したメカニズムを使用して、Oracle CoherenceやJVMターゲットで設定なしではすぐに使用できない追加メトリック、およびJMX Mbean属性から使用可能なデータを作成することもできます。
Enterprise Managerコンソールの使用
手順は、j2eeアプリケーション・ターゲット・タイプでメトリックを拡張する場合に前項で行われた手順と似ています。ただし、JVMまたはOracle Coherenceターゲット・タイプでメトリック拡張を定義する場合にステップ3でターゲット・タイプ「JVM」または「Oracle Coherence xxx」を選択する必要があります。
RESTfulサービスの使用の監視
REST準拠のWebリソースの監視は、REST fetchletを使用して実行します。REST fetchletの詳細は、「REST fetchlet」を参照してください。


































