X-Git-Url: https://gerrit.mcp.mirantis.com/gitweb?p=salt-formulas%2Felasticsearch.git;a=blobdiff_plain;f=elasticsearch%2Fmeta%2Fcollectd.yml;h=c37f251f2286fee519292710c06d96df2ff69373;hp=9da665f2ae1f22d3a1e147538268dc417f9134c9;hb=c570739e782951a549f76f0d89cd1c3198a608f6;hpb=30c6becac6eae19ee467f6bfa7c72c153dd0a667 diff --git a/elasticsearch/meta/collectd.yml b/elasticsearch/meta/collectd.yml index 9da665f..c37f251 100644 --- a/elasticsearch/meta/collectd.yml +++ b/elasticsearch/meta/collectd.yml @@ -1,16 +1,25 @@ -{%- if pillar.elasticsearch.server is defined %} +{%- if pillar.elasticsearch.server is defined or pillar.elasticsearch.client is defined %} {%- from "elasticsearch/map.jinja" import server with context %} +{%- from "elasticsearch/map.jinja" import client with context %} {%- if server.get('enabled', False) %} local_plugin: - elasticsearch_cluster: + elasticsearch_node: plugin: python - template: elasticsearch/files/collectd_elasticsearch_cluster.conf - address: {{ server.get('bind', {}).get('address', '127.0.0.1') }} + template: elasticsearch/files/collectd_elasticsearch_node.conf + address: {{ server.get('bind', {}).get('address', '127.0.0.1')|replace('0.0.0.0', '127.0.0.1') }} port: {{ server.get('bind', {}).get('port', 9200) }} collectd_processes: process: elasticsearch: match: 'java.*elasticsearch' {%- endif %} +{%- if client.get('enabled', False) %} +remote_plugin: + elasticsearch_cluster: + plugin: python + template: elasticsearch/files/collectd_elasticsearch_cluster.conf + address: {{ client.server.host }} + port: {{ client.server.get('port', 9200) }} +{%- endif %} {%- endif %}