paulbsd-salt/states/telegraf/telegraf.conf.j2
2020-07-10 00:58:55 +02:00

30 lines
1.0 KiB
Django/Jinja

## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
{%- from "telegraf/map.jinja" import telegraf with context %}
[global_tags]
[agent]
interval = "1m"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
hostname = ""
omit_hostname = false
[[outputs.influxdb]]
urls = [{{ telegraf.influxdb_urls|join(",") }}]
username = "{{ telegraf.influxdb_username }}"
password = "{{ telegraf.influxdb_password }}"
database = "{{ telegraf.influxdb_database }}"
{% for name, value in telegraf.config.inputs.items() %}
[[inputs.{{ name }}]]
{%- if value['params'] is defined %}
{%- for paramname, paramvalue in value['params'].items() %}
{{ paramname }} = {% if paramvalue is sameas True or paramvalue is sameas False %}{{ paramvalue|string|lower }}{% elif paramvalue is iterable and paramvalue is not string %}[{{ paramvalue|join(",") }}]{% else %}"{{ paramvalue }}"{% endif %}
{%- endfor %}
{%- endif %}
{% endfor %}