Merge "Clean telegraf conf.d directory"
diff --git a/metadata/service/agent/input/http_listener.yml b/metadata/service/agent/input/http_listener.yml
new file mode 100644
index 0000000..a5ff0c6
--- /dev/null
+++ b/metadata/service/agent/input/http_listener.yml
@@ -0,0 +1,11 @@
+parameters:
+ telegraf:
+ agent:
+ input:
+ http_listener:
+ bind:
+ address: 127.0.0.1
+ port: 8186
+ read_timeout: 10s
+ write_timeout: 10s
+ tagexclude: ['hostname']
diff --git a/metadata/service/agent/remote.yml b/metadata/service/agent/remote/init.yml
similarity index 100%
rename from metadata/service/agent/remote.yml
rename to metadata/service/agent/remote/init.yml
diff --git a/metadata/service/agent/remote/input/http_listener.yml b/metadata/service/agent/remote/input/http_listener.yml
new file mode 100644
index 0000000..5413c4f
--- /dev/null
+++ b/metadata/service/agent/remote/input/http_listener.yml
@@ -0,0 +1,11 @@
+parameters:
+ telegraf:
+ remote_agent:
+ input:
+ http_listener:
+ bind:
+ address: 0.0.0.0
+ port: 8186
+ read_timeout: 10s
+ write_timeout: 10s
+ tagexclude: ['hostname']
diff --git a/metadata/service/agent/remote/output/prometheus.yml b/metadata/service/agent/remote/output/prometheus.yml
new file mode 100644
index 0000000..2c242f4
--- /dev/null
+++ b/metadata/service/agent/remote/output/prometheus.yml
@@ -0,0 +1,9 @@
+parameters:
+ telegraf:
+ remote_agent:
+ output:
+ prometheus_client:
+ bind:
+ address: 0.0.0.0
+ port: 9126
+ engine: prometheus
diff --git a/telegraf/files/input/http_listener.conf b/telegraf/files/input/http_listener.conf
new file mode 100644
index 0000000..41f106b
--- /dev/null
+++ b/telegraf/files/input/http_listener.conf
@@ -0,0 +1,6 @@
+[[inputs.http_listener]]
+ service_address = "{{ values.get('bind', {}).address|default('127.0.0.1') }}:{{ values.get('bind', {}).port|default('8186') }}"
+ read_timeout = "{{ values.get('read_timeout', '10s') }}"
+ write_timeout = "{{ values.get('write_timeout', '10s') }}"
+
+{%- include 'telegraf/files/input/_tags.conf' %}
diff --git a/telegraf/files/input/memcached.conf b/telegraf/files/input/memcached.conf
new file mode 100644
index 0000000..b4cd5e3
--- /dev/null
+++ b/telegraf/files/input/memcached.conf
@@ -0,0 +1,3 @@
+[[inputs.memcached]]
+ servers = [{%- for server in values.servers|default([]) %}"{{ server.address }}:{{ server.port }}"{%- if not loop.last%}, {% endif %} {%- endfor %}]
+{%- include 'telegraf/files/input/_tags.conf' %}
diff --git a/telegraf/remote_agent.sls b/telegraf/remote_agent.sls
index 41e357b..d79ffb3 100644
--- a/telegraf/remote_agent.sls
+++ b/telegraf/remote_agent.sls
@@ -31,7 +31,7 @@
- context:
agent: {{ remote_agent }}
-{%- set remote_agent_inputs = {'input': {}} %}
+{%- set remote_agent_inputs = {'input': remote_agent.input} %}
{%- for node_name, node_grains in salt['mine.get']('*', 'grains.items').iteritems() %}
{%- set remote_agent_input = node_grains.get('telegraf', {}).get('remote_agent', {}).get('input', {}) %}
{%- if remote_agent_input %}