2 ZabbixエージェントでWindowsを監視する

はじめに

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

このガイドの対象者

このガイドは、Zabbix を初めて利用するユーザー向けに作成されており、Windows マシンの基本的な監視を有効にするために必要な最小限の手順を記載しています。
詳細なカスタマイズオプションを探している場合、またはより高度な設定が必要な場合は、Zabbix マニュアルの 設定 セクションを参照してください。

前提条件

このインストールガイドを進める前に、お使いの OS 向けの手順に従って、Zabbix サーバーおよび Zabbix Webインターフェースを ダウンロードしてインストール しておく必要があります。

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

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

監視用にZabbixを設定する

Zabbixエージェントは、アクティブモードまたはパッシブモードでメトリクスを収集できます(同時使用も可能です)。

パッシブチェックは、単純なデータ要求です。Zabbixサーバーまたはプロキシが何らかのデータ(たとえばCPU負荷)を要求し、Zabbixエージェントがその結果をサーバーに返します。アクティブチェックでは、より複雑な処理が必要です。エージェントはまず、独立して処理するためのアイテムの一覧をサーバーから取得し、その後データをまとめて送り返す必要があります。詳細は、Passive and active agent checksを参照してください。

Zabbixが提供する監視テンプレートには、通常2つの選択肢があります。Zabbixエージェント用のテンプレートと、Zabbixエージェント(アクティブ)用のテンプレートです。前者を選択した場合、エージェントはパッシブモードでメトリクスを収集します。これらのテンプレートは、使用する通信プロトコルは異なりますが、同一の監視結果を提供します。

以降のZabbix設定は、アクティブ または パッシブ のZabbixエージェントチェック用テンプレートのどちらを選択するかによって異なります。

パッシブチェック

Zabbix frontend

1. Log into Zabbix frontend.

2. Create a 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.

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

アクティブチェック

Zabbix Webインターフェース

1. Zabbix Webインターフェースにログインします。

2. Zabbix Webインターフェースでホストを作成します。

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

3. Templates パラメータで、Windows by Zabbix agent active を入力または選択します。

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

収集したメトリクスの表示

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

収集したメトリクスを表示するには、メニューセクション Monitoring->Hosts を開き、ホストの横にある Latest data をクリックします。

障害アラートの設定

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

1. User settings -> Profile に移動し、Media タブに切り替えて、メールアドレスを追加します。

2. 障害通知の受信 のガイドに従ってください。

次回、Zabbixが障害を検出したときに、メールでアラートを受信するはずです。

Windowsでは、CpuStres ユーティリティを使用して高いCPU負荷をシミュレートし、その結果として障害アラートを受信できます。

関連情報: