Add collectd support
diff --git a/memcached/files/collectd_memcached.conf b/memcached/files/collectd_memcached.conf
new file mode 100644
index 0000000..c3fae35
--- /dev/null
+++ b/memcached/files/collectd_memcached.conf
@@ -0,0 +1,8 @@
+<LoadPlugin memcached>
+ Globals false
+</LoadPlugin>
+
+<Plugin memcached>
+ Host "{{ plugin.host }}"
+ Port {{ plugin.port }}
+</Plugin>
diff --git a/memcached/files/collectd_memcached_check.conf b/memcached/files/collectd_memcached_check.conf
new file mode 100644
index 0000000..12c5263
--- /dev/null
+++ b/memcached/files/collectd_memcached_check.conf
@@ -0,0 +1,6 @@
+Import "collectd_memcached_check"
+
+<Module "collectd_memcached_check">
+ Host "{{ plugin.host }}"
+ Port {{ plugin.port }}
+</Module>
diff --git a/memcached/map.jinja b/memcached/map.jinja
index ddd7da0..7d8a2ad 100644
--- a/memcached/map.jinja
+++ b/memcached/map.jinja
@@ -1,6 +1,6 @@
{% set server = salt['grains.filter_by']({
'Debian': {
- 'pkgs': ['memcached', 'python-memcache'],
+ 'pkgs': ['memcached', 'python-memcache', 'python-pymemcache'],
'service': 'memcached',
'config': '/etc/memcached.conf',
'config_template': 'salt://memcached/files/memcached.conf',
diff --git a/memcached/meta/collectd.yml b/memcached/meta/collectd.yml
new file mode 100644
index 0000000..27078ad
--- /dev/null
+++ b/memcached/meta/collectd.yml
@@ -0,0 +1,13 @@
+{%- from "memcached/map.jinja" import server with context %}
+{%- if server.enabled %}
+local_plugin:
+ memcached:
+ template: memcached/files/collectd_memcached.conf
+ host: {{ server.bind.address }}
+ port: {{ server.bind.port }}
+ memcached_check:
+ plugin: python
+ template: memcached/files/collectd_memcached_check.conf
+ host: {{ server.bind.address }}
+ port: {{ server.bind.port }}
+{%- endif %}
diff --git a/metadata/service/server/local.yml b/metadata/service/server/local.yml
index 48513a9..431d796 100644
--- a/metadata/service/server/local.yml
+++ b/metadata/service/server/local.yml
@@ -1,5 +1,7 @@
applications:
- memcached
+classes:
+- service.memcached.support
parameters:
memcached:
server:
diff --git a/metadata/service/server/single.yml b/metadata/service/server/single.yml
index 009827a..a44f901 100644
--- a/metadata/service/server/single.yml
+++ b/metadata/service/server/single.yml
@@ -1,5 +1,7 @@
applications:
- memcached
+classes:
+- service.memcached.support
parameters:
memcached:
server:
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
new file mode 100644
index 0000000..7cc29a8
--- /dev/null
+++ b/metadata/service/support.yml
@@ -0,0 +1,12 @@
+parameters:
+ memcached:
+ _support:
+ collectd:
+ enabled: true
+ heka:
+ enabled: false
+ sensu:
+ enabled: false
+ sphinx:
+ enabled: false
+