Modify the configuration file of telegraf

Influxdb is  standalone deployed by kolla-ansible,
The cluster mode is  charged now.
Previously configured, each telegraf monitors all influxdb.
If the telegraf is more, It is a disaster to influxdb.
So, telegraf should monitor influxdb deployed on the same server.

Change-Id: I9f4003a55de2a7be53c644b1d2f89d00cdf9478a
This commit is contained in:
pangliye 2017-05-17 03:59:16 -04:00
parent b595f236d0
commit 2a8cb0b781

View File

@ -24,8 +24,10 @@
[[inputs.disk]]
ignore_fs = ["tmpfs", "devtmpfs"]
[[inputs.diskio]]
{% if inventory_hostname in groups['influxdb'] and enable_influxdb | bool %}
[[inputs.influxdb]]
urls = [{% for host in groups['influxdb'] %}"{{ influxdb_proto }}://{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address']}}:{{ influxdb_http_port }}/debug/vars"{% if not loop.last %},{% endif %}{% endfor %}]
urls = ["{{ influxdb_proto }}://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ influxdb_http_port }}/debug/vars"]
{% endif %}
[[inputs.kernel]]
[[inputs.mem]]
[[inputs.processes]]