[comment]: # translation:outdated

[comment]: # ({ac919db9-ac919db9})
# 13 Zabbix統計のリモート監視

[comment]: # ({/ac919db9-ac919db9})

[comment]: # ({22debe41-22debe41})
#### 概要

Zabbixサーバーとプロキシの一部の内部メトリックを別のZabbixインスタンスまたはサードパーティツールからリモートでアクセスできるようにすることができます。これはサポーター/サービスプロバイダーがクライアントのZabbixサーバー/プロキシをリモートで監視できるようにする、またはZabbixがメインの監視ツールではない組織で、Zabbixの内部メトリックを包括的な監視用セットアップでサードパーティのシステムによって監視できるようにするために役立ちます。

Zabbixの内部統計は、新しい'StatsAllowedIP' [server](/manual/appendix/config/zabbix_server)/[proxy](/manual/appendix/config/zabbix_proxy)パラメーターにリストされた構成可能なアドレスのセットに公開されます。 リクエストはこれらのアドレスからのみ受け付けられます。

[comment]: # ({/22debe41-22debe41})

[comment]: # ({a506f2e2-a506f2e2})
#### アイテム

別のZabbixインスタンスで内部統計のクエリを設定するには、次の2つの項目を使用します。

-   `zabbix[stats,<ip>,<port>]` internal item - Zabbixサーバー/プロキシの直接リモートクエリ用。 <ip>と<port>は、ターゲットインスタンスを識別するために使用します
-   `zabbix.stats[<ip>,<port>]` agent item - Zabbixサーバー/プロキシのエージェントベースのリモートクエリ用。 <ip>と<port>は、ターゲットインスタンスを識別するために使用されます。

参考情報: [内部項目](/manual/config/items/itemtypes/internal), [Zabbixエージェントアイテム](/manual/config/items/itemtypes/zabbix_agent)

次の図はコンテキストに応じた、いずれかのアイテムの使用法を示しています。

![](../../../../assets/en/manual/appendix/items/ext_stats.png)

-   ![](../../../../assets/en/manual/appendix/items/green.png) - Server → external Zabbix instance (`zabbix[stats,<ip>,<port>]`)
-   ![](../../../../assets/en/manual/appendix/items/pink.png) - Server → proxy → external Zabbix instance (`zabbix[stats,<ip>,<port>]`)
-   ![](../../../../assets/en/manual/appendix/items/blue.png) - Server → agent → external Zabbix instance (`zabbix.stats[<ip>,<port>]`)
-   ![](../../../../assets/en/manual/appendix/items/red.png) - Server → proxy → agent → external Zabbix instance (`zabbix.stats[<ip>,<port>]`)

ターゲットインスタンスが外部インスタンスによるクエリを許可するには、ターゲットインスタンスの'StatsAllowedIP'パラメータに外部インスタンスのアドレスをリストします。

[comment]: # ({/a506f2e2-a506f2e2})

[comment]: # ({ae65d17e-ae65d17e})
#### 公開メトリック

統計アイテムは統計をまとめて収集し、JSONを返します。これは依存アイテムがデータを取得するための基礎となります。 次の[内部メトリック](/manual/config/items/itemtypes/internal)は、2つのアイテムのいずれかによって返されます。

-   `zabbix[boottime]`
-   `zabbix[hosts]`
-   `zabbix[items]`
-   `zabbix[items_unsupported]`
-   `zabbix[preprocessing_queue]` (server only)
-   `zabbix[process,<type>,<mode>,<state>]` (only process type based
    statistics)
-   `zabbix[rcache,<cache>,<mode>]`
-   `zabbix[requiredperformance]`
-   `zabbix[triggers]` (server only)
-   `zabbix[uptime]`
-   `zabbix[vcache,buffer,<mode>]` (server only)
-   `zabbix[vcache,cache,<parameter>]`
-   `zabbix[version]`
-   `zabbix[vmware,buffer,<mode>]`
-   `zabbix[wcache,<cache>,<mode>]` ('trends' cache type server only)

[comment]: # ({/ae65d17e-ae65d17e})

[comment]: # ({33cbf401-33cbf401})
#### テンプレート

テンプレートは、Zabbixサーバーの[リモートモニタリング](/manual/appendix/items/remote_stats)または外部インスタンスからのプロキシ内部メトリックに使用できます。

-   Remote Zabbix server
-   Remote Zabbix proxy

複数の外部インスタンスのリモート監視にテンプレートを使用するには、外部インスタンスの監視ごとに個別のホストが必要であることに注意してください。

[comment]: # ({/33cbf401-33cbf401})

[comment]: # ({89428848-89428848})
#### トラッパープロセス

外部Zabbixインスタンスからの内部メトリックリクエストの受信は、リクエストを検証し、メトリックを収集し、JSONデータバッファーを作成し、準備されたJSONをサーバーなどから送り返すトラッパープロセスによって処理されます。

``` {.java}
{
  "response": "success",
  "data": {
    "boottime": N,
    "uptime": N,
    "hosts": N,
    "items": N,
    "items_unsupported": N,
    "preprocessing_queue": N,
    "process": {
      "alert manager": {
        "busy": {
          "avg": N,
          "max": N,
          "min": N
        },
        "idle": {
          "avg": N,
          "max": N,
          "min": N
        },
        "count": N
      },
...
    },
    "queue": N,
    "rcache": {
      "total": N,
      "free": N,
      "pfree": N,
      "used": N,
      "pused": N
    },
    "requiredperformance": N,
    "triggers": N,
    "uptime": N,
    "vcache": {
      "buffer": {
        "total": N,
        "free": N,
        "pfree": N,
        "used": N,
        "pused": N
      },
      "cache": {
        "requests": N,
        "hits": N,
        "misses": N,
        "mode": N
      }
    },
    "vmware": {
      "total": N,
      "free": N,
      "pfree": N,
      "used": N,
      "pused": N
    },
    "version": "N",
    "wcache": {
      "values": {
        "all": N,
        "float": N,
        "uint": N,
        "str": N,
        "log": N,
        "text": N,
        "not supported": N
      },
      "history": {
        "pfree": N,
        "free": N,
        "total": N,
        "used": N,
        "pused": N
      },
      "index": {
        "pfree": N,
        "free": N,
        "total": N,
        "used": N,
        "pused": N
      },
      "trend": {
        "pfree": N,
        "free": N,
        "total": N,
        "used": N,
        "pused": N
      }
    }
  }
}
```

[comment]: # ({/89428848-89428848})

[comment]: # ({c668697f-c668697f})
#### 内部キューアイテム

別のZabbixインスタンスで内部キュー統計をリモートクエリできるようにする別の2つの項目もあります。

-   `zabbix[stats,<ip>,<port>,queue,<from>,<to>]` internal item - リモートZabbixサーバー/プロキシへの直接内部キュークエリ用
-   `zabbix.stats[<ip>,<port>,queue,<from>,<to>]` agent item - リモートZabbixサーバー/プロキシへのエージェントベースの内部キュークエリ用

参考情報: [内部項目](/manual/config/items/itemtypes/internal), [Zabbixエージェントアイテム](/manual/config/items/itemtypes/zabbix_agent)

[comment]: # ({/c668697f-c668697f})
