[comment]: # ({df8dbb26-3fc5b143})
# 2 ZabbixエージェントでWindowsを監視する

[comment]: # ({/df8dbb26-3fc5b143})

[comment]: # ({5a0f005b-fd7b4328})
## はじめに

このページでは、ZabbixでWindowsマシンの基本的な監視を開始するために必要な手順を説明します。

**このガイドの対象者**

このガイドは、Zabbixの新規ユーザー向けに作成されており、Windowsマシンの基本的な監視を有効にするために必要な最小限の手順が含まれています。高度なカスタマイズオプションやより高度な設定が必要な場合は、Zabbixマニュアルの[設定](/manual/config)セクションを参照してください。

**前提条件**

このインストールガイドを進める前に、OSの指示に従ってZabbixサーバーとZabbixフロントエンドを[ダウンロードしてインストール](https://www.zabbix.com/download)する必要があります。

[comment]: # ({/5a0f005b-fd7b4328})

[comment]: # ({adf5cd81-7cec4ce2})
## Zabbixエージェントのインストール

Zabbixエージェントはデータ収集を担当するプロセスです。監視したいWindowsマシンにインストールする必要があります。[Windows](/manual/installation/install/win_msi)のZabbixエージェントインストール手順に従ってください。

![](../../../assets/en/manual/installation/install_from_packages/msi0_b.png)

[comment]: # ({/adf5cd81-7cec4ce2})

[comment]: # ({541ea782-c5ab18d1})
## 監視のためのZabbixの設定

Zabbixエージェントは、アクティブモードまたはパッシブモード（同時に）でメトリクスを収集できます。

::: noteclassic
パッシブチェックは単純なデータリクエストです。Zabbixサーバーまたはプロキシがデータ（例：CPU負荷）を要求し、Zabbixエージェントがその結果をサーバーに返します。アクティブチェックはより複雑な処理が必要です。エージェントは最初にサーバーから独立して処理するアイテムのリストを取得し、その後データをまとめてサーバーに送信します。詳細は[パッシブおよびアクティブエージェントチェック](/manual/appendix/items/activepassive)を参照してください。
:::

Zabbixが提供する監視テンプレートは通常、Zabbixエージェント用のテンプレートとZabbixエージェント（アクティブ）用のテンプレートという2つの選択肢を提供します。最初のオプションでは、エージェントはパッシブモードでメトリクスを収集します。これらのテンプレートは、異なる通信プロトコルを使用しますが、同じ監視結果を提供します。

以降のZabbixの設定は、[アクティブ](#active-checks)または[パッシブ](#passive-checks)のZabbixエージェントチェック用のテンプレートを選択するかによって異なります。

[comment]: # ({/541ea782-c5ab18d1})

[comment]: # ({5410a86a-76c0a12c})
### パッシブチェック

[comment]: # ({/5410a86a-76c0a12c})

[comment]: # ({f91957b4-854b1e0b})

#### Zabbix frontend

1\. Log into Zabbix frontend.

2\. [Create a host](/manual/config/hosts/host) in Zabbix web interface. 

This host will represent your Windows machine. 

3\. In the *Interfaces* parameter, add *Agent* interface and specify the IP 
address or DNS name of the Windows machine where the agent is installed. 

4\. In the *Templates* parameter, type or select *Windows by Zabbix agent*. 

![](../../../assets/en/manual/guides/win_host_passive.png){width="600"}

[comment]: # ({/f91957b4-854b1e0b})

[comment]: # ({433cef4b-17dcee1f})
#### Zabbix agent

For passive checks Zabbix agent needs to know the IP address or DNS name of Zabbix server. If you 
have provided correct information during the agent installation, the configuration file is already updated. Otherwise, you 
need to manually specify it. Go to the `C:\Program files\Zabbix Agent` folder, open the file 
*zabbix_agentd.conf* and add the IP/DNS of your Zabbix server to the *Server* parameter.

Example:

    Server=192.0.2.22

[comment]: # ({/433cef4b-17dcee1f})

[comment]: # ({4353394a-287beca2})
### アクティブチェック

[comment]: # ({/4353394a-287beca2})

[comment]: # ({5fa75beb-9d58b1d3})
#### Zabbixフロントエンド

1\. Zabbixフロントエンドにログインします。

2\. ZabbixのWebインターフェースで[ホストを作成](/manual/config/hosts/host)します。

このホストは、Windowsマシンを表します。

3\. *テンプレート*パラメータで、*Windows by Zabbix agent active*を入力または選択します。

![](../../../assets/en/manual/guides/win_host_active.png){width="600"}

[comment]: # ({/5fa75beb-9d58b1d3})

[comment]: # ({e4e86416-ec395430})
#### Zabbix agent

In the `C:\Program files\Zabbix Agent` folder open the file *zabbix_agentd.conf* and add:

- The name of the host you created in Zabbix web interface to the *Hostname* parameter.
- The IP address or DNS name of your Zabbix server machine to the *ServerActive* parameter (might be prefilled if you have provided it during Zabbix agent setup).

Example:
  
    ServerActive= 192.0.2.22
    Hostname=Windows workstation

[comment]: # ({/e4e86416-ec395430})

[comment]: # ({7ed12346-2bb9a9d4})
## 収集されたメトリックの表示

おめでとうございます！この時点で、ZabbixはすでにWindowsマシンを監視しています。

収集されたメトリックを表示するには、*監視->ホスト* 
[メニューセクション](/manual/web_interface/frontend_sections/monitoring/hosts)を開き、ホストの横にある*最新データ*をクリックします。

![](../../../assets/en/manual/guides/win_latest_data.png){width="600"}

[comment]: # ({/7ed12346-2bb9a9d4})

[comment]: # ({31d4f63e-eaf2b29b})
## 問題アラートの設定

Zabbixは、さまざまな方法でインフラストラクチャの問題を通知できます。このガイドでは、メールアラートを送信するための設定手順を説明します。

1\. *ユーザー設定 -> プロファイル* に移動し、*メディア* タブに切り替えて[メールアドレスを追加](/manual/installation/quick_guides/basic_config/login#adding-user)します。

![](../../../assets/en/manual/quickstart/new_media.png){width="600"}

2\. [問題通知の受信](/manual/installation/quick_guides/basic_config/notification)ガイドに従ってください。

次回、Zabbixが問題を検出した際には、メールでアラートを受け取ることができます。

:::notetip
Windowsでは、[CpuStres](https://docs.microsoft.com/en-us/sysinternals/downloads/cpustres)ユーティリティを使用して高いCPU負荷をシミュレートし、その結果として問題アラートを受信することができます。
:::

**関連情報:**

- [アイテムの作成](/manual/config/items/item) - 追加のメトリクスを監視する方法（テンプレートを使わないカスタム監視）。
- [Zabbixエージェントアイテム](/manual/config/items/itemtypes/zabbix_agent)、[Windows用Zabbixエージェントアイテム](/manual/config/items/itemtypes/zabbix_agent/win_keys) - Windows上のZabbixエージェントで監視できるメトリクスの全リスト。
- [問題のエスカレーション](/manual/config/notifications/action/escalations) - 複数段階のアラートシナリオの作成方法（例：最初にシステム管理者にメッセージを送信し、45分以内に問題が解決しない場合はデータセンター管理者にメッセージを送信）。

[comment]: # ({/31d4f63e-eaf2b29b})
