From ba69284b94cc64560b5c6e6923e566cc767ed8ff Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 25 Oct 2021 01:12:39 +0200 Subject: update environment sensor dashboard --- .../files/dashboard-environment-sensors.json | 209 ++++++++++++++++----- 1 file changed, 166 insertions(+), 43 deletions(-) (limited to 'roles/monitoring/grafana/files') diff --git a/roles/monitoring/grafana/files/dashboard-environment-sensors.json b/roles/monitoring/grafana/files/dashboard-environment-sensors.json index 23d39ebf..999b959b 100644 --- a/roles/monitoring/grafana/files/dashboard-environment-sensors.json +++ b/roles/monitoring/grafana/files/dashboard-environment-sensors.json @@ -1,5 +1,14 @@ { - "__inputs": [], + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], "__requires": [ { "type": "grafana", @@ -7,6 +16,18 @@ "name": "Grafana", "version": "8.2.2" }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, { "type": "panel", "id": "timeseries", @@ -36,8 +57,9 @@ "editable": true, "fiscalYearStartMonth": 0, "gnetId": null, - "graphTooltip": 2, + "graphTooltip": 0, "id": null, + "iteration": 1635116629331, "links": [], "liveNow": false, "panels": [ @@ -51,6 +73,8 @@ "custom": { "axisLabel": "", "axisPlacement": "auto", + "axisSoftMax": 30, + "axisSoftMin": 10, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, @@ -60,7 +84,7 @@ "tooltip": false, "viz": false }, - "lineInterpolation": "linear", + "lineInterpolation": "smooth", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { @@ -77,17 +101,12 @@ } }, "mappings": [], - "min": 10, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null - }, - { - "color": "red", - "value": 80 } ] }, @@ -96,7 +115,7 @@ "overrides": [] }, "gridPos": { - "h": 13, + "h": 17, "w": 24, "x": 0, "y": 0 @@ -114,8 +133,8 @@ }, "targets": [ { - "exemplar": true, - "expr": "sensors_temperature_celsius", + "exemplar": false, + "expr": "sensors_temperature_celsius{instance=~\"$instance\"}", "interval": "", "legendFormat": "{{ name }} ({{ kind }})", "refId": "A" @@ -134,6 +153,8 @@ "custom": { "axisLabel": "", "axisPlacement": "auto", + "axisSoftMax": 1020, + "axisSoftMin": 940, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, @@ -143,7 +164,7 @@ "tooltip": false, "viz": false }, - "lineInterpolation": "linear", + "lineInterpolation": "smooth", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { @@ -156,21 +177,16 @@ "mode": "none" }, "thresholdsStyle": { - "mode": "line" + "mode": "off" } }, "mappings": [], - "min": 950, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null - }, - { - "color": "red", - "value": 970 } ] }, @@ -179,10 +195,10 @@ "overrides": [] }, "gridPos": { - "h": 15, + "h": 14, "w": 12, "x": 0, - "y": 13 + "y": 17 }, "id": 4, "options": { @@ -197,19 +213,19 @@ }, "targets": [ { - "exemplar": true, - "expr": "sensors_pressure_pascals / 100", - "hide": false, + "exemplar": false, + "expr": "sensors_pressure_pascals{instance=~\"$instance\"}/100", "interval": "", "legendFormat": "{{ name }} ({{ kind }})", - "refId": "C" + "refId": "A" } ], - "title": "Presssure", + "title": "Pressure", "type": "timeseries" }, { "datasource": null, + "description": "", "fieldConfig": { "defaults": { "color": { @@ -218,6 +234,8 @@ "custom": { "axisLabel": "", "axisPlacement": "auto", + "axisSoftMax": 100, + "axisSoftMin": 0, "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, @@ -227,7 +245,7 @@ "tooltip": false, "viz": false }, - "lineInterpolation": "linear", + "lineInterpolation": "smooth", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { @@ -244,32 +262,25 @@ } }, "mappings": [], - "max": 100, - "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null - }, - { - "color": "red", - "value": 80 } ] - }, - "unit": "humidity" + } }, "overrides": [] }, "gridPos": { - "h": 15, + "h": 14, "w": 12, "x": 12, - "y": 13 + "y": 17 }, - "id": 5, + "id": 6, "options": { "legend": { "calcs": [], @@ -282,8 +293,8 @@ }, "targets": [ { - "exemplar": true, - "expr": "sensors_humidity_percent", + "exemplar": false, + "expr": "sensors_humidity_percent{instance=~\"$instance\"}", "interval": "", "legendFormat": "{{ name }} ({{ kind }})", "refId": "A" @@ -291,14 +302,126 @@ ], "title": "Humidity", "type": "timeseries" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "color-background-solid" + }, + "mappings": [ + { + "options": { + "0": { + "index": 0, + "text": "Low" + }, + "1": { + "index": 1, + "text": "High" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "transparent", + "value": null + }, + { + "color": "transparent", + "value": 0 + }, + { + "color": "text", + "value": 1 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 31 + }, + "id": 8, + "options": { + "frameIndex": 1, + "showHeader": true + }, + "pluginVersion": "8.2.2", + "targets": [ + { + "exemplar": false, + "expr": "sensors_gpio_status{instance=~\"$instance\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "{{ name }}", + "refId": "A" + } + ], + "title": "GPIO", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "__name__": true, + "instance": false, + "job": true, + "kind": true + }, + "indexByName": {}, + "renameByName": {} + } + } + ], + "type": "table" } ], - "refresh": "", + "refresh": "30s", "schemaVersion": 31, "style": "dark", "tags": [], "templating": { - "list": [] + "list": [ + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "label_values(sensors_count_total, instance)", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "instance", + "options": [], + "query": { + "query": "label_values(sensors_count_total, instance)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] }, "time": { "from": "now-6h", @@ -307,6 +430,6 @@ "timepicker": {}, "timezone": "", "title": "Environment Sensors", - "uid": "QkT1miNnz", - "version": 1 + "uid": "AJO5RCO7k", + "version": 6 } \ No newline at end of file -- cgit v1.2.3