grafana: accomodations overview: dynamically build site list

This commit is contained in:
Gregor Michels 2023-01-18 01:20:50 +01:00
parent 473d7aa05a
commit 3e7178b5ec
1 changed files with 139 additions and 96 deletions

View File

@ -1,53 +1,38 @@
{ {
"__inputs": [],
"__requires": [
{
"type": "panel",
"id": "bargauge",
"name": "Bar gauge",
"version": ""
},
{
"type": "panel",
"id": "gauge",
"name": "Gauge",
"version": ""
},
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "7.5.11"
},
{
"type": "panel",
"id": "graph",
"name": "Graph",
"version": ""
}
],
"annotations": { "annotations": {
"list": [ "list": [
{ {
"builtIn": 1, "builtIn": 1,
"datasource": "-- Grafana --", "datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true, "enable": true,
"hide": true, "hide": true,
"iconColor": "rgba(0, 211, 255, 1)", "iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts", "name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard" "type": "dashboard"
} }
] ]
}, },
"editable": true, "editable": true,
"gnetId": null, "fiscalYearStartMonth": 0,
"graphTooltip": 0, "graphTooltip": 0,
"id": null, "id": 4,
"iteration": 1669161748754,
"links": [], "links": [],
"liveNow": false,
"panels": [ "panels": [
{ {
"datasource": null, "datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"gridPos": { "gridPos": {
"h": 1, "h": 1,
"w": 24, "w": 24,
@ -55,6 +40,15 @@
"y": 0 "y": 0
}, },
"id": 11, "id": 11,
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"refId": "A"
}
],
"title": "Internet", "title": "Internet",
"type": "row" "type": "row"
}, },
@ -63,7 +57,10 @@
"bars": false, "bars": false,
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": null, "datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"unit": "bps" "unit": "bps"
@ -96,7 +93,7 @@
"alertThreshold": true "alertThreshold": true
}, },
"percentage": false, "percentage": false,
"pluginVersion": "7.5.11", "pluginVersion": "9.0.6",
"pointradius": 2, "pointradius": 2,
"points": false, "points": false,
"renderer": "flot", "renderer": "flot",
@ -112,6 +109,10 @@
"steppedLine": false, "steppedLine": false,
"targets": [ "targets": [
{ {
"datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"exemplar": true, "exemplar": true,
"expr": "irate(node_network_receive_bytes_total{site=\"$site\",job=\"gateways\",device=\"eth0\"}[$__rate_interval]) * 8", "expr": "irate(node_network_receive_bytes_total{site=\"$site\",job=\"gateways\",device=\"eth0\"}[$__rate_interval]) * 8",
"interval": "", "interval": "",
@ -119,6 +120,10 @@
"refId": "rx" "refId": "rx"
}, },
{ {
"datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"exemplar": true, "exemplar": true,
"expr": "irate(node_network_transmit_bytes_total{site=\"$site\",job=\"gateways\",device=\"eth0\"}[$__rate_interval]) * 8", "expr": "irate(node_network_transmit_bytes_total{site=\"$site\",job=\"gateways\",device=\"eth0\"}[$__rate_interval]) * 8",
"hide": false, "hide": false,
@ -128,9 +133,7 @@
} }
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null,
"timeRegions": [], "timeRegions": [],
"timeShift": null,
"title": "upstream bandwith", "title": "upstream bandwith",
"tooltip": { "tooltip": {
"shared": true, "shared": true,
@ -139,37 +142,31 @@
}, },
"type": "graph", "type": "graph",
"xaxis": { "xaxis": {
"buckets": null,
"mode": "time", "mode": "time",
"name": null,
"show": true, "show": true,
"values": [] "values": []
}, },
"yaxes": [ "yaxes": [
{ {
"format": "bps", "format": "bps",
"label": null,
"logBase": 1, "logBase": 1,
"max": null,
"min": null,
"show": true "show": true
}, },
{ {
"format": "short", "format": "short",
"label": null,
"logBase": 1, "logBase": 1,
"max": null,
"min": null,
"show": true "show": true
} }
], ],
"yaxis": { "yaxis": {
"align": false, "align": false
"alignLevel": null
} }
}, },
{ {
"datasource": null, "datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"color": { "color": {
@ -199,6 +196,8 @@
"id": 9, "id": 9,
"options": { "options": {
"displayMode": "gradient", "displayMode": "gradient",
"minVizHeight": 10,
"minVizWidth": 0,
"orientation": "vertical", "orientation": "vertical",
"reduceOptions": { "reduceOptions": {
"calcs": [ "calcs": [
@ -210,9 +209,13 @@
"showUnfilled": true, "showUnfilled": true,
"text": {} "text": {}
}, },
"pluginVersion": "7.5.11", "pluginVersion": "9.0.6",
"targets": [ "targets": [
{ {
"datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"exemplar": true, "exemplar": true,
"expr": "increase(node_network_receive_bytes_total{site=\"$site\",job=\"gateways\",device=~\"eth0\"}[$__range])", "expr": "increase(node_network_receive_bytes_total{site=\"$site\",job=\"gateways\",device=~\"eth0\"}[$__range])",
"instant": true, "instant": true,
@ -221,6 +224,10 @@
"refId": "A" "refId": "A"
}, },
{ {
"datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"exemplar": true, "exemplar": true,
"expr": "increase(node_network_transmit_bytes_total{site=\"$site\",job=\"gateways\",device=~\"eth0\"}[$__range])", "expr": "increase(node_network_transmit_bytes_total{site=\"$site\",job=\"gateways\",device=~\"eth0\"}[$__range])",
"hide": false, "hide": false,
@ -236,7 +243,10 @@
}, },
{ {
"collapsed": false, "collapsed": false,
"datasource": null, "datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"gridPos": { "gridPos": {
"h": 1, "h": 1,
"w": 24, "w": 24,
@ -245,6 +255,15 @@
}, },
"id": 5, "id": 5,
"panels": [], "panels": [],
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"refId": "A"
}
],
"title": "Wifi", "title": "Wifi",
"type": "row" "type": "row"
}, },
@ -253,10 +272,9 @@
"bars": false, "bars": false,
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": null, "datasource": {
"fieldConfig": { "type": "prometheus",
"defaults": {}, "uid": "aUZtGMdVk"
"overrides": []
}, },
"fill": 1, "fill": 1,
"fillGradient": 0, "fillGradient": 0,
@ -285,7 +303,7 @@
"alertThreshold": true "alertThreshold": true
}, },
"percentage": false, "percentage": false,
"pluginVersion": "7.5.11", "pluginVersion": "9.0.6",
"pointradius": 2, "pointradius": 2,
"points": false, "points": false,
"renderer": "flot", "renderer": "flot",
@ -295,6 +313,10 @@
"steppedLine": false, "steppedLine": false,
"targets": [ "targets": [
{ {
"datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"exemplar": true, "exemplar": true,
"expr": "sum (wifi_network_clients{site=\"$site\"})", "expr": "sum (wifi_network_clients{site=\"$site\"})",
"interval": "", "interval": "",
@ -303,9 +325,7 @@
} }
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null,
"timeRegions": [], "timeRegions": [],
"timeShift": null,
"title": "wifi clients over time", "title": "wifi clients over time",
"tooltip": { "tooltip": {
"shared": true, "shared": true,
@ -314,37 +334,31 @@
}, },
"type": "graph", "type": "graph",
"xaxis": { "xaxis": {
"buckets": null,
"mode": "time", "mode": "time",
"name": null,
"show": true, "show": true,
"values": [] "values": []
}, },
"yaxes": [ "yaxes": [
{ {
"format": "short", "format": "short",
"label": null,
"logBase": 1, "logBase": 1,
"max": null,
"min": null,
"show": true "show": true
}, },
{ {
"format": "short", "format": "short",
"label": null,
"logBase": 1, "logBase": 1,
"max": null,
"min": null,
"show": true "show": true
} }
], ],
"yaxis": { "yaxis": {
"align": false, "align": false
"alignLevel": null
} }
}, },
{ {
"datasource": null, "datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
@ -375,6 +389,8 @@
"id": 3, "id": 3,
"options": { "options": {
"displayMode": "gradient", "displayMode": "gradient",
"minVizHeight": 10,
"minVizWidth": 0,
"orientation": "horizontal", "orientation": "horizontal",
"reduceOptions": { "reduceOptions": {
"calcs": [ "calcs": [
@ -386,9 +402,13 @@
"showUnfilled": true, "showUnfilled": true,
"text": {} "text": {}
}, },
"pluginVersion": "7.5.11", "pluginVersion": "9.0.6",
"targets": [ "targets": [
{ {
"datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"exemplar": true, "exemplar": true,
"expr": "sort(sum (wifi_network_clients{site=\"$site\"}) by (location))", "expr": "sort(sum (wifi_network_clients{site=\"$site\"}) by (location))",
"hide": false, "hide": false,
@ -398,6 +418,10 @@
"refId": "by all" "refId": "by all"
}, },
{ {
"datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"exemplar": true, "exemplar": true,
"expr": "sum (wifi_network_clients{site=\"$site\"})", "expr": "sum (wifi_network_clients{site=\"$site\"})",
"hide": false, "hide": false,
@ -411,7 +435,10 @@
"type": "bargauge" "type": "bargauge"
}, },
{ {
"datasource": null, "datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"color": { "color": {
@ -444,6 +471,8 @@
"id": 13, "id": 13,
"options": { "options": {
"displayMode": "gradient", "displayMode": "gradient",
"minVizHeight": 10,
"minVizWidth": 0,
"orientation": "horizontal", "orientation": "horizontal",
"reduceOptions": { "reduceOptions": {
"calcs": [ "calcs": [
@ -455,9 +484,13 @@
"showUnfilled": true, "showUnfilled": true,
"text": {} "text": {}
}, },
"pluginVersion": "7.5.11", "pluginVersion": "9.0.6",
"targets": [ "targets": [
{ {
"datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"exemplar": true, "exemplar": true,
"expr": "sort(sum (wifi_network_clients{site=\"$site\"}) by (instance))", "expr": "sort(sum (wifi_network_clients{site=\"$site\"}) by (instance))",
"instant": true, "instant": true,
@ -479,7 +512,10 @@
"type": "bargauge" "type": "bargauge"
}, },
{ {
"datasource": null, "datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"color": { "color": {
@ -491,8 +527,7 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green", "color": "green"
"value": null
} }
] ]
}, },
@ -522,6 +557,10 @@
"pluginVersion": "7.5.11", "pluginVersion": "7.5.11",
"targets": [ "targets": [
{ {
"datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"exemplar": true, "exemplar": true,
"expr": "sort(wifi_network_bitrate{site=\"$site\"} != 0)", "expr": "sort(wifi_network_bitrate{site=\"$site\"} != 0)",
"instant": true, "instant": true,
@ -557,7 +596,10 @@
"type": "gauge" "type": "gauge"
}, },
{ {
"datasource": null, "datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"color": { "color": {
@ -569,8 +611,7 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green", "color": "green"
"value": null
}, },
{ {
"color": "red", "color": "red",
@ -604,6 +645,10 @@
"pluginVersion": "7.5.11", "pluginVersion": "7.5.11",
"targets": [ "targets": [
{ {
"datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"exemplar": true, "exemplar": true,
"expr": "sum(wifi_network_clients{site=\"$site\",device=\"radio0\"})", "expr": "sum(wifi_network_clients{site=\"$site\",device=\"radio0\"})",
"interval": "", "interval": "",
@ -611,6 +656,10 @@
"refId": "A" "refId": "A"
}, },
{ {
"datasource": {
"type": "prometheus",
"uid": "aUZtGMdVk"
},
"exemplar": true, "exemplar": true,
"expr": "sum(wifi_network_clients{site=\"$site\",device=\"radio1\"})", "expr": "sum(wifi_network_clients{site=\"$site\",device=\"radio1\"})",
"hide": false, "hide": false,
@ -624,41 +673,34 @@
} }
], ],
"refresh": false, "refresh": false,
"schemaVersion": 27, "schemaVersion": 36,
"style": "dark", "style": "dark",
"tags": [], "tags": [],
"templating": { "templating": {
"list": [ "list": [
{ {
"allValue": null,
"current": { "current": {
"selected": true, "selected": false,
"text": "adp", "text": "adp",
"value": "adp" "value": "adp"
}, },
"definition": "label_values(wifi_network_clients, site)",
"description": "which site ?", "description": "which site ?",
"error": null,
"hide": 0, "hide": 0,
"includeAll": false, "includeAll": false,
"label": "Einrichtung", "label": "Einrichtung",
"multi": false, "multi": false,
"name": "site", "name": "site",
"options": [ "options": [],
{ "query": {
"selected": true, "query": "label_values(wifi_network_clients, site)",
"text": "adp", "refId": "StandardVariableQuery"
"value": "adp" },
}, "refresh": 1,
{ "regex": "",
"selected": false,
"text": "ans",
"value": "ans"
}
],
"query": "adp,ans",
"queryValue": "",
"skipUrlSync": false, "skipUrlSync": false,
"type": "custom" "sort": 0,
"type": "query"
} }
] ]
}, },
@ -670,5 +712,6 @@
"timezone": "", "timezone": "",
"title": "Übersicht Gemeinschaftsunterkünfte", "title": "Übersicht Gemeinschaftsunterkünfte",
"uid": "1O2tNMOVk", "uid": "1O2tNMOVk",
"version": 7 "version": 3,
"weekStart": ""
} }