add support for new check (#2)
* add support for new check
* use grains.fqdn and localhost
* use server.bind.port intead of default
* local check
* change subscriber to fqdn
diff --git a/metadata/service/server/cluster.yml b/metadata/service/server/cluster.yml
index 8ceb95b..5ecaaec 100644
--- a/metadata/service/server/cluster.yml
+++ b/metadata/service/server/cluster.yml
@@ -1,5 +1,7 @@
applications:
- mongodb
+classes:
+- service.mongodb.support
parameters:
_param:
mongodb_server_replica_set: default
diff --git a/metadata/service/server/single.yml b/metadata/service/server/single.yml
index 4a9b916..1208309 100644
--- a/metadata/service/server/single.yml
+++ b/metadata/service/server/single.yml
@@ -1,5 +1,7 @@
applications:
- mongodb
+classes:
+- service.mongodb.support
parameters:
mongodb:
server:
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
new file mode 100644
index 0000000..36be45d
--- /dev/null
+++ b/metadata/service/support.yml
@@ -0,0 +1,11 @@
+parameters:
+ mongodb:
+ _support:
+ collectd:
+ enabled: false
+ heka:
+ enabled: false
+ sensu:
+ enabled: true
+ sphinx:
+ enabled: false
\ No newline at end of file
diff --git a/mongodb/meta/sensu.yml b/mongodb/meta/sensu.yml
new file mode 100644
index 0000000..baa9de1
--- /dev/null
+++ b/mongodb/meta/sensu.yml
@@ -0,0 +1,9 @@
+{%- from "mongodb/map.jinja" import server with context -%}
+{%- if server.bind.address == '0.0.0.0' %}{%- set address = '127.0.0.1' %}{% else %}{%- set address = server.bind.address %}{% endif %}
+check:
+ local_mongodb_mdb_{{ grains.fqdn }}:
+ command: "PATH=$PATH:/etc/sensu/plugins check_mongodb.py -H {{ address }} -A connect -P {{ server.bind.port }}"
+ interval: 60
+ occurrences: 1
+ subscribers:
+ - {{ grains['fqdn']|replace('.', '-') }}