Merge pull request #9 from elemoine/stacklight-heka

Add memcached_check alarm and alarm cluster
diff --git a/memcached/meta/collectd.yml b/memcached/meta/collectd.yml
index 27078ad..654eb6c 100644
--- a/memcached/meta/collectd.yml
+++ b/memcached/meta/collectd.yml
@@ -1,5 +1,5 @@
 {%- from "memcached/map.jinja" import server with context %}
-{%- if server.enabled %}
+{%- if server.get('enabled', False) %}
 local_plugin:
   memcached:
     template: memcached/files/collectd_memcached.conf
diff --git a/memcached/meta/heka.yml b/memcached/meta/heka.yml
new file mode 100644
index 0000000..951d7df
--- /dev/null
+++ b/memcached/meta/heka.yml
@@ -0,0 +1,33 @@
+{%- from "memcached/map.jinja" import server with context %}
+{%- if server.get('enabled', False) %}
+metric_collector:
+  trigger:
+    memcached_check:
+      description: 'memcached cannot be checked'
+      severity: down
+      rules:
+      - metric: memcached_check
+        relational_operator: '=='
+        threshold: 0
+        window: 60
+        periods: 0
+        function: last
+  alarm:
+    memcached_check:
+      alerting: enabled
+      triggers:
+      - memcached_check
+      dimension:
+        service: memcached
+aggregator:
+  alarm_cluster:
+    memcached_check:
+      policy: majority_of_members
+      match:
+        service: memcached
+      group_by: hostname
+      members:
+      - memcached_check
+      dimension:
+        cluster_name: memcached
+{%- endif %}
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
index 2900f86..1d29c3c 100644
--- a/metadata/service/support.yml
+++ b/metadata/service/support.yml
@@ -4,7 +4,7 @@
       collectd:
         enabled: true
       heka:
-        enabled: false
+        enabled: true
       sensu:
         enabled: false
       sphinx: