Unable to graph data from InfluxDB bucket

Grafana version => 10.4.2
OS version => Ubuntu 22.04.4 LTS

Hi all,
I’ve downloaded a dashboard from Grafana site => QNAP Dashboard - Telegraf SNMP - InfluxDB | Grafana Labs

With Data explorer I can see measurements:

but not inside the dashboard:


as you can see I’ve added variable “bucket” and selected “telegraf” because is the right bucket and inside configuration of the dashboard I modified “bucket: v.defaultBucket” in “bucket: telegraf”.
What other check should I try?

Thanks,
G.

Did you modify that in all panels and all variables?

Hi @ebabeshko,
to be honest inside variables yes:


while inside the json I tried to change “v.DefaultBucket” to “telegraf” but dashboard started flashing :sweat_smile:

so I recover it back with “v.DefaultBucket” in json and set bucket from the variable in the dashboard page on top like posted in my first comment

what does the query inside the dashboard look like?

Bucket name (telegraf) should be enclosed in double quotes ("telegraf")

v.defaultBucket is being taken from Connection settings, not from variable:

Is it set to telegraf in your case?

If you want to use dashboard variable to specify the bucket to query data from, you should change v.defaultBucket to "${bucket}" or ${bucket:doublequote} in panel queries

{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "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"
      }
    ]
  },
  "description": "Grafana Dashboard for QNAP Devices, collecting SNMP using Telegraf, and InfluxDB",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 18229,
  "graphTooltip": 0,
  "id": 7,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 13,
      "panels": [],
      "title": "QNAP Quick Overview",
      "type": "row"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "ddki77i5igqgwe"
      },
      "description": "This panel displays all the needed QNAP information of the unit you are running.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "dark-purple",
            "mode": "fixed"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-purple",
                "value": null
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Model"
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "unit",
                "value": "bytes"
              },
              {
                "id": "displayName",
                "value": "Total RAM"
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "C"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Number of Disks"
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "D"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Number of CPU Cores"
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "E"
            },
            "properties": [
              {
                "id": "unit",
                "value": "h"
              },
              {
                "id": "displayName",
                "value": "Uptime"
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "F"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Number of Ethernet Ports"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 5,
        "w": 12,
        "x": 0,
        "y": 1
      },
      "id": 2,
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "vertical",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/.*/",
          "values": false
        },
        "showPercentChange": false,
        "text": {},
        "textMode": "value_and_name",
        "wideLayout": true
      },
      "pluginVersion": "10.4.2",
      "repeat": "qnaphostname",
      "repeatDirection": "h",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "hide": false,
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.enclosureTable\")\r\n  |> filter(fn: (r) => r[\"_field\"] == \"enclosureSerialNum\" and  r[\"enclosureID\"] == \"0\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> keep(columns: [\"enclosureModel\"])\r\n  |> distinct(column: \"enclosureModel\")\r\n  |> group() \r\n  |> last() \r\n  |> keep(columns: [\"_value\"]) \r\n\r\n  ",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "hide": false,
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.systemTable\")\r\n  |> filter(fn: (r) => r[\"_field\"] == \"systemTotalMemEX\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> group() \r\n  |> last() \r\n  |> keep(columns: [\"_value\"]) \r\n",
          "refId": "B"
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "hide": false,
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.cpuTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> keep(columns: [\"cpuIndex\"])\r\n  |> distinct(column: \"cpuIndex\")\r\n  |> group()\r\n  |> count()",
          "refId": "D"
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "hide": false,
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.diskTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> keep(columns: [\"diskID\"])\r\n  |> distinct(column: \"diskID\")\r\n  |> group()\r\n  |> count()",
          "refId": "C"
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "hide": false,
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.systemIfTableEx\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> keep(columns: [\"ifDescrEX\"])\r\n  |> distinct(column: \"ifDescrEX\")\r\n  |> group()\r\n  |> count()",
          "refId": "F"
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "hide": false,
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.systemTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"systemUptime\")\r\n  |> map(fn: (r) => ({r with _value: r._value / 360000}))\r\n  |> group() \r\n  |> last() \r\n  |> keep(columns: [\"_value\"]) \r\n\r\n",
          "refId": "E"
        }
      ],
      "title": "QNAP Overview - $qnaphostname",
      "transformations": [
        {
          "disabled": true,
          "id": "calculateField",
          "options": {
            "alias": "",
            "mode": "reduceRow",
            "reduce": {
              "include": [
                "_value",
                "enclosureModel"
              ],
              "reducer": "lastNotNull"
            },
            "replaceFields": true
          }
        },
        {
          "disabled": true,
          "id": "reduce",
          "options": {
            "includeTimeField": false,
            "mode": "reduceFields",
            "reducers": [
              "lastNotNull"
            ]
          }
        }
      ],
      "type": "stat"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 6
      },
      "id": 18,
      "panels": [],
      "title": "QNAP Temperature",
      "type": "row"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "ddki77i5igqgwe"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "displayName": "${__field.labels.sysFanDescrEX}",
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "semi-dark-blue",
                "value": null
              },
              {
                "color": "semi-dark-blue",
                "value": 1600
              },
              {
                "color": "dark-blue",
                "value": 1800
              }
            ]
          },
          "unit": "rotrpm"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 7,
        "x": 0,
        "y": 7
      },
      "id": 9,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "textMode": "auto",
        "wideLayout": true
      },
      "pluginVersion": "10.4.2",
      "repeat": "qnaphostname",
      "repeatDirection": "v",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.systemFanTableEx\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"sysFanSpeedEX\")\r\n  |> group(columns: [\"sysFanDescrEX\"])\r\n  |> aggregateWindow(every: ${interval}, fn: last, createEmpty: false)\r\n  |> yield(name: \"last\")",
          "refId": "A"
        }
      ],
      "title": "FAN Speed - $qnaphostname",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "ddki77i5igqgwe"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 0,
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green",
                "value": null
              },
              {
                "color": "dark-orange",
                "value": 70
              },
              {
                "color": "dark-red",
                "value": 85
              }
            ]
          },
          "unit": "celsius"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "CPU Temperature"
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "System Temperature"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 5,
        "w": 5,
        "x": 7,
        "y": 7
      },
      "id": 5,
      "interval": "5m",
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "vertical",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "textMode": "value_and_name",
        "wideLayout": true
      },
      "pluginVersion": "10.4.2",
      "repeat": "qnaphostname",
      "repeatDirection": "v",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "hide": false,
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.systemTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"cpu-TemperatureEX\")\r\n  |> aggregateWindow(every: ${interval}, fn: last, createEmpty: false)\r\n  |> yield(name: \"last\")",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "hide": false,
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.systemTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"systemTemperatureEX\")\r\n  |> aggregateWindow(every: ${interval}, fn: last, createEmpty: false)\r\n  |> yield(name: \"last\")",
          "refId": "B"
        }
      ],
      "title": "System Temperatures - $qnaphostname",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "ddki77i5igqgwe"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 0,
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green",
                "value": null
              },
              {
                "color": "dark-orange",
                "value": 70
              },
              {
                "color": "dark-red",
                "value": 85
              }
            ]
          },
          "unit": "celsius"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "NVMe M.2 #${__field.labels.diskID}"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "orange",
                      "value": 50
                    },
                    {
                      "color": "dark-red",
                      "value": 60
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "HDD #${__field.labels.diskID}"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 5,
        "w": 12,
        "x": 12,
        "y": 7
      },
      "id": 11,
      "interval": "5m",
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "vertical",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showPercentChange": false,
        "textMode": "value_and_name",
        "wideLayout": true
      },
      "pluginVersion": "10.4.2",
      "repeat": "qnaphostname",
      "repeatDirection": "v",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "hide": false,
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.diskTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"diskTemperture\")\r\n  |> filter(fn: (r) => r[\"diskID\"] == \"1\" or r[\"diskID\"] == \"2\")\r\n  |> aggregateWindow(every: ${interval}, fn: last, createEmpty: false)\r\n  |> yield(name: \"last\")",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "hide": false,
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.diskTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"diskTemperture\")\r\n  |> filter(fn: (r) => r[\"diskID\"] > \"2\")\r\n  |> aggregateWindow(every: ${interval}, fn: last, createEmpty: false)\r\n  |> yield(name: \"last\")",
          "refId": "B"
        }
      ],
      "title": "Disk Temperatures - $qnaphostname",
      "type": "stat"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 12
      },
      "id": 22,
      "panels": [],
      "title": "QNAP System Usage",
      "type": "row"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "ddki77i5igqgwe"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "CPU usage %",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 30,
            "gradientMode": "hue",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "smooth",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "dashed"
            }
          },
          "decimals": 0,
          "displayName": "Core #${__field.labels.cpuID} - ${__field.labels.agent_host}",
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green",
                "value": null
              },
              {
                "color": "dark-orange",
                "value": 70
              },
              {
                "color": "dark-red",
                "value": 90
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 0,
        "y": 13
      },
      "id": 4,
      "interval": "5m",
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max",
            "mean"
          ],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.cpuTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"cpuUsage\")\r\n  |> filter(fn: (r) => r._value > 0)\r\n  |> group(columns: [\"cpuID\",\"agent_host\"])\r\n  |> aggregateWindow(every: ${interval}, fn: last, createEmpty: false)\r\n  |> yield(name: \"last\")",
          "refId": "A"
        }
      ],
      "title": "CPU Usage",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "ddki77i5igqgwe"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "RAM usage %",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 30,
            "gradientMode": "hue",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "smooth",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "dashed"
            }
          },
          "decimals": 2,
          "displayName": "RAM - ${__field.labels.agent_host}",
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green",
                "value": null
              },
              {
                "color": "dark-orange",
                "value": 70
              },
              {
                "color": "dark-red",
                "value": 90
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 12,
        "y": 13
      },
      "id": 10,
      "interval": "5m",
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max",
            "mean"
          ],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.systemTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"systemTotalMemEX\" or r[\"_field\"] == \"systemFreeMemEX\")\r\n  |> pivot(rowKey:[\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")\r\n  |> map(fn: (r) => ({ r with  _value: 100.0 - (float(v: r.systemFreeMemEX) / float(v: r.systemTotalMemEX) * 100.0) }))\r\n  |> group(columns: [\"source\",\"_field\",\"agent_host\"])\r\n  |> aggregateWindow(every: ${interval}, fn: mean, createEmpty: false)\r\n",
          "refId": "A"
        }
      ],
      "title": "RAM Usage",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "ddki77i5igqgwe"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "continuous-BlYlRd"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "Traffic Sent",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 30,
            "gradientMode": "hue",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "smooth",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 0,
          "displayName": "${__field.labels.ifDescrEX} in - ${__field.labels.agent_host}",
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green"
              }
            ]
          },
          "unit": "KBs"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "A"
            },
            "properties": [
              {
                "id": "custom.transform",
                "value": "negative-Y"
              },
              {
                "id": "displayName",
                "value": "${__field.labels.ifDescrEX} out - ${__field.labels.agent_host}"
              },
              {
                "id": "color",
                "value": {
                  "mode": "continuous-RdYlGr"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 20
      },
      "id": 6,
      "interval": "5m",
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max",
            "mean"
          ],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.systemIfTableEx\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"ifPacketsSentEX\")\r\n  |> group(columns: [\"ifDescrEX\",\"agent_host\"])\r\n  |> derivative(unit: 1s, nonNegative: true)\r\n  |> aggregateWindow(every: ${interval}, fn: last, createEmpty: false)\r\n  |> yield(name: \"nonnegative derivative\")",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "hide": false,
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.systemIfTableEx\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"ifPacketsReceivedEX\")\r\n  |> group(columns: [\"ifDescrEX\",\"agent_host\"])\r\n  |> derivative(unit: 1s, nonNegative: true)\r\n  |> aggregateWindow(every: ${interval}, fn: last, createEmpty: false)\r\n  |> yield(name: \"nonnegative derivative\")",
          "refId": "B"
        }
      ],
      "title": "Network Usage - Traffic Sent",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "ddki77i5igqgwe"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "IOPS",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 30,
            "gradientMode": "hue",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "smooth",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "dashed"
            }
          },
          "decimals": 0,
          "displayName": "Disk #${__field.labels.diskPerformanceIndex} - ${__field.labels.agent_host}",
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green"
              },
              {
                "color": "dark-orange",
                "value": 70
              },
              {
                "color": "dark-red",
                "value": 90
              }
            ]
          },
          "unit": "iops"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 0,
        "y": 27
      },
      "id": 14,
      "interval": "5m",
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull",
            "max",
            "mean"
          ],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.diskPerformanceTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"iops\")\r\n  |> aggregateWindow(every: ${interval}, fn: last, createEmpty: false)\r\n  |> yield(name: \"last\")",
          "refId": "A"
        }
      ],
      "title": "Disk IOPS",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "ddki77i5igqgwe"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 0,
          "displayName": "${__field.labels.sysVolumeDescrEX}",
          "mappings": [],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-green"
              },
              {
                "color": "dark-yellow",
                "value": 65
              },
              {
                "color": "dark-orange",
                "value": 75
              },
              {
                "color": "dark-red",
                "value": 90
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 12,
        "y": 27
      },
      "id": 15,
      "interval": "5m",
      "options": {
        "displayMode": "lcd",
        "maxVizHeight": 300,
        "minVizHeight": 10,
        "minVizWidth": 0,
        "namePlacement": "auto",
        "orientation": "vertical",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showUnfilled": true,
        "sizing": "auto",
        "valueMode": "color"
      },
      "pluginVersion": "10.4.2",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "ddki77i5igqgwe"
          },
          "query": "from(bucket: v.defaultBucket)\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.systemVolumeTableEx\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> filter(fn: (r) => r[\"_field\"] == \"sysVolumeFreeSize\" or r[\"_field\"] == \"sysVolumeTotalSizeEX\")\r\n  |> pivot(rowKey:[\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")\r\n  |> map(fn: (r) => ({ r with  _value: 100.0 - (float(v: r.sysVolumeFreeSize) / float(v: r.sysVolumeTotalSizeEX) * 100.0) }))\r\n  |> aggregateWindow(every: ${interval}, fn: last, createEmpty: false)\r\n  |> yield(name: \"last\")",
          "refId": "A"
        }
      ],
      "title": "Volume Usage",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "_value": false,
              "sysVolumeFreeSize": true,
              "sysVolumeTotalSizeEX": true
            },
            "indexByName": {},
            "renameByName": {}
          }
        }
      ],
      "type": "bargauge"
    }
  ],
  "refresh": "5m",
  "revision": 1,
  "schemaVersion": 39,
  "tags": [],
  "templating": {
    "list": [
      {
        "auto": true,
        "auto_count": 100,
        "auto_min": "30s",
        "current": {
          "selected": false,
          "text": "auto",
          "value": "$__auto_interval_interval"
        },
        "hide": 0,
        "label": "Sampling",
        "name": "interval",
        "options": [
          {
            "selected": true,
            "text": "auto",
            "value": "$__auto_interval_interval"
          },
          {
            "selected": false,
            "text": "1m",
            "value": "1m"
          },
          {
            "selected": false,
            "text": "10m",
            "value": "10m"
          },
          {
            "selected": false,
            "text": "30m",
            "value": "30m"
          },
          {
            "selected": false,
            "text": "1h",
            "value": "1h"
          },
          {
            "selected": false,
            "text": "6h",
            "value": "6h"
          },
          {
            "selected": false,
            "text": "12h",
            "value": "12h"
          },
          {
            "selected": false,
            "text": "1d",
            "value": "1d"
          },
          {
            "selected": false,
            "text": "7d",
            "value": "7d"
          },
          {
            "selected": false,
            "text": "14d",
            "value": "14d"
          },
          {
            "selected": false,
            "text": "30d",
            "value": "30d"
          }
        ],
        "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d",
        "queryValue": "",
        "refresh": 2,
        "skipUrlSync": false,
        "type": "interval"
      },
      {
        "current": {
          "selected": false,
          "text": "All",
          "value": "$__all"
        },
        "datasource": {
          "type": "influxdb",
          "uid": "ddki77i5igqgwe"
        },
        "definition": "from(bucket: \"telegraf\")\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.enclosureTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] != \"\")\r\n  |> keep(columns: [\"agent_host\"])\r\n  |> distinct(column: \"agent_host\")\r\n  |> group()\r\n  \r\n",
        "description": "QNAP Hostname Variable",
        "hide": 0,
        "includeAll": true,
        "label": "Hostname",
        "multi": true,
        "name": "qnaphostname",
        "options": [],
        "query": "from(bucket: \"telegraf\")\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.enclosureTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] != \"\")\r\n  |> keep(columns: [\"agent_host\"])\r\n  |> distinct(column: \"agent_host\")\r\n  |> group()\r\n  \r\n",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": "All",
          "value": "$__all"
        },
        "datasource": {
          "type": "influxdb",
          "uid": "ddki77i5igqgwe"
        },
        "definition": "from(bucket: \"telegraf\")\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.enclosureTable\")\r\n  |> filter(fn: (r) => r[\"_field\"] == \"enclosureSerialNum\" and  r[\"enclosureID\"] == \"0\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> keep(columns: [\"enclosureModel\"])\r\n  |> distinct(column: \"enclosureModel\")\r\n  |> group()\r\n  \r\n",
        "description": "QNAP Model Variable",
        "hide": 0,
        "includeAll": true,
        "label": "QNAP",
        "multi": true,
        "name": "qnapmodel",
        "options": [],
        "query": "from(bucket: \"telegraf\")\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.enclosureTable\")\r\n  |> filter(fn: (r) => r[\"_field\"] == \"enclosureSerialNum\" and  r[\"enclosureID\"] == \"0\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> keep(columns: [\"enclosureModel\"])\r\n  |> distinct(column: \"enclosureModel\")\r\n  |> group()\r\n  \r\n",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": "All",
          "value": "$__all"
        },
        "datasource": {
          "type": "influxdb",
          "uid": "ddki77i5igqgwe"
        },
        "definition": "from(bucket: \"telegraf\")\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.diskTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> keep(columns: [\"diskID\"])\r\n  |> distinct(column: \"diskID\")\r\n  |> group()\r\n  \r\n",
        "description": "QNAP Hostname Variable",
        "hide": 0,
        "includeAll": true,
        "label": "Disk",
        "multi": true,
        "name": "qnapdisk",
        "options": [],
        "query": "from(bucket: \"telegraf\")\r\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n  |> filter(fn: (r) => r[\"_measurement\"] == \"snmp.QNAP.diskTable\")\r\n  |> filter(fn: (r) => r[\"agent_host\"] =~ /${qnaphostname:regex}/)\r\n  |> keep(columns: [\"diskID\"])\r\n  |> distinct(column: \"diskID\")\r\n  |> group()\r\n  \r\n",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": true,
          "text": "telegraf",
          "value": "telegraf"
        },
        "datasource": {
          "type": "influxdb",
          "uid": "ddki77i5igqgwe"
        },
        "definition": "buckets()",
        "hide": 0,
        "includeAll": false,
        "label": "bucket",
        "multi": false,
        "name": "bucket",
        "options": [],
        "query": "buckets()",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      }
    ]
  },
  "time": {
    "from": "now-30d",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "QNAP Dashboard - Telegraf SNMP - InfluxDB",
  "uid": "WwEIDjJVz",
  "version": 8,
  "weekStart": ""
}

set bucket name in variables with double quotes :wink:

Inside Connection setting is set another bucket, probably because was the first created:
immagine
the problem is that if I change it with v.defaultBucket both dashbaords (fritzbox and qnap) crash even if I set the bucket inside variables.

where should I change v.defaultBucket to "${bucket}?

In your query:
image

Never done this, but I presume it will work based on what @ebabeshko wrote.

from(bucket: "${bucket}")

Also, @justg , in case it helps, the syntax for using multiple selections of a variable in Flux queries in Grafana can be like this:

If you just change it to telegraf in Connection settings and leave v.defaultBucket in panel queries, does it work?

Yes if I set telegraf as default bucket in influxDB connection settings and change “telegraf” in “v.defaultBucket” in variable queries it works:


but the other dashbaord stop to work:

Ok, so just change v.defaultBucket to "telegraf" (don’t forget double quotes) in all variables and panels of your QNAP dashboard. I don’t think you need to declare bucket variable at all for that dashboard in your case.

you mean inside variables and json or only inside variables tab?
Anyway the problem is that if I remove in influxDB connection the default bucket both dashboards don’t work even if I specified the bucket inside the variables:





Everywhere in dashboard - in variables, in panels:

Note that this panel has 6 queries - you should change it in all of them.

Or you can edit panel JSON by replacing v.defaultBucket to "telegraf"

That’s right, they wouldn’t work if you don’t change bucket in all queries. It’s not enough to change it only in dashboard variables.

1 Like

Also keep in mind that in JSON model of panel/dashboard double quotes around bucket name should be escaped, i.e. \" should be used instead of just " :

ok solved changing every “v.defaultBucket” in the right bucket in both dashboards in variables and queries :slight_smile:
Thank you so much for the support!
G.