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 - "/usr/local/bin/elasticsearch_check_read_only.sh"
24 {%- if client.get('enabled', False) %}
25 {# The remote agent gathers only the cluster health metrics #}
29 template: elasticsearch/files/telegraf.conf
31 - "http://{{ client.server.host }}:{{ client.server.get('port', 9200) }}"
35 namepass: [ 'elasticsearch_cluster_health*' ]