Moved support scripts around
diff --git a/metadata/service/server/single.yml b/metadata/service/server/single.yml
index e91d562..ec5135a 100644
--- a/metadata/service/server/single.yml
+++ b/metadata/service/server/single.yml
@@ -1,5 +1,7 @@
applications:
- nginx
+classes:
+- service.nginx.support
parameters:
nginx:
server:
@@ -8,6 +10,3 @@
bind:
address: 0.0.0.0
protocol: tcp
- logging:
- heka:
- enabled: true
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
new file mode 100644
index 0000000..1c1c808
--- /dev/null
+++ b/metadata/service/support.yml
@@ -0,0 +1,11 @@
+parameters:
+ nginx:
+ _support:
+ collectd:
+ enabled: false
+ heka:
+ enabled: false
+ sensu:
+ enabled: true
+ sphinx:
+ enabled: true
diff --git a/nginx/meta/collectd.yml b/nginx/meta/collectd.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/nginx/meta/collectd.yml
diff --git a/nginx/meta/heka.yml b/nginx/meta/heka.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/nginx/meta/heka.yml
diff --git a/nginx/meta/sensu.yml b/nginx/meta/sensu.yml
new file mode 100644
index 0000000..d9417c3
--- /dev/null
+++ b/nginx/meta/sensu.yml
@@ -0,0 +1,25 @@
+{%- from "nginx/map.jinja" import server with context -%}
+local_nginx_server_proc:
+ command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -C nginx -u root -c 1:1"
+ interval: 60
+ occurrences: 1
+ subscribers:
+ - local-nginx-server
+local_nginx_server_worker_procs:
+ command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -C nginx -u www-data -c 1:20"
+ interval: 60
+ occurrences: 1
+ subscribers:
+ - local-nginx-server
+{%- for site_name, site in server.get('site', {}).iteritems() %}
+{%- if site.enabled %}
+{%- if site.get('check', True) %}
+remote_nginx_server_http_{{ site.host.name }}_{{ site.host.get('port', '80') }}:
+ command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_http -H {{ site.host.name }} -p {{ site.host.get('port', '80') }} -w 5 -c 10 -f follow{% if site.get('ssl', {}).get('enabled', False) %} -S{% endif %}"
+ interval: 60
+ occurrences: 2
+ subscribers:
+ - remote-network
+{%- endif %}
+{%- endif %}
+{%- endfor %}
\ No newline at end of file
diff --git a/nginx/meta/sphinx.yml b/nginx/meta/sphinx.yml
new file mode 100644
index 0000000..8ad04bb
--- /dev/null
+++ b/nginx/meta/sphinx.yml
@@ -0,0 +1,20 @@
+{%- from "nginx/map.jinja" import server with context -%}
+name: Nginx
+description: Nginx is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer, HTTP cache, and a web server (origin server). The nginx project started with a strong focus on high concurrency, high performance and low memory usage.
+role:
+ system:
+ name: Server
+ param:
+ bind_host:
+ name: Bind host
+ value: {{ server.bind.address }}
+ endpoint:
+{%- for site_name, site in server.get('site', {}).iteritems() %}
+{%- if site.enabled %}
+ {{ site_name }}_{{ site.type }}:
+ name: {{ site_name }}
+ type: {{ site.type }}
+ address: http{% if site.get('ssl', {}).get('enabled', False) %}s{% endif %}://{{ site.host.name }}:{{ site.host.get('port', '80') }}/
+ protocol: http{% if site.get('ssl', {}).get('enabled', False) %}s{% endif %}
+{%- endif %}
+{%- endfor %}
\ No newline at end of file