From 72dbef13ddda7b49aa409148344624f78a3f486b Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Wed, 25 Oct 2017 00:08:41 +0200 Subject: [PATCH] Telegraf should only output to influxdb when influxdb is enabled Change-Id: Ib0512481aebf56b26f93955e682ea0cb80cb5bc4 --- ansible/roles/telegraf/templates/telegraf.conf.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/roles/telegraf/templates/telegraf.conf.j2 b/ansible/roles/telegraf/templates/telegraf.conf.j2 index 667c79271b..4faf10eef6 100644 --- a/ansible/roles/telegraf/templates/telegraf.conf.j2 +++ b/ansible/roles/telegraf/templates/telegraf.conf.j2 @@ -11,12 +11,14 @@ quiet = false hostname = "" omit_hostname = false +{% if enable_influxdb | bool %} [[outputs.influxdb]] urls = [{% for host in groups['influxdb'] %}"{{ influxdb_proto }}://{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address']}}:{{ influxdb_http_port }}"{% if not loop.last %},{% endif %}{% endfor %}] database = "telegraf" # required retention_policy = "autogen" write_consistency = "any" timeout = "5s" +{% endif %} [[inputs.cpu]] percpu = true totalcpu = true