[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]: # ({3e340b44-7cec4ce2})

## Zabbix エージェントのインストール

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

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

[comment]: # ({/3e340b44-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 ウェブインターフェースで [ホストを作成](/manual/config/hosts/host)します。

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

3\. *Templates* パラメータに、*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]: # ({1626a19b-eaf2b29b})
## 問題アラートの設定

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

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

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

2. [問題通知の受信](/manual/quickstart/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]: # ({/1626a19b-eaf2b29b})
