IBM Db2
セキュリティモニタリングが使用可能です セキュリティモニタリングが使用可能です

IBM Db2

Agent Check Agentチェック

Supported OS: Linux Mac OS Windows

デフォルトのダッシュボード

概要

このチェックは、Datadog Agent を通じて IBM Db2 を監視します。

セットアップ

インストール

IBM Db2 チェックは Datadog Agent パッケージに含まれています。

依存関係

ibm_db クライアントライブラリが必要です。これをインストールするには、コンパイラーが用意されていることを確認し、次を実行します。

Unix
/opt/datadog-agent/embedded/bin/pip install ibm_db==3.0.1
Windows

Agent バージョン < 6.11 の場合

"C:\Program Files\Datadog\Datadog Agent\embedded\python.exe" -m pip install ibm_db==3.0.1

Agent バージョン >= 6.12 の場合

"C:\Program Files\Datadog\Datadog Agent\embedded<PYTHON_MAJOR_VERSION>\python.exe" -m pip install ibm_db==3.0.1

Linux では、XML 機能が必要になる場合があります。ビルドプロセス中にエラーが発生した場合は、 libxslt-dev (RPM では libxslt-devel) をインストールしてください。

権限

一部のテーブルからのメトリクスを問い合わせるには、選択した Db2 ユーザーに特別な権限を付与する必要があります。 インスタンスマスターユーザーに切り替えて、db2 プロンプトで次のコマンドを実行します。

update dbm cfg using HEALTH_MON on
update dbm cfg using DFT_MON_STMT on
update dbm cfg using DFT_MON_LOCK on
update dbm cfg using DFT_MON_TABLE on
update dbm cfg using DFT_MON_BUFPOOL on

これで、get dbm cfg を実行すると、次のように表示されます。

 Default database monitor switches
   Buffer pool                         (DFT_MON_BUFPOOL) = ON
   Lock                                   (DFT_MON_LOCK) = ON
   Sort                                   (DFT_MON_SORT) = OFF
   Statement                              (DFT_MON_STMT) = ON
   Table                                 (DFT_MON_TABLE) = ON
   Timestamp                         (DFT_MON_TIMESTAMP) = ON
   Unit of work                            (DFT_MON_UOW) = OFF
 Monitor health of instance and databases   (HEALTH_MON) = ON

コンフィギュレーション

ホスト

ホストで実行中の Agent でこのチェックを構成する場合は、以下の手順に従ってください。コンテナ環境の場合は、コンテナ化セクションを参照してください。

メトリクスの収集
  1. ibm_db2 のパフォーマンスデータの収集を開始するには、Agent の構成ディレクトリのルートにある conf.d/ フォルダーの ibm_db2.d/conf.yaml ファイルを編集します。使用可能なすべての構成オプションの詳細については、サンプル ibm_db2.d/conf.yaml を参照してください。

  2. Agent を再起動します

ログの収集

Agent バージョン 6.0 以降で利用可能

  1. Datadog Agent で、ログの収集はデフォルトで無効になっています。以下のように、datadog.yaml ファイルでこれを有効にします。

    logs_enabled: true
  2. IBM Db2 のログの収集を開始するには、次の構成ブロックを ibm_db2.d/conf.yaml ファイルに追加します。

    logs:
     - type: file
       path: /home/db2inst1/sqllib/db2dump/db2diag.log
       source: ibm_db2
       service: db2sysc
       log_processing_rules:
         - type: multi_line
           name: new_log_start_with_date
           pattern: \d{4}\-(0?[1-9]|[12][0-9]|3[01])\-(0?[1-9]|1[012])
  3. Agent を再起動します

コンテナ化

コンテナ環境の場合は、オートディスカバリーのインテグレーションテンプレートをガイドとして参照して、次のパラメーターを適用します。

メトリクスの収集
パラメーター
<インテグレーション名>ibm_db2
<初期コンフィギュレーション>空白または {}
<インスタンスコンフィギュレーション>{"db": "<DB_NAME>", "username":"<USERNAME>", "password":"<PASSWORD>", "host":"%%host%%", "port":"%%port%%"}
ログの収集

