Allow disabling auto-generated checks
diff --git a/README.rst b/README.rst
index 475c1db..56bd0bb 100644
--- a/README.rst
+++ b/README.rst
@@ -80,6 +80,24 @@
password: pwd
virtual_host: '/monitor'
+Sensu Client with check explicitly disabled
+
+.. code-block:: yaml
+
+ sensu:
+ client:
+ enabled: true
+ message_queue:
+ engine: rabbitmq
+ host: rabbitmq
+ port: 5672
+ user: monitor
+ password: pwd
+ virtual_host: '/monitor'
+ check:
+ local_linux_storage_swap_usage:
+ enabled: False
+
Sensu Client with community plugins
.. code-block:: yaml
diff --git a/sensu/client.sls b/sensu/client.sls
index d102995..67d57ae 100644
--- a/sensu/client.sls
+++ b/sensu/client.sls
@@ -76,7 +76,12 @@
{%- set grains_fragment_file = service_name+'/meta/sensu.yml' %}
{%- macro load_grains_file() %}{% include grains_fragment_file %}{% endmacro %}
{%- set grains_yaml = load_grains_file()|load_yaml %}
-{%- set _dummy = service_grains.sensu.check.update(grains_yaml.check) %}
+{%- for check_name, check in client.get('check', {}).items() %}
+ {%- if check_name in grains_yaml.check and not check.get('enabled', True) %}
+ {%- do grains_yaml.check.pop(check_name) %}
+ {%- endif %}
+{%- endfor %}
+{%- do service_grains.sensu.check.update(grains_yaml.check) %}
{%- endif %}
{%- endfor %}