Skip to content

Commit

Permalink
Merge pull request #30 from paulfantom/selectable-datasource
Browse files Browse the repository at this point in the history
dashboard: allow selecting datasource
  • Loading branch information
DRuggeri authored Feb 19, 2023
2 parents 20b8a2c + a7da7d8 commit 0c2280f
Showing 1 changed file with 38 additions and 35 deletions.
73 changes: 38 additions & 35 deletions dashboard/dashboard.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__elements": {},
"__requires": [
{
Expand Down Expand Up @@ -76,7 +66,7 @@
"collapsed": false,
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${datasource}"
},
"gridPos": {
"h": 1,
Expand All @@ -91,7 +81,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
"uid": "${datasource}"
},
"refId": "A"
}
Expand All @@ -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": {
Expand Down Expand Up @@ -153,7 +143,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"expr": "network_ups_tools_ups_status == 1",
"interval": "",
Expand All @@ -168,7 +158,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"description": "",
"fieldConfig": {
Expand Down Expand Up @@ -219,7 +209,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"expr": "network_ups_tools_device_info{ups=\"$ups\"}",
"interval": "",
Expand All @@ -234,7 +224,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"description": "",
"fieldConfig": {
Expand Down Expand Up @@ -285,7 +275,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"expr": "network_ups_tools_device_info{ups=\"$ups\"}",
"interval": "",
Expand All @@ -300,7 +290,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -359,7 +349,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"expr": "network_ups_tools_battery_charge{ups=\"$ups\"}",
"instant": false,
Expand All @@ -379,7 +369,7 @@
"dashes": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"description": "",
"fieldConfig": {
Expand Down Expand Up @@ -439,7 +429,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"expr": "network_ups_tools_battery_runtime{ups=\"$ups\"}",
"interval": "",
Expand Down Expand Up @@ -508,7 +498,7 @@
"dashes": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fill": 1,
"fillGradient": 5,
Expand Down Expand Up @@ -548,7 +538,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"expr": "network_ups_tools_ups_load{ups=\"$ups\"}",
"interval": "",
Expand Down Expand Up @@ -595,7 +585,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -643,7 +633,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"expr": "network_ups_tools_battery_runtime{ups=\"$ups\"}",
"interval": "",
Expand All @@ -658,7 +648,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -714,7 +704,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"expr": "network_ups_tools_input_voltage{ups=\"$ups\"}",
"interval": "",
Expand All @@ -733,7 +723,7 @@
"dashes": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fill": 1,
"fillGradient": 5,
Expand Down Expand Up @@ -775,7 +765,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"expr": "network_ups_tools_input_voltage{ups=\"$ups\"}",
"interval": "",
Expand Down Expand Up @@ -821,7 +811,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -884,7 +874,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"expr": "network_ups_tools_battery_voltage{ups=\"$ups\"}",
"interval": "",
Expand All @@ -903,7 +893,7 @@
"dashes": false,
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"fill": 1,
"fillGradient": 5,
Expand Down Expand Up @@ -945,7 +935,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
"uid": "${datasource}"
},
"expr": "network_ups_tools_battery_voltage{ups=\"$ups\"}",
"interval": "",
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0c2280f

Please sign in to comment.