From 9a28b4833be4263d8cf6d7fdfb93d5641c5ab47e Mon Sep 17 00:00:00 2001 From: sberk42 Date: Wed, 29 Jul 2020 17:43:13 +0200 Subject: [PATCH] Revert "new Grafana version and adjust to personal needs" This reverts commit 2bf2efe0687ae7e43eb83364e629c7d369f3fdd8. --- grafana/Dashboard.json | 1716 ++++++++++++++++++++-------------------- grafana/README.md | 6 +- 2 files changed, 857 insertions(+), 865 deletions(-) diff --git a/grafana/Dashboard.json b/grafana/Dashboard.json index 020f23c..a2072cb 100644 --- a/grafana/Dashboard.json +++ b/grafana/Dashboard.json @@ -20,7 +20,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "7.1.0" + "version": "6.7.4" }, { "type": "panel", @@ -42,20 +42,15 @@ }, { "type": "panel", - "id": "stat", - "name": "Stat", - "version": "" - }, - { - "type": "panel", - "id": "table-old", - "name": "Table (old)", + "id": "table", + "name": "Table", "version": "" } ], "annotations": { "list": [ { + "$$hashKey": "object:41", "builtIn": 1, "datasource": "-- Grafana --", "enable": true, @@ -66,83 +61,66 @@ } ] }, - "description": "Monitor FRITZ!Box routers using prometheus and fritzbox_exporter", + "description": "Monitor FRITZ!Box routers.", "editable": true, - "gnetId": 12579, + "gnetId": 713, "graphTooltip": 2, "id": null, "links": [], "panels": [ { "cacheTimeout": null, + "colorBackground": true, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "#1f78c1" + ], "datasource": "${DS_PROMETHEUS}", - "fieldConfig": { - "defaults": { - "custom": {}, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - }, - { - "id": 1, - "op": "=", - "text": "Disconnected", - "type": 1, - "value": "0" - }, - { - "id": 2, - "op": "=", - "text": "Connected", - "type": 1, - "value": "1" - } - ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "rgba(245, 54, 54, 0.9)", - "value": null - }, - { - "color": "rgba(237, 129, 40, 0.89)", - "value": 1 - }, - { - "color": "#1f78c1", - "value": 1 - } - ] - }, - "unit": "none" - }, - "overrides": [] + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true }, "id": 10, "interval": null, "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "background", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 }, - "textMode": "auto" + { + "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" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false }, - "pluginVersion": "7.1.0", + "tableColumn": "", "targets": [ { "dsType": "prometheus", @@ -186,59 +164,46 @@ "target": "" } ], + "thresholds": "1,1", "title": "WAN Connection Status", - "type": "stat" + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + }, + { + "op": "=", + "text": "Disconnected", + "value": "0" + }, + { + "op": "=", + "text": "Connected", + "value": "1" + } + ], + "valueName": "current" }, { "cacheTimeout": null, + "colorBackground": true, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "#1f78c1" + ], "datasource": "${DS_PROMETHEUS}", - "fieldConfig": { - "defaults": { - "custom": {}, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - }, - { - "id": 1, - "op": "=", - "text": "Disconnected", - "type": 1, - "value": "0" - }, - { - "id": 2, - "op": "=", - "text": "Connected", - "type": 1, - "value": "1" - } - ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "rgba(245, 54, 54, 0.9)", - "value": null - }, - { - "color": "rgba(237, 129, 40, 0.89)", - "value": 1 - }, - { - "color": "#1f78c1", - "value": 1 - } - ] - }, - "unit": "none" - }, - "overrides": [] + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true }, "gridPos": { "h": 3, @@ -249,22 +214,38 @@ "id": 9, "interval": null, "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "background", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 }, - "textMode": "auto" + { + "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" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false }, - "pluginVersion": "7.1.0", + "tableColumn": "", "targets": [ { "dsType": "prometheus", @@ -308,54 +289,34 @@ "target": "" } ], + "thresholds": "1,1", "title": "DSL Link Status", - "type": "stat" + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + }, + { + "op": "=", + "text": "Disconnected", + "value": "0" + }, + { + "op": "=", + "text": "Connected", + "value": "1" + } + ], + "valueName": "current" }, { "cacheTimeout": null, "datasource": "${DS_PROMETHEUS}", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": {}, - "decimals": 0, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - } - ], - "max": 7000000, - "min": 0, - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "rgba(237, 129, 40, 0.89)", - "value": 2500000 - }, - { - "color": "red", - "value": 5000000 - } - ] - }, - "unit": "Bps" - }, - "overrides": [] - }, "gridPos": { - "h": 5, + "h": 6, "w": 6, "x": 12, "y": 0 @@ -363,23 +324,58 @@ "id": 11, "links": [], "options": { - "orientation": "horizontal", - "reduceOptions": { + "fieldOptions": { "calcs": [ - "last" + "lastNotNull" ], - "fields": "", + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 1, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "max": 116000000, + "min": 0, + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 50000000 + }, + { + "color": "red", + "value": 100000000 + } + ] + }, + "unit": "bps" + }, + "overrides": [], "values": false }, + "orientation": "horizontal", "showThresholdLabels": false, "showThresholdMarkers": true }, - "pluginVersion": "7.1.0", + "pluginVersion": "6.7.4", "targets": [ { "dsType": "prometheus", "expr": "gateway_wan_bytes_receive_rate", - "format": "table", "groupBy": [ { "params": [ @@ -388,7 +384,6 @@ "type": "time" } ], - "instant": false, "interval": "", "legendFormat": "", "measurement": "fritzbox_value", @@ -426,52 +421,8 @@ { "cacheTimeout": null, "datasource": "${DS_PROMETHEUS}", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": {}, - "decimals": 1, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - } - ], - "max": 1100000, - "min": 0, - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "blue", - "value": null - }, - { - "color": "green", - "value": 250000 - }, - { - "color": "rgba(237, 129, 40, 0.89)", - "value": 500000 - }, - { - "color": "#e24d42", - "value": 1000000 - } - ] - }, - "unit": "Bps" - }, - "overrides": [] - }, "gridPos": { - "h": 5, + "h": 6, "w": 6, "x": 18, "y": 0 @@ -479,23 +430,62 @@ "id": 12, "links": [], "options": { - "orientation": "horizontal", - "reduceOptions": { + "fieldOptions": { "calcs": [ - "last" + "lastNotNull" ], - "fields": "", + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 1, + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "max": 40000000, + "min": 0, + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + }, + { + "color": "green", + "value": 5000000 + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 10000000 + }, + { + "color": "#e24d42", + "value": 30000000 + } + ] + }, + "unit": "bps" + }, + "overrides": [], "values": false }, + "orientation": "horizontal", "showThresholdLabels": false, "showThresholdMarkers": true }, - "pluginVersion": "7.1.0", + "pluginVersion": "6.7.4", "targets": [ { "dsType": "prometheus", "expr": "gateway_wan_bytes_send_rate", - "format": "table", "groupBy": [ { "params": [ @@ -540,51 +530,22 @@ }, { "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], "datasource": "${DS_PROMETHEUS}", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 1, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - }, - { - "id": 1, - "op": "=", - "text": "Disconnected", - "type": 1, - "value": "0" - }, - { - "id": 2, - "op": "=", - "text": "Connected", - "type": 1, - "value": "1" - } - ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "rgba(245, 54, 54, 0.9)", - "value": null - }, - { - "color": "rgba(50, 172, 45, 0.97)", - "value": 1 - } - ] - }, - "unit": "dtdurations" - }, - "overrides": [] + "decimals": 1, + "format": "dtdurations", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true }, "gridPos": { "h": 3, @@ -595,32 +556,48 @@ "id": 21, "interval": null, "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 }, - "textMode": "auto" - }, - "pluginVersion": "7.1.0", - "targets": [ { - "dsType": "prometheus", - "expr": "gateway_uptime_seconds", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" + "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" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "tableColumn": "", + "targets": [ + { + "dsType": "prometheus", + "expr": "gateway_uptime_seconds", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" } ], "interval": "", @@ -654,46 +631,47 @@ "target": "" } ], + "thresholds": "1,1", "title": "Fritzbox Uptime", - "type": "stat" + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + }, + { + "op": "=", + "text": "Disconnected", + "value": "0" + }, + { + "op": "=", + "text": "Connected", + "value": "1" + } + ], + "valueName": "current" }, { "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], "datasource": "${DS_PROMETHEUS}", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 1, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - } - ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "rgba(245, 54, 54, 0.9)", - "value": null - }, - { - "color": "rgba(237, 129, 40, 0.89)", - "value": 1 - }, - { - "color": "rgba(50, 172, 45, 0.97)", - "value": 1 - } - ] - }, - "unit": "dtdurations" - }, - "overrides": [] + "decimals": 1, + "format": "dtdurations", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true }, "gridPos": { "h": 3, @@ -704,22 +682,38 @@ "id": 13, "interval": null, "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 }, - "textMode": "auto" + { + "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" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false }, - "pluginVersion": "7.1.0", + "tableColumn": "", "targets": [ { "dsType": "prometheus", @@ -763,8 +757,18 @@ "target": "" } ], + "thresholds": "1,1", "title": "Connection Uptime", - "type": "stat" + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" }, { "cacheTimeout": null, @@ -777,12 +781,6 @@ ], "datasource": "${DS_PROMETHEUS}", "decimals": 1, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "format": "decbytes", "gauge": { "maxValue": 100, @@ -794,12 +792,11 @@ "gridPos": { "h": 4, "w": 6, - "x": 12, - "y": 5 + "x": 0, + "y": 6 }, - "hideTimeOverride": false, - "id": 22, - "interval": "", + "id": 3, + "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ @@ -832,7 +829,7 @@ "lineColor": "rgb(31, 120, 193)", "show": true }, - "tableColumn": "gateway_wan_bytes_received{gateway=\"fritz.box\", instance=\"fritzbox-exporter-svc.fritzbox:9133\", job=\"fritzbox\"}", + "tableColumn": "", "targets": [ { "dsType": "prometheus", @@ -843,7 +840,7 @@ "measurement": "fritzbox_value", "orderByTime": "ASC", "policy": "default", - "query": "SELECT cumulative_sum(max(\"value\")) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytesreceived') AND $timeFilter GROUP BY time($__interval) tz('Europe/Berlin')", + "query": "SELECT cumulative_sum(non_negative_difference(last(\"value\"))) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytesreceived') AND $timeFilter GROUP BY time($__interval)", "rawQuery": false, "refId": "A", "resultFormat": "time_series", @@ -856,8 +853,10 @@ "type": "field" }, { - "params": [], - "type": "non_negative_difference" + "params": [ + "10s" + ], + "type": "non_negative_derivative" } ] ], @@ -872,9 +871,7 @@ } ], "thresholds": "", - "timeFrom": "1d", - "timeShift": null, - "title": "Last 24h Download", + "title": "Total Download", "type": "singlestat", "valueFontSize": "100%", "valueMaps": [ @@ -884,11 +881,12 @@ "value": "null" } ], - "valueName": "range" + "valueName": "total" }, { "cacheTimeout": null, "colorBackground": false, + "colorPrefix": true, "colorValue": false, "colors": [ "rgba(245, 54, 54, 0.9)", @@ -897,12 +895,6 @@ ], "datasource": "${DS_PROMETHEUS}", "decimals": 1, - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, "format": "decbytes", "gauge": { "maxValue": 100, @@ -914,10 +906,10 @@ "gridPos": { "h": 4, "w": 6, - "x": 18, - "y": 5 + "x": 6, + "y": 6 }, - "id": 16, + "id": 8, "interval": null, "links": [], "mappingType": 1, @@ -951,7 +943,7 @@ "lineColor": "#e24d42", "show": true }, - "tableColumn": "gateway_wan_bytes_sent{gateway=\"fritz.box\", instance=\"fritzbox-exporter-svc.fritzbox:9133\", job=\"fritzbox\"}", + "tableColumn": "", "targets": [ { "dsType": "prometheus", @@ -962,7 +954,7 @@ "measurement": "fritzbox_value", "orderByTime": "ASC", "policy": "default", - "query": "SELECT cumulative_sum(non_negative_difference(last(\"value\"))) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytessent') AND $timeFilter GROUP BY time($__interval) tz('Europe/Berlin')", + "query": "SELECT cumulative_sum(non_negative_difference(last(\"value\"))) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytessent') AND $timeFilter GROUP BY time($__interval)", "rawQuery": false, "refId": "A", "resultFormat": "time_series", @@ -991,8 +983,7 @@ } ], "thresholds": "", - "timeFrom": "1d", - "title": "Last 24h Upload", + "title": "Total Upload", "type": "singlestat", "valueFontSize": "100%", "valueMaps": [ @@ -1002,67 +993,69 @@ "value": "null" } ], - "valueName": "range" + "valueName": "total" }, { "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], "datasource": "${DS_PROMETHEUS}", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 1, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - } - ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decbytes" - }, - "overrides": [] + "decimals": 1, + "format": "decbytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true }, "gridPos": { "h": 4, "w": 6, - "x": 0, + "x": 12, "y": 6 }, - "id": 3, - "interval": null, + "hideTimeOverride": false, + "id": 22, + "interval": "", "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "sum" - ], - "fields": "", - "values": false + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 }, - "textMode": "auto" + { + "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" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": true }, - "pluginVersion": "7.1.0", + "tableColumn": "", "targets": [ { "dsType": "prometheus", @@ -1073,7 +1066,7 @@ "measurement": "fritzbox_value", "orderByTime": "ASC", "policy": "default", - "query": "SELECT cumulative_sum(non_negative_difference(last(\"value\"))) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytesreceived') AND $timeFilter GROUP BY time($__interval)", + "query": "SELECT cumulative_sum(max(\"value\")) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytesreceived') AND $timeFilter GROUP BY time($__interval) tz('Europe/Berlin')", "rawQuery": false, "refId": "A", "resultFormat": "time_series", @@ -1086,10 +1079,8 @@ "type": "field" }, { - "params": [ - "10s" - ], - "type": "non_negative_derivative" + "params": [], + "type": "non_negative_difference" } ] ], @@ -1103,68 +1094,81 @@ "target": "" } ], - "title": "Total Download", - "type": "stat" + "thresholds": "", + "timeFrom": "1d", + "timeShift": null, + "title": "Last 24h Download", + "type": "singlestat", + "valueFontSize": "100%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "range" }, { "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], "datasource": "${DS_PROMETHEUS}", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 1, - "mappings": [ - { - "id": 0, - "op": "=", - "text": "N/A", - "type": 1, - "value": "null" - } - ], - "nullValueMode": "connected", - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decbytes" - }, - "overrides": [] + "decimals": 1, + "format": "decbytes", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true }, "gridPos": { "h": 4, "w": 6, - "x": 6, + "x": 18, "y": 6 }, - "id": 8, + "id": 16, "interval": null, "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "sum" - ], - "fields": "", - "values": false + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 }, - "textMode": "auto" + { + "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" + } + ], + "sparkline": { + "fillColor": "rgba(137, 15, 2, 0.18)", + "full": false, + "lineColor": "#e24d42", + "show": true }, - "pluginVersion": "7.1.0", + "tableColumn": "", "targets": [ { "dsType": "prometheus", @@ -1175,7 +1179,7 @@ "measurement": "fritzbox_value", "orderByTime": "ASC", "policy": "default", - "query": "SELECT cumulative_sum(non_negative_difference(last(\"value\"))) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytessent') AND $timeFilter GROUP BY time($__interval)", + "query": "SELECT cumulative_sum(non_negative_difference(last(\"value\"))) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytessent') AND $timeFilter GROUP BY time($__interval) tz('Europe/Berlin')", "rawQuery": false, "refId": "A", "resultFormat": "time_series", @@ -1203,8 +1207,119 @@ "target": "" } ], - "title": "Total Upload", - "type": "stat" + "thresholds": "", + "timeFrom": "1d", + "title": "Last 24h Upload", + "type": "singlestat", + "valueFontSize": "100%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "range" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 10 + }, + "hiddenSeries": false, + "id": 24, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "gateway_wlan_current_connections", + "interval": "", + "legendFormat": "2.4 GHz", + "refId": "A" + }, + { + "expr": "gateway_wlan2_current_connections", + "interval": "", + "legendFormat": "5 GHz", + "refId": "B" + }, + { + "expr": "gateway_wlan_current_connections+gateway_wlan2_current_connections", + "interval": "", + "legendFormat": "Total", + "refId": "C" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "WLAN Connections", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } }, { "aliasColors": { @@ -1221,21 +1336,14 @@ "dashes": false, "datasource": "${DS_PROMETHEUS}", "editable": true, - "fieldConfig": { - "defaults": { - "custom": {}, - "links": [] - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "grid": {}, "gridPos": { - "h": 6, + "h": 7, "w": 6, "x": 12, - "y": 9 + "y": 10 }, "hiddenSeries": false, "id": 18, @@ -1254,8 +1362,10 @@ "linewidth": 1, "links": [], "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, "percentage": false, - "pluginVersion": "7.1.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -1547,23 +1657,15 @@ "dashLength": 10, "dashes": false, "datasource": "${DS_PROMETHEUS}", - "description": "", "editable": true, - "fieldConfig": { - "defaults": { - "custom": {}, - "links": [] - }, - "overrides": [] - }, "fill": 0, "fillGradient": 0, "grid": {}, "gridPos": { - "h": 6, + "h": 7, "w": 6, "x": 18, - "y": 9 + "y": 10 }, "hiddenSeries": false, "id": 17, @@ -1581,8 +1683,10 @@ "linewidth": 1, "links": [], "nullPointMode": "connected", + "options": { + "dataLinks": [] + }, "percentage": false, - "pluginVersion": "7.1.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -1597,336 +1701,34 @@ { "alias": "download", "dsType": "prometheus", - "expr": "delta(gateway_wan_bytes_received[120s])/120", + "expr": "delta(gateway_wan_bytes_received[1m])/60", "fields": [ { - "func": "mean", - "name": "value" - } - ], - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "groupByTags": [], - "interval": "", - "legendFormat": "Download", - "measurement": "fritzbox_value", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"value\") FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytesreceived') AND $timeFilter GROUP BY time($interval) fill(null)", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "type_instance", - "operator": "=", - "value": "totalbytesreceived" - } - ], - "target": "alias(summarize(nonNegativeDerivative(collectd.squirrel.fritzbox.bytes-totalbytesreceived, 0), '1h', 'sum'), 'download')" - }, - { - "alias": "upload", - "dsType": "prometheus", - "expr": "delta(gateway_wan_bytes_sent[120s])/120", - "fields": [ - { - "func": "mean", - "name": "value" - } - ], - "fill": "null", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "groupByTags": [], - "hide": false, - "interval": "", - "legendFormat": "Upload", - "measurement": "fritzbox_value", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT non_negative_difference(last(cumulative_sum)) FROM (\nSELECT cumulative_sum(non_negative_difference(last(\"value\"))) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytessent') AND $timeFilter GROUP BY time($__interval)\n) WHERE $timeFilter GROUP BY time($__interval) tz('Europe/Berlin')", - "rawQuery": true, - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "type_instance", - "operator": "=", - "value": "totalbytessent" - } - ], - "target": "alias(summarize(nonNegativeDerivative(collectd.squirrel.fritzbox.bytes-totalbytessent,0),'1h','sum'),'upload')" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Current Traffic", - "tooltip": { - "msResolution": false, - "query_as_alias": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "logBase": 1, - "max": null, - "min": 0, - "show": true - }, - { - "format": "Bps", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - }, - "zerofill": true - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_PROMETHEUS}", - "fieldConfig": { - "defaults": { - "custom": {}, - "links": [] - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 6, - "w": 12, - "x": 0, - "y": 10 - }, - "hiddenSeries": false, - "id": 24, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "percentage": false, - "pluginVersion": "7.1.0", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "gateway_wlan_current_connections", - "interval": "", - "legendFormat": "2.4 GHz", - "refId": "A" - }, - { - "expr": "gateway_wlan2_current_connections", - "interval": "", - "legendFormat": "5 GHz", - "refId": "B" - }, - { - "expr": "gateway_wlan_current_connections+gateway_wlan2_current_connections", - "interval": "", - "legendFormat": "Total", - "refId": "C" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "WLAN Connections", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "columns": [], - "datasource": "${DS_PROMETHEUS}", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fontSize": "100%", - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 15 - }, - "id": 14, - "links": [], - "pageSize": null, - "scroll": true, - "showHeader": true, - "sort": { - "col": 0, - "desc": true - }, - "styles": [ - { - "alias": "Time", - "align": "auto", - "dateFormat": "MMMM D, YYYY LT", - "pattern": "Time", - "type": "date" - }, - { - "alias": "", - "align": "auto", - "colorMode": null, - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 2, - "pattern": "/.*/", - "thresholds": [], - "type": "number", - "unit": "decbytes" - } - ], - "targets": [ - { - "alias": "Download", - "dsType": "prometheus", - "expr": "gateway_wan_bytes_received", + "func": "mean", + "name": "value" + } + ], "groupBy": [ { "params": [ - "1d" + "$interval" ], "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" } ], + "groupByTags": [], "interval": "", "legendFormat": "Download", "measurement": "fritzbox_value", "orderByTime": "ASC", "policy": "default", - "query": "SELECT non_negative_difference(last(cumulative_sum)) FROM (\nSELECT cumulative_sum(non_negative_difference(\"value\")) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytesreceived') AND $timeFilter \n) WHERE $timeFilter GROUP BY time(1d) tz('Europe/Berlin')", + "query": "SELECT mean(\"value\") FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytesreceived') AND $timeFilter GROUP BY time($interval) fill(null)", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -1940,13 +1742,7 @@ }, { "params": [], - "type": "max" - }, - { - "params": [ - "10s" - ], - "type": "non_negative_derivative" + "type": "mean" } ] ], @@ -1957,26 +1753,41 @@ "value": "totalbytesreceived" } ], - "target": "" + "target": "alias(summarize(nonNegativeDerivative(collectd.squirrel.fritzbox.bytes-totalbytesreceived, 0), '1h', 'sum'), 'download')" }, { - "alias": "Upload", + "alias": "upload", "dsType": "prometheus", - "expr": "gateway_wan_bytes_sent", + "expr": "delta(gateway_wan_bytes_sent[1m])/60", + "fields": [ + { + "func": "mean", + "name": "value" + } + ], + "fill": "null", "groupBy": [ { "params": [ - "1d" + "$interval" ], "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" } ], + "groupByTags": [], + "hide": false, "interval": "", "legendFormat": "Upload", "measurement": "fritzbox_value", "orderByTime": "ASC", "policy": "default", - "query": "SELECT non_negative_difference(last(cumulative_sum)) FROM (\nSELECT cumulative_sum(non_negative_difference(\"value\")) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytessent') AND $timeFilter\n) WHERE $timeFilter GROUP BY time(1d) tz('Europe/Berlin')", + "query": "SELECT non_negative_difference(last(cumulative_sum)) FROM (\nSELECT cumulative_sum(non_negative_difference(last(\"value\"))) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytessent') AND $timeFilter GROUP BY time($__interval)\n) WHERE $timeFilter GROUP BY time($__interval) tz('Europe/Berlin')", "rawQuery": true, "refId": "B", "resultFormat": "time_series", @@ -1990,13 +1801,7 @@ }, { "params": [], - "type": "max" - }, - { - "params": [ - "10s" - ], - "type": "non_negative_derivative" + "type": "mean" } ] ], @@ -2004,15 +1809,53 @@ { "key": "type_instance", "operator": "=", - "value": "totalbytesreceived" + "value": "totalbytessent" } ], - "target": "" + "target": "alias(summarize(nonNegativeDerivative(collectd.squirrel.fritzbox.bytes-totalbytessent,0),'1h','sum'),'upload')" } ], - "title": "Daily Traffic", - "transform": "timeseries_to_columns", - "type": "table-old" + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Current Traffic", + "tooltip": { + "msResolution": false, + "query_as_alias": true, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "Bps", + "logBase": 1, + "max": null, + "min": 0, + "show": true + }, + { + "format": "Bps", + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + }, + "zerofill": true }, { "aliasColors": { @@ -2025,20 +1868,13 @@ "dashLength": 10, "dashes": false, "datasource": "${DS_PROMETHEUS}", - "fieldConfig": { - "defaults": { - "custom": {}, - "links": [] - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { - "h": 6, + "h": 7, "w": 12, "x": 0, - "y": 16 + "y": 18 }, "hiddenSeries": false, "id": 2, @@ -2060,8 +1896,10 @@ "linewidth": 1, "links": [], "nullPointMode": "null", + "options": { + "dataLinks": [] + }, "percentage": false, - "pluginVersion": "7.1.0", "pointradius": 5, "points": false, "renderer": "flot", @@ -2216,17 +2054,166 @@ "align": false, "alignLevel": null } + }, + { + "columns": [], + "datasource": "${DS_PROMETHEUS}", + "fontSize": "100%", + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 25 + }, + "id": 14, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "align": "auto", + "dateFormat": "MMMM D, YYYY LT", + "pattern": "Time", + "type": "date" + }, + { + "alias": "", + "align": "auto", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "decbytes" + } + ], + "targets": [ + { + "alias": "Download", + "dsType": "prometheus", + "expr": "gateway_wan_bytes_received", + "groupBy": [ + { + "params": [ + "1d" + ], + "type": "time" + } + ], + "interval": "", + "legendFormat": "Download", + "measurement": "fritzbox_value", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT non_negative_difference(last(cumulative_sum)) FROM (\nSELECT cumulative_sum(non_negative_difference(\"value\")) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytesreceived') AND $timeFilter \n) WHERE $timeFilter GROUP BY time(1d) tz('Europe/Berlin')", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "max" + }, + { + "params": [ + "10s" + ], + "type": "non_negative_derivative" + } + ] + ], + "tags": [ + { + "key": "type_instance", + "operator": "=", + "value": "totalbytesreceived" + } + ], + "target": "" + }, + { + "alias": "Upload", + "dsType": "prometheus", + "expr": "gateway_wan_bytes_sent", + "groupBy": [ + { + "params": [ + "1d" + ], + "type": "time" + } + ], + "interval": "", + "legendFormat": "Upload", + "measurement": "fritzbox_value", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT non_negative_difference(last(cumulative_sum)) FROM (\nSELECT cumulative_sum(non_negative_difference(\"value\")) FROM \"fritzbox_value\" WHERE (\"type_instance\" = 'totalbytessent') AND $timeFilter\n) WHERE $timeFilter GROUP BY time(1d) tz('Europe/Berlin')", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "max" + }, + { + "params": [ + "10s" + ], + "type": "non_negative_derivative" + } + ] + ], + "tags": [ + { + "key": "type_instance", + "operator": "=", + "value": "totalbytesreceived" + } + ], + "target": "" + } + ], + "title": "Daily Traffic", + "transform": "timeseries_to_columns", + "type": "table" } ], "refresh": false, - "schemaVersion": 26, + "schemaVersion": 22, "style": "dark", "tags": [], "templating": { "list": [] }, "time": { - "from": "now-24h", + "from": "now-7d", "to": "now" }, "timepicker": { @@ -2257,5 +2244,8 @@ "timezone": "", "title": "FRITZ!Box Status", "uid": "000000013", - "version": 5 -} + "variables": { + "list": [] + }, + "version": 18 +} \ No newline at end of file diff --git a/grafana/README.md b/grafana/README.md index a59129d..82fa5af 100644 --- a/grafana/README.md +++ b/grafana/README.md @@ -1,6 +1,8 @@ # Grafana dashboard working with this exporter This dashboard is based on the following dashboard: -https://grafana.com/grafana/dashboards/12579 +https://grafana.com/grafana/dashboards/713 -Adjusted to my personal max down- and upstream and upgraded to the newest grafana version. +Instead of influx it uses prometheus and has been modified and enhanced. + +The dashboard is now also published to [Grafana](https://grafana.com/grafana/dashboards/12579)