Merge pull request #18 from elemoine/revert
Revert "Stacklight (#17)"
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
index d9b8ab1..54d08d7 100644
--- a/metadata/service/support.yml
+++ b/metadata/service/support.yml
@@ -9,5 +9,3 @@
enabled: true
sphinx:
enabled: true
- grafana:
- enabled: true
diff --git a/nginx/files/collectd_nginx.conf b/nginx/files/collectd_nginx.conf
index 2c55706..2a98127 100644
--- a/nginx/files/collectd_nginx.conf
+++ b/nginx/files/collectd_nginx.conf
@@ -1,7 +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 "{{ plugin.url }}"
+ URL "http://localhost:{{ server.site.nginx_stats_server.host.port }}"
</Plugin>
+
+{%- endif %}
diff --git a/nginx/files/collectd_nginx_check.conf b/nginx/files/collectd_nginx_check.conf
deleted file mode 100644
index 325c5e4..0000000
--- a/nginx/files/collectd_nginx_check.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-Import "collectd_nginx_check"
-
-<Module "collectd_nginx_check">
- Url "{{ plugin.url }}"
-</Module>
-
diff --git a/nginx/files/grafana_influxdb.json b/nginx/files/grafana_influxdb.json
deleted file mode 100644
index 62c4781..0000000
--- a/nginx/files/grafana_influxdb.json
+++ /dev/null
@@ -1,158 +0,0 @@
-{
- "cacheTimeout": null,
- "colorBackground": true,
- "colorValue": false,
- "colors": [
- "rgba(71, 212, 59, 0.4)",
- "rgba(241, 181, 37, 0.73)",
- "rgba(225, 40, 40, 0.59)"
- ],
- "datasource": null,
- "editable": true,
- "error": false,
- "format": "none",
- "gauge": {
- "maxValue": 100,
- "minValue": 0,
- "show": false,
- "thresholdLabels": false,
- "thresholdMarkers": true
- },
- "id": null,
- "interval": "> 60s",
- "links": [],
- "mappingType": 1,
- "mappingTypes": [
- {
- "name": "value to text",
- "value": 1
- },
- {
- "name": "range to text",
- "value": 2
- }
- ],
- "maxDataPoints": 100,
- "nullPointMode": "connected",
- "nullText": null,
- "postfix": "",
- "postfixFontSize": "50%",
- "prefix": "",
- "prefixFontSize": "50%",
- "rangeMaps": [
- {
- "from": "null",
- "text": "N/A",
- "to": "null"
- }
- ],
- "refresh": "1m",
- "sharedCrosshair": true,
- "span": 3,
- "sparkline": {
- "fillColor": "rgba(31, 118, 189, 0.18)",
- "full": false,
- "lineColor": "rgb(31, 120, 193)",
- "show": false
- },
- "targets": [
- {
- "column": "value",
- "condition": "",
- "dsType": "influxdb",
- "fill": "",
- "function": "last",
- "groupBy": [
- {
- "params": [
- "$interval"
- ],
- "type": "time"
- },
- {
- "params": [
- "null"
- ],
- "type": "fill"
- }
- ],
- "groupByTags": [],
- "groupby_field": "",
- "interval": "",
- "measurement": "cluster_status",
- "policy": "default",
- "query": "SELECT last(\"value\") FROM \"cluster_status\" WHERE \"environment_label\" =~ /^$environment$/ AND \"cluster_name\" = 'memcached' AND $timeFilter GROUP BY time($interval) fill(null)",
- "rawQuery": false,
- "refId": "A",
- "resultFormat": "time_series",
- "select": [
- [
- {
- "params": [
- "value"
- ],
- "type": "field"
- },
- {
- "params": [],
- "type": "last"
- }
- ]
- ],
- "tags": [
- {
- "key": "environment_label",
- "operator": "=",
- "value": "$environment"
- },
- {
- "key": "cluster_name",
- "operator": "=",
- "value": "memcached"
- }
- ]
- }
- ],
- "thresholds": "1,3",
- "time": {
- "from": "now-1h",
- "to": "now"
- },
- "title": "",
- "type": "singlestat",
- "valueFontSize": "80%",
- "valueMaps": [
- {
- "op": "=",
- "text": "no data",
- "value": "null"
- },
- {
- "op": "=",
- "text": "OKAY",
- "value": "0"
- },
- {
- "op": "=",
- "text": "WARN",
- "value": "1"
- },
- {
- "op": "=",
- "text": "UNKN",
- "value": "2"
- },
- {
- "op": "=",
- "text": "CRIT",
- "value": "3"
- },
- {
- "op": "=",
- "text": "DOWN",
- "value": "4"
- }
- ],
- "valueName": "current",
- "version": 2
-}
\ No newline at end of file
diff --git a/nginx/meta/collectd.yml b/nginx/meta/collectd.yml
index 3a9af83..c859306 100644
--- a/nginx/meta/collectd.yml
+++ b/nginx/meta/collectd.yml
@@ -1,15 +1,6 @@
-{%- if pillar.nginx.server is defined %}
-{%- from "nginx/map.jinja" import server with context %}
-{%- if server.get('enabled', False) and server.get('site', {}).nginx_stats_server is defined %}
-local_plugin:
- collectd_nginx:
+plugin:
+ nginx_server_status:
plugin: nginx
+ execution: local
template: nginx/files/collectd_nginx.conf
- url: http://localhost:{{ server.site.nginx_stats_server.host.port }}
- collectd_nginx_check:
- plugin: python
- template: nginx/files/collectd_nginx_check.conf
- url: http://localhost:{{ server.site.nginx_stats_server.host.port }}
-{%- endif %}
-{%- endif %}
diff --git a/nginx/meta/grafana.yml b/nginx/meta/grafana.yml
deleted file mode 100644
index a03677a..0000000
--- a/nginx/meta/grafana.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-dashboard:
- nginx:
- format: json
- template: nginx/files/grafana_influxdb.json
diff --git a/nginx/meta/heka.yml b/nginx/meta/heka.yml
index d3c4f63..e69de29 100644
--- a/nginx/meta/heka.yml
+++ b/nginx/meta/heka.yml
@@ -1,35 +0,0 @@
-{%- from "nginx/map.jinja" import server with context %}
-{%- if server.get('enabled', False) and server.get('site', {}).nginx_stats_server is defined %}
-metric_collector:
- trigger:
- nginx_check:
- description: 'nginx cannot be checked'
- severity: down
- rules:
- - metric: nginx_check
- relational_operator: '=='
- threshold: 0
- window: 60
- periods: 0
- function: last
- alarm:
- nginx_check:
- alerting: enabled
- triggers:
- - nginx_check
- dimension:
- service: nginx
-aggregator:
- alarm_cluster:
- nginx_check:
- policy: majority_of_members
- alerting: enabled_with_notification
- match:
- service: nginx
- group_by: hostname
- members:
- - nginx_check
- dimension:
- cluster_name: nginx
- nagios_host: 00-top-clusters
-{%- endif %}