xoxys.telegraf/templates/etc/telegraf/telegraf/telegraf.conf.j2

93 lines
3.1 KiB
Django/Jinja

#jinja2: lstrip_blocks: True
{{ ansible_managed | comment }}
[agent]
interval = "{{ telegraf_interval }}"
round_interval = {{ telegraf_round_interval | lower }}
metric_batch_size = {{ telegraf_metric_batch_size }}
metric_buffer_limit = {{ telegraf_metric_buffer_limit }}
collection_jitter = "{{ telegraf_collection_jitter }}"
flush_interval = "{{ telegraf_flush_interval }}"
flush_jitter = "{{ telegraf_flush_jitter }}"
precision = "{{ telegraf_precision | default('') }}"
debug = {{ telegraf_debug | lower }}
quiet = {{ telegraf_quiet | lower }}
logtarget = "{{ telegraf_logtarget }}"
{% if telegraf_logfile is defined %}
logfile = "{{ telegraf_logfile }}"
{% endif %}
{% if telegraf_logfile_rotation_interval | default(False) %}
logfile_rotation_interval = "{{ telegraf_logfile_rotation_interval }}"
{% endif %}
{% if telegraf_logfile_rotation_max_size | default(False) %}
logfile_rotation_max_size = "{{ telegraf_logfile_rotation_max_size }}"
{% endif %}
{% if telegraf_logfile_rotation_max_archives | default(False) %}
logfile_rotation_max_archives = {{ telegraf_logfile_rotation_max_archives }}
{% endif %}
hostname = "{{ telegraf_hostname }}"
omit_hostname = {{ telegraf_omit_hostname | lower }}
{% if telegraf_global_tags | length > 0 %}
[global_tags]
{% for tag in telegraf_global_tags %}
{{ tag.key }} = "{{ tag.value }}"
{% endfor %}
{% endif %}
[[outputs.prometheus_client]]
listen = "{{ telegraf_prometheus_listen }}"
basic_username = "{{ telegraf_prometheus_username }}"
basic_password = "{{ telegraf_prometheus_password }}"
ip_range = []
{% if telegraf_prometheus_tls_enabled | bool %}
tls_cert = "{{ telegraf_prometheus_tls_cert_path }}"
tls_key = "{{ telegraf_prometheus_tls_key_path }}"
{% endif %}
export_timestamp = false
{% if (telegraf_processors + telegraf_processors_extra) | length > 0 %}
{% for item in (telegraf_processors + telegraf_processors_extra) %}
[[processors.{{ item.plugin }}]]
{% if item.config is defined and item.config is iterable %}
{% for item in item.config %}
{{ item }}
{% endfor %}
{% else %}
# no configuration
{% endif %}
{% endfor %}
{% endif %}
{% if (telegraf_aggregators + telegraf_aggregators_extra) | length > 0 %}
{% for item in (telegraf_aggregators + telegraf_aggregators_extra) %}
[[aggregators.{{ item.plugin }}]]
{% if item.period | default(False) %}
period = "{{ item.interval }}s"
{% endif %}
{% if item.config is defined and item.config is iterable %}
{% for item in item.config %}
{{ item }}
{% endfor %}
{% else %}
# no configuration
{% endif %}
{% endfor %}
{% endif %}
{% if (telegraf_plugins + telegraf_plugins_extra) | length > 0 %}
{% for item in (telegraf_plugins + telegraf_plugins_extra) %}
[[inputs.{{ item.plugin }}]]
{% if item.interval | default(False) %}
interval = "{{ item.interval }}s"
{% endif %}
{% if item.config is defined and item.config is iterable %}
{% for item in item.config %}
{{ item }}
{% endfor %}
{% else %}
# no configuration
{% endif %}
{% endfor %}
{% endif %}