Merge pull request #7 from tcpcloud/collectd_update

Global collectd update
diff --git a/nginx/files/collectd.conf b/nginx/files/collectd.conf
deleted file mode 100644
index e69de29..0000000
--- a/nginx/files/collectd.conf
+++ /dev/null
diff --git a/nginx/files/collectd_nginx.conf b/nginx/files/collectd_nginx.conf
new file mode 100644
index 0000000..2a98127
--- /dev/null
+++ b/nginx/files/collectd_nginx.conf
@@ -0,0 +1,13 @@
+{%- from "nginx/map.jinja" import server with context %}
+
+<LoadPlugin nginx>
+  Globals false
+</LoadPlugin>
+
+{%- if server.site.nginx_stats_server is defined %}
+
+<Plugin nginx>
+  URL "http://localhost:{{ server.site.nginx_stats_server.host.port }}"
+</Plugin>
+
+{%- endif %}
diff --git a/nginx/files/sensu.conf b/nginx/files/sensu.conf
deleted file mode 100644
index 4a128ee..0000000
--- a/nginx/files/sensu.conf
+++ /dev/null
@@ -1,25 +0,0 @@
-{%- 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 {{ server.system_user }} -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 %}
diff --git a/nginx/meta/collectd.yml b/nginx/meta/collectd.yml
index 74051bb..c859306 100644
--- a/nginx/meta/collectd.yml
+++ b/nginx/meta/collectd.yml
@@ -1,7 +1,6 @@
 
 plugin:
-  collectd_nginx:
+  nginx_server_status:
     plugin: nginx
-    interval: 60
-    template: collectd/files/collectd_nginx.conf
-
+    execution: local
+    template: nginx/files/collectd_nginx.conf