> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sync.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# システム監視

export const siteNameShortLower = "sync";

export const siteNameShort = "Sync";

export const siteName = "CData Sync";

システム監視は、{siteName} 環境が安定して利用可能な状態を維持するために役立ちます。このセクションでは、サーバーレベルで {siteNameShort} を監視するためにサポートされている方法について説明します。

管理者は、次の方法を使用してシステムの状態を監視できます。

* ヘルスチェックエンドポイントの監視
* サーバーログの確認

## ヘルスチェックエンドポイントを使用した CData Sync の監視

{siteNameShort} はヘルスチェックエンドポイント（http\://*YourHostName*:8181/pub/ping.rst）を公開しており、サーバーを監視してサーバーが実行されていることを確認するために使用できます。

このエンドポイントでは：

* *YourHostName* は {siteNameShort} サーバーのホスト名またはIP アドレスです。
* ポート8181 はデフォルトの {siteNameShort} Web サーバーポートです。カスタムポートを使用する場合は、URL を適宜更新してください。

次のcURL コマンドのようなコマンドでエンドポイントをテストできます：

`curl YourHostName:8181/pub/ping.rst`

<Note><span>この例ではcURL コマンドラインツールを使用していますが、他のツール（例えば、Wget コマンドラインツールや監視システム）を使用してエンドポイントをテストすることもできます。</span></Note>

### 準備完了チェック

単純なPing とは異なり、このエンドポイントは完全な準備完了チェックを実行します。デフォルトでは、60秒ごとに以下の情報を検証します：

* アプリケーションデータディレクトリが読み取りおよび書き込み可能である。
* アプリケーションデータベースにクエリを実行できる。
* ユーザーディレクトリを読み込むことができる。

### レスポンスコード

これらのチェックの結果は、返されるレスポンスコードに反映されます：

* **200 OK：** サーバーが実行中で、すべての準備完了チェックが成功しました。
* **レスポンスボディ：** `OK`
* **500 Internal Server Error：** サーバープロセスは実行中ですが、1つ以上の準備完了チェックが失敗しました（例：ファイルシステム、データベース、またはユーザーマネージャーの問題）。
* **レスポンスなし / 接続エラー：** サーバーが停止しているか、到達できません。

**例：**

すべての準備完了チェックが成功した場合、リクエストは `OK` というメッセージを返します。

<img src="https://mintcdn.com/cdata-sync/ANiMw09F6wBBj5Tp/images/System-Monitoring_monitoring-sync-with-healthcheck-endpoint_1.png?fit=max&auto=format&n=ANiMw09F6wBBj5Tp&q=85&s=9410487d7a0d238be4dea68a280a1da8" width="350" alt="Successful healthcheck response" data-path="images/System-Monitoring_monitoring-sync-with-healthcheck-endpoint_1.png" />

サーバーが停止しているか到達できない場合、監視ツールは次のようなメッセージに似た接続エラーを表示する場合があります：

<img src="https://mintcdn.com/cdata-sync/ANiMw09F6wBBj5Tp/images/System-Monitoring_monitoring-sync-with-healthcheck-endpoint_2.png?fit=max&auto=format&n=ANiMw09F6wBBj5Tp&q=85&s=54e8a4e56fe87c3c2be6f170fd737b71" width="575" alt="Connection error response" data-path="images/System-Monitoring_monitoring-sync-with-healthcheck-endpoint_2.png" />

## ログを使用した CData Sync の監視

{siteNameShort} は、サーバーアクティビティログをこのディレクトリに書き込みます：`ApplicationDirectory/logs/httpserver`

<Note>The <em>ApplicationDirectory</em> location varies by operating system and deployment. For more details, see [Configuring the Application Directory](../installation-and-configuration/configuring-the-server#configuring-the-application-directory).</Note>

これらのログを直接開いてトラブルシューティングを行うか、ログフォワーダーを設定して外部監視ツールと統合することができます。例えば、Datadog などのサードパーティ監視プラットフォームとこれらのログを統合することができます。（Datadog 以外のサードパーティ監視ツールも使用できます。）

Datadog では、Datadog Agent を使用して {siteNameShort} ログを収集・転送し、一元的な監視を行うことができます。基本的なプロセスは次のとおりです：

* `httpserver` ディレクトリからログを収集する。
* Datadog Agent を使用してログをDatadog に送信する。
* Datadog でダッシュボードとアラートを設定して、エラーやダウンタイムを追跡する。

これらの手順の詳細な説明については、<a href={`https://community.cdata.com/cdata-${siteNameShortLower}-47/seamless-monitoring-between-cdata-sync-and-datadog-798`} target="_blank" rel="noopener noreferrer">Seamless Monitoring Between CData {siteNameShort} and Datadog</a> を参照してください。
