Apache チェックは、毎秒のリクエスト数、処理されたバイト数、ワーカースレッド数、サービスアップタイムなどを追跡します。
Apache チェックは Agent にパッケージ化されています。Apache のメトリクスとログの収集を開始するには、以下を行います。
Apache サーバーに Agent をインストールします。
Apache サーバーに mod_status
をインストールし、ExtendedStatus
を有効にします。
ホストで実行中の Agent に対してこのチェックを構成するには:
Apache メトリクスの収集を開始するには、Agent のコンフィギュレーションディレクトリのルートにある conf.d/
フォルダーの apache.d/conf.yaml
ファイルを編集します。使用可能なすべてのコンフィギュレーションオプションの詳細については、サンプル apache.d/conf.yaml を参照してください。
init_config:
instances:
## @param apache_status_url - string - required
## Status url of your Apache server.
#
- apache_status_url: http://localhost/server-status?auto
Agent バージョン 6.0 以降で利用可能
Datadog Agent で、ログの収集はデフォルトで無効になっています。以下のように、datadog.yaml
でこれを有効にする必要があります。
logs_enabled: true
Apache のログの収集を開始するには、次の構成ブロックを apache.d/conf.yaml
ファイルに追加します。
logs:
- type: file
path: /var/log/apache2/access.log
source: apache
service: apache
- type: file
path: /var/log/apache2/error.log
source: apache
service: apache
path
パラメーターと service
パラメーターの値を変更し、環境に合わせて構成してください。使用可能なすべてのコンフィギュレーションオプションの詳細については、サンプル apache.d/conf.yaml を参照してください。
コンテナ環境の場合は、オートディスカバリーのインテグレーションテンプレートのガイドを参照して、次のパラメーターを適用してください。
パラメーター | 値 |
---|---|
<インテグレーション名> | apache |
<初期コンフィギュレーション> | 空白または {} |
<インスタンスコンフィギュレーション> | {"apache_status_url": "http://%%host%%/server-status?auto"} |
Agent バージョン 6.0 以降で利用可能
Datadog Agent で、ログの収集はデフォルトで無効になっています。有効にする方法については、Kubernetes ログ収集のドキュメントを参照してください。
パラメーター | 値 |
---|---|
<LOG_CONFIG> | {"source": "apache", "service": "<サービス名>"} |
Agent の status サブコマンドを実行し、Checks セクションの apache
を探します。
apache.conns_total (gauge) | The total number of connections performed. Shown as connection |
apache.conns_async_writing (gauge) | The number of asynchronous writes connections. Shown as connection |
apache.conns_async_keep_alive (gauge) | The number of asynchronous keep alive connections. Shown as connection |
apache.conns_async_closing (gauge) | The number of asynchronous closing connections. Shown as connection |
apache.net.bytes (gauge) | The total number of bytes served. Shown as byte |
apache.net.bytes_per_s (gauge) | The number of bytes served per second. Shown as byte |
apache.net.hits (gauge) | The total number of requests performed. Shown as request |
apache.net.request_per_s (gauge) | The number of requests performed per second. Shown as request |
apache.performance.cpu_load (gauge) | The percent of CPU used. Shown as percent |
apache.performance.busy_workers (gauge) | The number of workers serving requests. Shown as thread |
apache.performance.idle_workers (gauge) | The number of idle workers. Shown as thread |
apache.performance.uptime (gauge) | The amount of time the server has been running. Shown as second |
Apache チェックにはイベントは含まれません。
apache.can_connect:
設定された apache_status_url
に Agent が接続できない場合は、CRITICAL
を返します。それ以外の場合は、OK
を返します。
Apache インテグレーションで問題が発生する場合の多くは、Agent が Apache のステータス URL にアクセスできないことが原因です。apache.d/conf.yaml
ファイルに一覧表示されている apache_status_url
に対して curl を実行してみてください (必要に応じてログイン資格情報を指定)。
お役に立つドキュメント、リンクや記事: