Improve heka check

This patch adds a check on process, not only on arguments and it also
avoids to add data in grains when it is not needed.

Change-Id: If1da2e601a47ac63f8b2645b2857b4072a43013f
diff --git a/heka/meta/sensu.yml b/heka/meta/sensu.yml
index 2aeae8b..1e946af 100644
--- a/heka/meta/sensu.yml
+++ b/heka/meta/sensu.yml
@@ -1,25 +1,33 @@
 check:
+{%- if pillar.heka.get('log_collector', {}).get('enabled', False) %}
   local_heka_log_collector_proc:
-    command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -a log_collector -u heka -c 1:1"
+    command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -C hekad -a log_collector -u heka -c 1:1"
     interval: 60
     occurences: 1
     subscribers:
     - local-heka-log_collector
+{%- endif %}
+{%- if pillar.heka.get('metric_collector', {}).get('enabled', False) %}
   local_heka_metric_collector_proc:
-    command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -a metric_collector -u heka -c 1:1"
+    command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -C hekad -a metric_collector -u heka -c 1:1"
     interval: 60
     occurences: 1
     subscribers:
     - local-heka-metric_collector
+{%- endif %}
+{%- if pillar.heka.get('remote_collector', {}).get('enabled', False) %}
   local_heka_remote_collector_proc:
-    command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -a remote_collector -u heka -c 0:1"
+    command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -C hekad -a remote_collector -u heka -c 0:1"
     interval: 60
     occurences: 1
     subscribers:
     - local-heka-remote_collector
+{%- endif %}
+{%- if pillar.heka.get('aggregator', {}).get('enabled', False) %}
   local_heka_aggregator_proc:
-    command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -a aggregator -u heka -c 0:1"
+    command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -C hekad -a aggregator -u heka -c 0:1"
     interval: 60
     occurences: 1
     subscribers:
     - local-heka-aggregator
+{%- endif %}