paulbsd-salt/states/telegraf/telegraf.conf.j2

33 lines
1.3 KiB
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
## {{ 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 = ""
2020-10-25 16:37:55 +01:00
hostname = "{{ salt['grains.get']('fqdn') }}"
2020-07-10 00:58:55 +02:00
omit_hostname = false
2021-08-18 07:10:35 +02:00
{% for name, value in telegraf.config.outputs.items() -%}
[[outputs.{{ name }}]]
{% if value is not none -%}
{% for paramname, paramvalue in value.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 %}
2020-07-10 00:58:55 +02:00
2021-08-18 07:10:35 +02:00
{% for name, value in telegraf.config.inputs.items() -%}
2020-07-10 00:58:55 +02:00
[[inputs.{{ name }}]]
2021-08-18 07:10:35 +02:00
{% if value is not none -%}
{% for paramname, paramvalue in value.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 %}
2020-10-25 16:37:55 +01:00
{% endfor %}
2021-08-18 07:10:35 +02:00
{%- endif %}
{% endfor -%}