add support for configurable pipe handler
diff --git a/README.rst b/README.rst
index 1fd88db..d1d17ee 100644
--- a/README.rst
+++ b/README.rst
@@ -14,7 +14,7 @@
server:
enabled: true
keepalive_warning: 20
- keepalive_critical: 60
+ keepalive_critical: 60
mine_checks: true
database:
engine: redis
@@ -35,6 +35,7 @@
enabled: true
set:
- mail
+ - pipe
stdout:
enabled: true
mail:
@@ -46,6 +47,9 @@
authentication: cram_md5
encryption: ssl
domain: 'domain.cz'
+ pipe:
+ enabled: true
+ command: /usr/bin/tee /tmp/debug
Sensu Dashboard (now uchiwa)
diff --git a/sensu/files/handlers/pipe.json b/sensu/files/handlers/pipe.json
new file mode 100644
index 0000000..f7a3696
--- /dev/null
+++ b/sensu/files/handlers/pipe.json
@@ -0,0 +1,9 @@
+{%- set handler = pillar.sensu.server.handler[handler_name] %}
+{
+ "handlers": {
+ "{{ handler_name }}": {
+ "type": "pipe",
+ "command": "{{ handler.command }}"
+ }
+ }
+}
diff --git a/sensu/server.sls b/sensu/server.sls
index 1dc8d19..a522027 100644
--- a/sensu/server.sls
+++ b/sensu/server.sls
@@ -84,7 +84,7 @@
{%- for handler_name, handler in server.get('handler', {}).iteritems() %}
-{%- if handler_name in ['default', 'flapjack', 'mail', 'sccd', 'stdout', 'statsd', 'slack'] %}
+{%- if handler_name in ['default', 'flapjack', 'mail', 'sccd', 'stdout', 'statsd', 'slack', 'pipe'] %}
{%- include "sensu/server/_handler_"+handler_name+".sls" %}
@@ -148,4 +148,4 @@
- require:
- file: /srv/sensu
-{%- endif %}
\ No newline at end of file
+{%- endif %}
diff --git a/sensu/server/_handler_pipe.sls b/sensu/server/_handler_pipe.sls
new file mode 100644
index 0000000..4c59818
--- /dev/null
+++ b/sensu/server/_handler_pipe.sls
@@ -0,0 +1,11 @@
+
+/etc/sensu/conf.d/handler_pipe.json:
+ file.managed:
+ - source: salt://sensu/files/handlers/pipe.json
+ - template: jinja
+ - defaults:
+ handler_name: "{{ handler_name }}"
+ handler_setting: "handler"
+ - watch_in:
+ - service: service_sensu_server
+ - service: service_sensu_api