Active Directory¶
インストールとデプロイ¶
説明: サンプル Active Directory exporter のバージョンは 0.24.0 (Windows) です。
DataKit コレクタを有効化する¶
- DataKit の Prom プラグインを有効にし、sample ファイルをコピーする
prom.conf設定ファイルを修正する
設定は以下のとおり
[[inputs.prom]]
## Exporter URLs
urls = ["http://127.0.0.1:9182/metrics"]
## url へのリクエストエラーを無視する
ignore_req_err = false
## コレクタの別名
source = "active_directory"
## 収集データの出力先
# この項目を設定すると、収集したデータをセンターへ送らずにローカルファイルへ出力できます
# その後、datakit --prom-conf /path/to/this/conf コマンドで、ローカルに保存されたメトリクスセットを直接デバッグできます
# すでに url をローカルファイルパスに設定している場合は、--prom-conf が output パスのデータを優先してデバッグします
# output = "/abs/path/to/file"
>
## 収集データの上限サイズ、単位はバイト
# データをローカルファイルへ出力する場合、収集データの上限サイズを設定できます
# 収集データのサイズがこの上限を超えると、収集されたデータは破棄されます
# 収集データの上限サイズは既定で 32MB に設定されています
# max_file_size = 0
## メトリクスタイプのフィルタ。指定可能な値は counter, gauge, histogram, summary
# 既定では counter と gauge のメトリクスのみを収集します
# 空の場合はフィルタしません
metric_types = ["counter", "gauge"]
## メトリクス名のフィルタ
# 正規表現をサポートし、複数指定できます。いずれかに一致すればよいです
# 空の場合はフィルタしません
# metric_name_filter = ["cpu"]
## メトリクスセット名のプレフィックス
# この項目を設定すると、メトリクスセット名にプレフィックスを追加できます
measurement_prefix = ""
## メトリクスセット名
# 既定ではメトリクス名をアンダースコア "_" で分割し、分割後の最初のフィールドをメトリクスセット名、残りを現在のメトリクス名とします
# measurement_name を設定すると、メトリクス名の分割は行われません
# 最終的なメトリクスセット名には measurement_prefix プレフィックスが追加されます
# measurement_name = "prom"
## 収集間隔 "ns", "us" (or "µs"), "ms", "s", "m", "h"
interval = "10s"
## tags をフィルタする。複数の tag を設定可能
# 一致した tag は無視されます
# tags_ignore = ["xxxx"]
## TLS 設定
tls_open = false
# tls_ca = "/tmp/ca.crt"
# tls_cert = "/tmp/peer.crt"
# tls_key = "/tmp/peer.key"
## カスタム認証方式。現在は Bearer Token のみ対応
# token と token_file: いずれか一方のみ設定すればよい
# [inputs.prom.auth]
# type = "bearer_token"
# token = "xxxxxxxx"
# token_file = "/tmp/token"
## カスタムメトリクスセット名
# prefix を含むメトリクスを 1 つのメトリクスセットとしてまとめることができます
# カスタムメトリクスセット名の設定は measurement_name 設定項目より優先されます
#[[inputs.prom.measurements]]
# prefix = "cpu_"
# name = "cpu"
# [[inputs.prom.measurements]]
# prefix = "mem_"
# name = "mem"
## カスタム Tags
[inputs.prom.tags]
service = "active_directory"
# more_tag = "some_other_value"
- DataKit を再起動する(ログの収集を有効にする必要がある場合は、ログ収集を設定してから再起動してください)
- DQL 検証
[root@df-solution-ecs-018 prom]# datakit -Q
Flag -Q is deprecated. 推奨されるフラグを使うには datakit help を参照してください。
dqlcmd: &cmds.dqlCmd{json:false, autoJSON:false, verbose:false, csv:"", forceWriteCSV:false, dqlString:"", token:"tkn_9a49a7e9343c432eb0b99a297401c3bb", host:"0.0.0.0:9529", log:"", dqlcli:(*http.Client)(0xc0009a5800)}
dql > M::active_directory LIMIT 1
-----------------[ r1.active_directory.s1 ]-----------------
windows_ad_atq_average_request_latency 0
windows_ad_atq_current_threads 44
windows_ad_atq_outstanding_requests 0
windows_ad_ldap_client_sessions '1.0'
windows_ad_replication_inbound_properties_updated_total '0.0'
windows_ad_replication_pending_operations '0.0'
.....
windows_cs_hostname 2
windows_cs_physical_memory_bytes 0
time 2023-11-1 16:00:10 +0800 CST
windows_exchange_owa_requests_total 0
windows_exchange_rpc_user_count 0
windows_exporter_build_info 0
uptime 2858680025
windows_exporter_collector_duration_seconds 0
---------
1 rows, 1 series, cost 40.297037ms
メトリクス詳細¶
| Name | Description | メトリクスの意味 | 単位 | ディメンション |
|---|---|---|---|---|
| windows_ad_replication_pending_synchronizations | Shows the number of directory synchronizations that are queued for this server but not yet processed. | このサーバーでキューに入っているが、まだ処理されていないディレクトリ同期の回数を示します。 | count | host |
| windows_ad_replication_sync_requests_total | Shows the number of sync requests made to neighbors. | 隣接先へ送信された同期リクエスト数を示します。 | count | host |
| windows_ad_replication_sync_requests_success_total | Shows the number of sync requests made to the neighbors that successfully returned. | 隣接先へ送信された同期リクエストのうち、正常に返答があった回数を示します。 | count | host |
| windows_ad_ldap_active_threads | Shows the current number of threads in use by the LDAP subsystem of the local directory service. | ローカルディレクトリサービスの LDAP サブシステムで現在使用中のスレッド数を示します。 | count | host |
| windows_ad_ldap_last_bind_time_seconds | Shows the time, in milliseconds, taken for the last successful LDAP bind. | 最後に成功した LDAP bind に要した時間(ミリ秒)を示します。 | count | host |
| windows_ad_ldap_searches_total | Shows the number at which LDAP clients perform search operations. | LDAP クライアントが検索操作を実行した回数を示します。 | count | host |
| windows_ad_ldap_writes_total | Shows the number at which LDAP clients perform write operations. | LDAP クライアントが書き込み操作を実行した回数を示します。 | count | host |
| windows_ad_ldap_client_sessions | This is the number of sessions opened by LDAP clients at the time the data is taken. | データ取得時点で LDAP クライアントによって開かれていたセッション数です。 | count | host |
| windows_ad_replication_inbound_sync_objects_remaining | Shows the number of objects remaining before full synchronization is complete (at setup). | 完全同期が完了するまでに残っているオブジェクト数を示します(セットアップ時)。 | count | host |
| windows_ad_replication_inbound_objects_updated_total | Shows the number of objects received from neighbors through inbound replication. A neighbor is a domain controller from which the local domain controller replicates locally. | 入ってくるレプリケーションを通じて隣接先から受信したオブジェクト数を示します。隣接先とは、ローカルのドメインコントローラーがローカルにレプリケートする対象のドメインコントローラーです。 | count | host |
| windows_ad_replication_inbound_objects_filtered_total | Shows the number of objects received from inbound replication partners that contained no updates that needed to be applied. | 入ってくるレプリケーションのパートナーから受信したオブジェクトのうち、適用すべき更新を含まなかったものの数を示します。 | count | host |