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