Merge pull request #5 from simonpasquier/add-collectd-support
Add collectd support
diff --git a/influxdb/files/collectd_influxdb.conf b/influxdb/files/collectd_influxdb.conf
new file mode 100644
index 0000000..c909863
--- /dev/null
+++ b/influxdb/files/collectd_influxdb.conf
@@ -0,0 +1,8 @@
+Import "influxdb"
+
+<Module "influxdb">
+ Address "{{ plugin.address }}"
+ Port "{{ plugin.port }}"
+ Username "{{ plugin.username }}"
+ Password "{{ plugin.password }}"
+</Module>
diff --git a/influxdb/meta/collectd.yml b/influxdb/meta/collectd.yml
new file mode 100644
index 0000000..c09ea48
--- /dev/null
+++ b/influxdb/meta/collectd.yml
@@ -0,0 +1,17 @@
+{%- if pillar.influxdb.server is defined %}
+{%- from "influxdb/map.jinja" import server with context %}
+
+{%- if server.admin.get('user', {}).get('enabled', False) and server.http.enabled %}
+local_plugin:
+ influxdb:
+ plugin: python
+ template: influxdb/files/collectd_influxdb.conf
+ address: {{ server.http.bind.address|replace('0.0.0.0', '127.0.0.1') }}
+ port: {{ server.http.bind.port }}
+ username: {{ server.admin.user.name }}
+ password: {{ server.admin.user.password }}
+ collectd_processes:
+ process:
+ influxd: {}
+{%- endif %}
+{%- endif %}
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
index 9b52193..2594e43 100644
--- a/metadata/service/support.yml
+++ b/metadata/service/support.yml
@@ -2,7 +2,7 @@
influxdb:
_support:
collectd:
- enabled: false
+ enabled: true
heka:
enabled: false
sensu: