Supported OS Linux Mac OS Windows

インテグレーションバージョン1.14.3

概要

選択したディレクトリやファイルからメトリクスをキャプチャします。Agent は以下を収集します。

  • ファイルの数
  • ファイルサイズ
  • 最終更新からの経過時間
  • 作成からの経過時間

セットアップ

インストール

Directory チェックは Datadog Agent パッケージに含まれています。サーバーに追加でインストールする必要はありません。

コンフィギュレーション

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

    init_config:
    
    instances:
      ## @param directory - string - required
      ## The directory to monitor. On windows, please make sure you escape back-slashes otherwise the YAML
      ## parser fails (eg. - directory: "C:\\Users\\foo\\Downloads").
      #
      - directory: "<DIRECTORY_PATH>"
    

    Agent プロセスを実行しているユーザーが (通常は datadog-agent)、構成したディレクトリ、サブディレクトリ、およびファイルへの読み取りアクセス権を持つことを確認してください。

    : Windows でチェックを実行するには、ディレクトリを追加する際に、単一のバックスラッシュ C:\path\to\directory ではなく、ダブルバックスラッシュ C:\\path\\to\\directory を使用してください。そうしないと、トレースバックの最後に found unknown escape character in "<string>" というエラーが示されて、ディレクトリチェックが失敗します。

  2. Agent を再起動します

検証

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

収集データ

メトリクス

system.disk.directory.bytes
(gauge)
Total size of the directory
Shown as byte
system.disk.directory.file.bytes
(gauge)
Total size of the file
Shown as byte
system.disk.directory.file.modified_sec_ago
(gauge)
Duration since last modification
Shown as second
system.disk.directory.file.created_sec_ago
(gauge)
Duration since creation
Shown as second
system.disk.directory.files
(gauge)
Number of files in the directory
Shown as file
system.disk.directory.folders
(gauge)
Number of folders in the directory
Shown as file

イベント

Directory チェックには、イベントは含まれません。

サービスのチェック

system.disk.directory.exists
Returns WARNING if the Agent is unable to find or access the directory to monitor, OK otherwise.
Statuses: ok, warning

トラブルシューティング

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