1 {%- if pillar.elasticsearch.server is defined or pillar.elasticsearch.client is defined %}
2 {%- from "elasticsearch/map.jinja" import server, client with context %}
4 {%- if server.get('enabled', False) %}
5 {%- set bind = server.get('bind', {}) %}
6 {# The local agent gathers the node's metrics + cluster stats if the node is master #}
10 template: elasticsearch/files/telegraf.conf
12 - "http://{{ bind.address|default('127.0.0.1') }}:{{ bind.port|default(9200) }}"
18 {%- if client.get('enabled', False) %}
19 {# The remote agent gathers only the cluster health metrics #}
23 template: elasticsearch/files/telegraf.conf
25 - "http://{{ client.server.host }}:{{ client.server.get('port', 9200) }}"
29 namepass: [ 'elasticsearch_cluster_health*' ]