telegraf: Add parameter to enable ZFS stats

Previous templates used the assumptioon, that FreeBSD will always have
ZFS and nothing else.
This commit is contained in:
Jannik Beyerstedt 2022-12-04 15:17:43 +01:00
parent f3ffdfc133
commit 002c19f3ad
3 changed files with 3 additions and 1 deletions

View file

@ -70,6 +70,7 @@ Telegraf is configured with basic host telemetry by default. You can add more fe
- `telegraf_docker_file`: filename of the docker telegraf config part in `{{role_path}}/templates` (default `telegraf-docker.conf`).
- `telegraf_unifi_file`: filename of the SNMP telegraf config part in `{{role_path}}/templates` (default `telegraf-UniFi.conf.j2`).
- `telegraf_airmax_file`: filename of the SNMP telegraf config part in `{{role_path}}/templates` (default `telegraf-AirMAX.conf.j2`).
- `telegraf_enable_zfs`: gather ZFS stats (default `false`).
Optional settings:
- `telegraf_interval`: Data sampling interval (default `300s`)

View file

@ -9,6 +9,7 @@ telegraf_interval: "300s"
telegraf_docker_file: "telegraf-docker.conf"
telegraf_unifi_file: "telegraf-UniFi.conf.j2"
telegraf_airmax_file: "telegraf-AirMAX.conf.j2"
telegraf_enable_zfs: false
exim_etc_mailname: "{{ inventory_hostname }}"
exim_skip_install: false

View file

@ -84,7 +84,7 @@
name_override = "cpu_temp"
{% endif %}
{% if ((override_os_family is defined) | ternary(override_os_family,ansible_os_family)) == 'FreeBSD' %}
{% if telegraf_enable_zfs %}
# Read metrics of ZFS from arcstats, zfetchstats, vdev_cache_stats, and pools
[[inputs.zfs]]
## By default, telegraf gather all zfs stats