From a7da7d88a5beb74333ad04d188eaab590734dcf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Krupa=20=28paulfantom=29?= Date: Thu, 16 Feb 2023 14:39:04 +0100 Subject: [PATCH] dashboard: allow selecting datasource --- dashboard/dashboard.json | 73 +++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/dashboard/dashboard.json b/dashboard/dashboard.json index c49ab3c..7f4dfbc 100755 --- a/dashboard/dashboard.json +++ b/dashboard/dashboard.json @@ -1,14 +1,4 @@ { - "__inputs": [ - { - "name": "DS_PROMETHEUS", - "label": "Prometheus", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], "__elements": {}, "__requires": [ { @@ -76,7 +66,7 @@ "collapsed": false, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "${datasource}" }, "gridPos": { "h": 1, @@ -91,7 +81,7 @@ { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "${datasource}" }, "refId": "A" } @@ -102,7 +92,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "description": " * OL - On line (mains is present)\n * OB - On battery (mains is not present)\n * LB - Low battery\n * HB - High battery\n * RB - The battery needs to be replaced\n * CHRG - The battery is charging\n * DISCHRG - The battery is discharging (inverter is providing load power)\n * BYPASS - UPS bypass circuit is active -- no battery protection is available\n * CAL - UPS is currently performing runtime calibration (on battery)\n * OFF - UPS is offline and is not supplying power to the load\n * OVER - UPS is overloaded\n * TRIM - UPS is trimming incoming voltage (called \"buck\" in some hardware)\n * BOOST - UPS is boosting incoming voltage\n * FSD and SD - Forced Shutdown", "fieldConfig": { @@ -153,7 +143,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "expr": "network_ups_tools_ups_status == 1", "interval": "", @@ -168,7 +158,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "description": "", "fieldConfig": { @@ -219,7 +209,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "expr": "network_ups_tools_device_info{ups=\"$ups\"}", "interval": "", @@ -234,7 +224,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "description": "", "fieldConfig": { @@ -285,7 +275,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "expr": "network_ups_tools_device_info{ups=\"$ups\"}", "interval": "", @@ -300,7 +290,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fieldConfig": { "defaults": { @@ -359,7 +349,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "expr": "network_ups_tools_battery_charge{ups=\"$ups\"}", "instant": false, @@ -379,7 +369,7 @@ "dashes": false, "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "description": "", "fieldConfig": { @@ -439,7 +429,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "expr": "network_ups_tools_battery_runtime{ups=\"$ups\"}", "interval": "", @@ -508,7 +498,7 @@ "dashes": false, "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fill": 1, "fillGradient": 5, @@ -548,7 +538,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "expr": "network_ups_tools_ups_load{ups=\"$ups\"}", "interval": "", @@ -595,7 +585,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fieldConfig": { "defaults": { @@ -643,7 +633,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "expr": "network_ups_tools_battery_runtime{ups=\"$ups\"}", "interval": "", @@ -658,7 +648,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fieldConfig": { "defaults": { @@ -714,7 +704,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "expr": "network_ups_tools_input_voltage{ups=\"$ups\"}", "interval": "", @@ -733,7 +723,7 @@ "dashes": false, "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fill": 1, "fillGradient": 5, @@ -775,7 +765,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "expr": "network_ups_tools_input_voltage{ups=\"$ups\"}", "interval": "", @@ -821,7 +811,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fieldConfig": { "defaults": { @@ -884,7 +874,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "expr": "network_ups_tools_battery_voltage{ups=\"$ups\"}", "interval": "", @@ -903,7 +893,7 @@ "dashes": false, "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "fill": 1, "fillGradient": 5, @@ -945,7 +935,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "expr": "network_ups_tools_battery_voltage{ups=\"$ups\"}", "interval": "", @@ -994,11 +984,24 @@ "tags": [], "templating": { "list": [ + { + "current": {}, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, { "current": {}, "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${datasource}" }, "definition": "label_values(network_ups_tools_device_info, ups)", "hide": 0,