mirror of
https://github.com/dj-wasabi/ansible-telegraf.git
synced 2025-07-17 08:46:37 +00:00
Initial version
This commit is contained in:
52
templates/etc-opt-telegraf-telegraf.conf.j2
Normal file
52
templates/etc-opt-telegraf-telegraf.conf.j2
Normal file
@ -0,0 +1,52 @@
|
||||
# Telegraf configuration
|
||||
|
||||
[tags]
|
||||
{% if telegraf_agent_tags is defined and telegraf_agent_tags is iterable %}
|
||||
{% for item in telegraf_agent_tags %}
|
||||
{{ item.tag_name }} = "{{ item.tag_value }}"
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
# Configuration for telegraf itself
|
||||
[agent]
|
||||
interval = "{{ telegraf_agent_interval }}s"
|
||||
debug = {{ telegraf_agent_debug | lower }}
|
||||
hostname = "{{ ansible_fqdn }}"
|
||||
utc = {{ telegraf_agent_utc | lower }}
|
||||
precision = "{{ telegraf_agent_precision }}"
|
||||
|
||||
# Configuration for influxdb server to send metrics to
|
||||
[outputs]
|
||||
{% if telegraf_agent_output is defined and telegraf_agent_output is iterable %}
|
||||
{% for item in telegraf_agent_output %}
|
||||
[outputs.{{ item.type }}]
|
||||
{% for items in item.config %}
|
||||
{{ items }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
# PLUGINS
|
||||
{% if telegraf_plugins_default is defined and telegraf_plugins_default is iterable %}
|
||||
{% for item in telegraf_plugins_default %}
|
||||
[{{ item.plugin }}]
|
||||
{% if item.config is defined and item.config is iterable %}
|
||||
{% for items in item.config %}
|
||||
{{ items }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if telegraf_plugins_extra is defined and telegraf_plugins_extra is iterable %}
|
||||
{% for item in telegraf_plugins_extra %}
|
||||
[{{ item.plugin }}]
|
||||
{% if item.config is defined and item.config is iterable %}
|
||||
{% for items in item.config %}
|
||||
{{ items }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
Reference in New Issue
Block a user