Agent バージョン 6.0 以降で利用可能

Datadog Agent で、ログの収集はデフォルトで無効になっています。有効にする方法については、Kubernetes ログ収集のドキュメントを参照してください。

パラメーター
<LOG_CONFIG>`{“source”: “ibm_db2”, “service”: “”, “log_processing_rules”: {“type”:“multi_line”,“name”:“new_log_start_with_date”, “pattern”:”\d{4}-(0?[1-9]

検証

Agent の status サブコマンドを実行し、Checks セクションで ibm_db2 を探します。

収集データ

メトリクス

ibm_db2.application.active
(gauge)
The number of applications that are currently connected to the database.
Shown as connection
ibm_db2.application.executing
(gauge)
The number of applications for which the database manager is currently processing a request.
Shown as connection
ibm_db2.connection.active
(gauge)
The current number of connections.
Shown as connection
ibm_db2.connection.max
(gauge)
The highest number of simultaneous connections to the database since the database was activated.
Shown as connection
ibm_db2.connection.total
(count)
The total number of connections to the database since the first connect, activate, or last reset (coordinator agents).
Shown as connection
ibm_db2.lock.dead
(count)
The total number of deadlocks that have occurred.
Shown as lock
ibm_db2.lock.waiting
(gauge)
The number of agents waiting on a lock.
Shown as lock
ibm_db2.lock.active
(gauge)
The number of locks currently held.
Shown as lock
ibm_db2.lock.wait
(gauge)
The average wait time for a lock.
Shown as millisecond
ibm_db2.lock.pages
(gauge)
The memory pages (4 KiB each) currently in use by the lock list.
Shown as page
ibm_db2.lock.timeouts
(count)
The number of times that a request to lock an object timed out instead of being granted.
Shown as lock
ibm_db2.backup.latest
(gauge)
The time elapsed since the latest database backup was completed.
Shown as second
ibm_db2.row.modified.total
(count)
The total number of rows inserted, updated, or deleted.
Shown as row
ibm_db2.row.reads.total
(count)
The total number of rows that had to be read in order to return result sets.
Shown as row
ibm_db2.row.returned.total
(count)
The total number of rows that have been selected by and returned to applications.
Shown as row
ibm_db2.bufferpool.column.reads.physical
(count)
The number of column-organized table data pages read from the physical table space containers for temporary, regular, and large table spaces.
Shown as get
ibm_db2.bufferpool.column.reads.logical
(count)
The number of column-organized table data pages read from the logical table space containers for temporary, regular, and large table spaces.
Shown as get
ibm_db2.bufferpool.column.reads.total
(count)
The total number of column-organized table data pages read from the table space containers for temporary, regular, and large table spaces.
Shown as get
ibm_db2.bufferpool.column.hit_percent
(gauge)
The percentage of time that the database manager did not need to load a page from disk to service a column-organized table data page request.
Shown as percent
ibm_db2.bufferpool.data.reads.physical
(count)
The number of data pages read from the physical table space containers for temporary, regular and large table spaces.
Shown as get
ibm_db2.bufferpool.data.reads.logical
(count)
The number of data pages read from the logical table space containers for temporary, regular and large table spaces.
Shown as get
ibm_db2.bufferpool.data.reads.total
(count)
The total number of data pages read from the table space containers for temporary, regular and large table spaces.
Shown as get
ibm_db2.bufferpool.data.hit_percent
(gauge)
The percentage of time that the database manager did not need to load a page from disk to service a data page request.
Shown as percent
ibm_db2.bufferpool.index.reads.physical
(count)
The number of index pages read from the physical table space containers for temporary, regular and large table spaces.
Shown as get
ibm_db2.bufferpool.index.reads.logical
(count)
The number of index pages read from the logical table space containers for temporary, regular and large table spaces.
Shown as get
ibm_db2.bufferpool.index.reads.total
(count)
The total number of index pages read from the table space containers for temporary, regular and large table spaces.
Shown as get
ibm_db2.bufferpool.index.hit_percent
(gauge)
The percentage of time that the database manager did not need to load a page from disk to service an index page request.
Shown as percent
ibm_db2.bufferpool.xda.reads.physical
(count)
The number of data pages for XML storage objects (XDAs) read from the physical table space containers for temporary, regular and large table spaces.
Shown as get
ibm_db2.bufferpool.xda.reads.logical
(count)
The number of data pages for XML storage objects (XDAs) read from the logical table space containers for temporary, regular and large table spaces.
Shown as get
ibm_db2.bufferpool.xda.reads.total
(count)
The total number of data pages for XML storage objects (XDAs) read from the table space containers for temporary, regular and large table spaces.
Shown as get
ibm_db2.bufferpool.xda.hit_percent
(gauge)
The percentage of time that the database manager did not need to load a page from disk to service an index page request.
Shown as percent
ibm_db2.bufferpool.reads.physical
(count)
The number of pages read from the physical table space containers for temporary, regular and large table spaces.
Shown as get
ibm_db2.bufferpool.reads.logical
(count)
The number of pages read from the logical table space containers for temporary, regular and large table spaces.
Shown as get
ibm_db2.bufferpool.reads.total
(count)
The total number of pages read from the table space containers for temporary, regular and large table spaces.
Shown as get
ibm_db2.bufferpool.hit_percent
(gauge)
The percentage of time that the database manager did not need to load a page from disk to service a page request.
Shown as percent
ibm_db2.bufferpool.group.column.hit_percent
(gauge)
The percentage of time that the group database manager did not need to load a page from disk to service a column-organized table data page request.
Shown as percent
ibm_db2.bufferpool.group.data.hit_percent
(gauge)
The percentage of time that the group database manager did not need to load a page from disk to service a data page request.
Shown as percent
ibm_db2.bufferpool.group.index.hit_percent
(gauge)
The percentage of time that the group database manager did not need to load a page from disk to service an index page request.
Shown as percent
ibm_db2.bufferpool.group.xda.hit_percent
(gauge)
The percentage of time that the group database manager did not need to load a page from disk to service an index page request.
Shown as percent
ibm_db2.bufferpool.group.hit_percent
(gauge)
The percentage of time that the group database manager did not need to load a page from disk to service a page request.
Shown as percent
ibm_db2.tablespace.size
(gauge)
The total size of the table space in bytes.
Shown as byte
ibm_db2.tablespace.usable
(gauge)
The total usable size of the table space in bytes.
Shown as byte
ibm_db2.tablespace.used
(gauge)
The total used size of the table space in bytes.
Shown as byte
ibm_db2.tablespace.utilized
(gauge)
The utilization of the table space as a percentage.
Shown as percent
ibm_db2.log.used
(gauge)
The disk blocks (4 KiB each) of active log space currently used in the database.
Shown as block
ibm_db2.log.available
(gauge)
The disk blocks (4 KiB each) of active log space in the database that is not being used by uncommitted transactions.
Shown as block
ibm_db2.log.utilized
(gauge)
The utilization of active log space as a percentage.
Shown as percent
ibm_db2.log.reads
(count)
The number of log pages read from disk by the logger.
Shown as read
ibm_db2.log.writes
(count)
The number of log pages written to disk by the logger.
Shown as write

サービスのチェック

ibm_db2.can_connect:
監視対象の IBM Db2 データベースに Agent が接続できない場合は、CRITICAL を返します。それ以外の場合は、OK を返します。

ibm_db2.status:
監視対象の IBM Db2 データベースが静止状態の場合は CRITICAL、静止ペンディングまたはロールフォワードの場合は WARNING、それ以外の場合は OK を返します。

イベント

  • テーブルスペースの状態が変化するたびに、ibm_db2.tablespace_state_change がトリガーされます。

トラブルシューティング

ご不明な点は、Datadog のサポートチームまでお問合せください。

その他の参考資料

お役に立つドキュメント、リンクや記事: