ヘッダーをスキップ
Oracle® Fusion Middleware Oracle WebLogic Server診断フレームワークの構成と使用
12c (12.1.2)
E48027-02
  ドキュメント・ライブラリへ移動
ライブラリ
製品リストへ移動
製品
目次へ移動
目次

前
 
次
 

9 監視および通知の構成

この章では、サーバーとアプリケーションの状態をモニターし、監視で設定した条件に基づく通知を送信できるWebLogic診断フレームワーク(WLDF)の監視および通知コンポーネントについて説明します。監視および通知は、ドメイン内の1つ以上のサーバー・インスタンスをターゲットとする診断モジュールの一部として構成されます。

この章には次の項が含まれます:

監視および通知

監視は、モニターまたは診断目的で捕捉する状況を識別します。監視は、ログ・レコード、データ・イベント、および収集されたメトリックを分析するよう構成できます。監視は、監視ルールとして指定されます。

通知は、監視ルール式の評価がtrueとなった場合のアクションです。WLDFでは、以下の種類の通知をサポートしています。

監視は、実行中のサーバーの指定した状態またはアクティビティについて管理者に通知する場合など、役に立つ診断アクティビティの通知に関連付ける必要があります。

監視および通知は、それぞれ別に構成されます。通知は複数の監視に関連付けることができ、監視は複数の通知に関連付けることができます。そのため、現在のニーズに応じて、監視および通知を柔軟に再結合し、再利用することができます。

監視および通知の構成の概要

完全な監視および通知の構成には、1つまたは複数の監視、1つまたは複数の通知、通知媒体で必要な基底の構成(たとえば、SNMPベースの通知の場合はSNMP構成)の設定が含まれます。

WLDFシステム・リソース記述子ファイルDIAG_MODULE.xmlの、監視および通知の構成に必要な主な要素を例9-1に示します。例で示すように、監視および通知を定義するための基本要素は<watch-notification>です。監視は<watch>要素で定義され、通知は、種類ごとに指定されている要素<jms-notification>、<jmx-notification>、<smtp-notification>、<image-notification>などで定義されます。

例9-1 監視および通知の構成のスケルトン(DIAG_MODULE.xml内)

<wldf-resource>
<!-- ----- Other system resource configuration elements ----- -->
  <watch-notification>
  <log-watch-severity>
     <!-- Threshold severity for a log watch to be evaluated further 
           (This can be narrowed further at the watch level.) -->
  </log-watch-severity>
    <!-- ----- Watch configuration elements: ----- -->
    <watch>
      <!-- A watch rule -->
    </watch>
    <watch>
      <!-- A watch rule -->
    </watch>
    <!-- Any other watch configurations -->

    <!-- ----- Notification configuration elements: ----- -->
    <!-- The following notification configuration elements show one of each 
         type of supported notifications. However, not all types are 
         required in any one system resource configuration, and multiples 
         of any type are permitted. -->
    <jms-notification>
      <!-- Configuration for a JMS-based notification; requires a
           corresponding JMS configuration via a jms-server element and a
           jms-system-resource element -->
    </jms-notification>

    <jmx-notification>
      <!-- Configuration for a JMX-based notification -->
    </jmx-notification>
    <smtp-notification>
      <!-- Configuration for an SMTP-based notification; requires a
           corresponding SMTP configuration via a mail-session element -->
    </smtp-notification>
    <snmp-notification>
      <!-- Configuration for an SNMP-based notification; requires a 
           corresponding SNMP agent configuration via an snmp-agent
           element -->
    </snmp-notification>
    <image-notification>
      <!-- Configuration for an image-based notification -->
    </image-notification>
  <watch-notification>
<!-- ----- Other configuration elements ----- -->
</wldf-resource>

注意:

通知媒体は、その通知媒体に応じた通知で使用できるように構成する必要がありますが、その構成は、診断モジュール自体の構成の一部ではありません。つまり、通知媒体は、診断モジュールの構成ファイルの<wldf-resource>要素で構成されるものではありません。


監視および/または通知に対して個別に<enabled>true</enabled>または<enabled>false</enabled>を設定することにより、個々の監視および通知を個別に有効化および無効化できます。また、すべての監視および通知に対して<enabled>true</enabled>または<enabled>false</enabled>を設定すると、監視および通知の機能全体を有効化および無効化できます。デフォルト値は<enabled>true</enabled>です。

<watch-notification>要素には、<log-watch-severity>下位要素があります。この下位要素は、ログ・ルールの監視によってトリガーされる通知の起動に影響します。

監視をトリガーしたログ・メッセージの最大の重大度レベルが、指定されている重大度レベルと同じレベル以上でなければ、その監視でトリガーされる通知は起動しません。ただし、これはログ・ルール・タイプの監視によって起動される通知にのみ適用されます。この要素を、監視に対して定義する<severity>要素と混同しないでください。<severity>要素は、監視自体に重大度を割り当てるものですが、<log-watch-severity>要素は、ログ・ルールの監視によってどの通知が起動されるかを指定します。

管理コンソールを使用した監視および通知を構成する方法の詳細は、Oracle WebLogic Server管理コンソール・オンライン・ヘルプ監視および通知の構成に関する項を参照してください。

監視および通知の構成のサンプル

診断モジュールの監視および通知の構成のセットに関する完全な構成を例9-2に示します。この例については、次のトピックで詳しく説明します。

例9-2 監視および通知の構成のサンプル(DIAG_MODULE.xml内)

<?xml version='1.0' encoding='UTF-8'?> 
<wldf-resource xmlns="http://xmlns.oracle.com/weblogic/weblogic-diagnostics" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-diagnostics/1.0/weblogic-diagnostics.xsd"> 
  <name>mywldf1</name> 
  <!-- Instrumentation must be configured and enabled for instrumentation 
       watches -->
  <instrumentation> 
    <enabled>true</enabled> 
    <wldf-instrumentation-monitor> 
      <name>DyeInjection</name> 
      <description>Dye Injection monitor</description> 
      <dye-mask xsi:nil="true"></dye-mask>       <properties>ADDR1=127.0.0.1</properties> 
    </wldf-instrumentation-monitor> 
  </instrumentation> 
  <!-- Harvesting does not have to be configured and enabled for harvester
       watches. However, configuring the Harvester can provide advantages;
       for example the data will be archived. -->
  <harvester> 
    <name>mywldf1</name> 
    <sample-period>20000</sample-period> 
    <harvested-type> 
      <name>weblogic.management.runtime.ServerRuntimeMBean</name> 
    </harvested-type> 
    <harvested-type> 
      <name>weblogic.management.runtime.WLDFHarvesterRuntimeMBean</name> 
    </harvested-type> 
  </harvester> 
  <!-- All watches and notifications are defined under the 
       watch-notification element -->
  <watch-notification> 
    <enabled>true</enabled> 
    <log-watch-severity>Info</log-watch-severity>
    <!-- A harvester watch configuration --> 
    <watch> 
      <name>myWatch</name> 
      <enabled>true</enabled> 
      <rule-type>Harvester</rule-type>
      <rule-expression>${com.bea:Name=myserver,Type=ServerRuntime//SocketsOpenedTotalCount} &gt;= 1</rule-expression>
      <alarm-type>AutomaticReset</alarm-type> 
      <alarm-reset-period>60000</alarm-reset-period> 
      <notification>myMailNotif,myJMXNotif,mySNMPNotif</notification> 
    </watch> 
    <!-- An instrumentation watch configuration --> 
    <watch> 
      <name>myWatch2</name> 
      <enabled>true</enabled> 
      <rule-type>EventData</rule-type> 
      <rule-expression>
      (MONITOR LIKE 'JDBC_After_Execute') AND
      (DOMAIN = 'MedRecDomain') AND
      (SERVER = 'medrec-adminServer') AND
      ((TYPE = 'ThreadDumpAction') OR (TYPE = TraceElapsedTimeAction')) AND
      (SCOPE = 'MedRecEAR')
      </rule-expression>
      <notification>JMXNotifInstr</notification> 
    </watch> 
    <!-- A log watch configuration -->
    <watch> 
      <name>myLogWatch</name> 
      <rule-type>Log</rule-type> 
      <rule-expression>MSGID='BEA-000360'</rule-expression> 
      <severity>Info</severity> 
      <notification>myMailNotif2</notification> 
    </watch>
    <!-- A JMX notification -->
    <jmx-notification> 
      <name>myJMXNotif</name> 
    </jmx-notification> 
    <!-- Two SMTP notifications -->
    <smtp-notification> 
      <name>myMailNotif</name> 
      <enabled>true</enabled> 
      <mail-session-jndi-name>myMailSession</mail-session-jndi-name> 
      <subject>This is a harvester alert</subject> 
      <recipient>username@emailservice.com</recipient> 
    </smtp-notification> 
    <smtp-notification> 
      <name>myMailNotif2</name> 
      <enabled>true</enabled> 
      <mail-session-jndi-name>myMailSession</mail-session-jndi-name> 
      <subject>This is a log alert</subject> 
      <recipient>username@emailservice.com</recipient> 
    </smtp-notification> 
    <!-- An SNMP notification -->
    <snmp-notification> 
      <name>mySNMPNotif</name> 
      <enabled>true</enabled> 
    </snmp-notification> 
  </watch-notification> 
</wldf-resource>