Merge "Update metadata.yml with correct URL"
diff --git a/glusterfs/files/telegraf.conf b/glusterfs/files/telegraf.conf
index 917fd00..2a491b8 100644
--- a/glusterfs/files/telegraf.conf
+++ b/glusterfs/files/telegraf.conf
@@ -1,5 +1,5 @@
[[inputs.glusterfs]]
interval = "{{ values.interval|default('1m') }}"
use_sudo = {{ values.use_sudo|lower }}
+ remote_host = "{{ values.remote_host|default('127.0.0.1') }}"
{%- include 'telegraf/files/input/_tags.conf' %}
-
diff --git a/glusterfs/map.jinja b/glusterfs/map.jinja
index 3771e54..928ff1d 100644
--- a/glusterfs/map.jinja
+++ b/glusterfs/map.jinja
@@ -28,5 +28,7 @@
}, merge=salt['pillar.get']('glusterfs:client')) %}
{% set monitoring = salt['grains.filter_by']({
- 'default': {}
+ 'default': {
+ 'glusterfs_service_host': '127.0.0.1'
+ }
}, merge=salt['pillar.get']('glusterfs:monitoring')) %}
diff --git a/glusterfs/meta/telegraf.yml b/glusterfs/meta/telegraf.yml
index fab100d..c63de92 100644
--- a/glusterfs/meta/telegraf.yml
+++ b/glusterfs/meta/telegraf.yml
@@ -1,11 +1,12 @@
{%- if pillar.glusterfs.server is defined %}
{% from "glusterfs/map.jinja" import server, monitoring with context %}
{%- if server.get('enabled', False) %}
-agent:
+remote_agent:
input:
glusterfs:
template: glusterfs/files/telegraf.conf
interval: 60s
use_sudo: true
+ remote_host: {{ monitoring.glusterfs_service_host }}
{%- endif %}
{%- endif %}