[comment]: # translation:outdated

[comment]: # ({f733158d-f733158d})
# 9 すぐに使えるテンプレート

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

[comment]: # ({042e2638-0cc95643})
#### 概要

Zabbix は、監視対象の設定を簡素化し、迅速化するために、事前設定済みの[テンプレート](/manual/config/templates)を拡充し続けています。

すべての標準搭載テンプレートは、*データ収集* > [*テンプレート*](/manual/web_interface/frontend_sections/data_collection/templates) で利用できます。

Zabbix のアップグレード時には、カスタム変更が上書きされるのを防ぐため、既存のテンプレートは自動的には更新されません。
既存のテンプレートをアップグレードする場合、または新しいテンプレートを追加する場合は、[テンプレートのアップグレード](#template-upgrade)を参照してください。

特定のテンプレートタイプや運用要件に関する情報にアクセスするには、サイドバーを使用してください。

関連情報:

-   [テンプレートのリンク](/manual/config/templates/linking#linking_a_template)
-   [テンプレートに関する既知の問題](/manual/installation/known_issues#templates)

[comment]: # ({/042e2638-0cc95643})

[comment]: # ({31f0c491-9cb37712})
#### テンプレートのアップグレード

Zabbixのアップグレード後に、単一のテンプレートをアップグレードする、または新しいテンプレートを追加するには、次のようにします。

1. [Zabbix Gitリポジトリ](https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates?at=refs%2Fheads%2Frelease%2F7.4)に移動します。
2. ブランチセレクター（*Source*ラベルの下）で、使用しているZabbixのバージョンに一致するブランチを選択します（例: Zabbix 7.4の場合は*release/7.4*）。
3. 追加またはアップグレードしたいテンプレートを開きます（例: [MySQL by Zabbix agent](https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/mysql_agent?at=refs%2Fheads%2Frelease%2F7.4)）。
4. テンプレートファイルの内容（例: `template_db_mysql_agent.yaml`）をコピーし、ローカルファイルとして保存します。
5. Zabbix Webインターフェースで、*Data collection* > *Templates*に移動し、ローカルファイルを[インポート](/manual/xml_export_import/templates#importing)します。

すべてのテンプレートをアップグレードし、新しいテンプレートをまとめて追加することもできます。

1. 使用しているWebサーバーに応じてテンプレートバンドルをダウンロードします: [`templates_1M_7.4.7z`](https://www.zabbix.com/documentation/7.4/assets/en/template_bundles/templates_1M_7.4.7z)（Nginx）または[`templates_2M_7.4.7z`](https://www.zabbix.com/documentation/7.4/assets/en/template_bundles/templates_2M_7.4.7z)（Apache）。
2. バンドルを展開します。これにはYAMLファイル（それぞれに複数のテンプレートを含む）と、各YAMLファイルに含まれるテンプレートを一覧表示するインデックス（`index-1M_74.md`）が含まれています。
3. Zabbix Webインターフェースで、*Data collection* > *Templates*に移動し、YAMLファイルを1つずつ[インポート](/manual/xml_export_import/templates#importing)します。

または、[`import_templates.sh`](https://www.zabbix.com/documentation/7.4/assets/en/template_bundles/import_templates.sh)スクリプトを使用して、すべてのYAMLファイルを一度にインポートすることもできます。  
このスクリプトには[`curl`](https://curl.se/)および[`jq`](https://jqlang.org/)ユーティリティが必要で、[`configuration.import`](/manual/api/reference/configuration/import) Zabbix APIメソッドを使用します。  
スクリプトの実行時には、YAMLファイルを含むディレクトリと、Zabbix APIの[URL](/manual/api#performing-requests)および[認証トークン](/manual/api#authentication)を指定してください。

::: notewarning
`import_templates.sh`スクリプトは、既存のすべてのテンプレートを上書きし、テンプレートの変更を[確認](/manual/xml_export_import/templates#importing)したり元に戻したりするオプションはありません。
:::

例:

```bash
./import_templates.sh /tmp/templates_2M_7.4 https://example.com/zabbix/api_jsonrpc.php d8d6b5c78ee2a8333db11bfcd3e448c49c239d8ce00702759e2b56f42e24dbe4
```

[comment]: # ({/31f0c491-9cb37712})

[comment]: # ({31d29e89-788eee16})
#### Host Wizardとのテンプレート互換性

現在[Host Wizard](/manual/config/hosts/host_wizard)と互換性のある、すぐに利用可能なテンプレートの完全な一覧については、[`hw_compatible_templates.txt`](https://www.zabbix.com/documentation/7.4/assets/en/template_bundles/hw_compatible_templates.txt)を参照してください。

カスタムテンプレートをHost Wizardと互換性を持たせることもできます。

1. ZabbixのWebインターフェースで、*Data collection* > *Templates* に移動し、カスタムテンプレートを[エクスポート](/manual/xml_export_import/templates#exporting)します。

2. エクスポートしたファイルを編集します。

    -   Host Wizardとの互換性を示すために、`wizard_ready` [テンプレート要素](/manual/xml_export_import/templates#templates-1)を追加します。
    -   必要に応じて、`readme` または `config` [テンプレート要素](/manual/xml_export_import/templates#templates-1)を追加します。

3. ZabbixのWebインターフェースで、*Data collection* > *Templates* に移動し、更新したテンプレートファイルを[インポート](/manual/xml_export_import/templates#importing)します。

[comment]: # ({/31d29e89-788eee16})
