Display the calculated results on a graph, repeating for each host

  • What Grafana version and what operating system are you using?
    Grafana: 10.0.1
    OS: Bulleyes
    Datasource: zabbix

  • What are you trying to achieve?
    I would like to display the disk usage for multiple hosts in separate panels for each host.

  • How are you trying to achieve it?
    The available data is only the disk free percentage, so I used the “Add field from calculation” feature to calculate 100 - free percentage and replaced it with disk usage percentage. I used the repeat function to display it in separate panels for each host.

  • What happened?
    In the first panel for the initial host, the calculation of disk usage percentage worked correctly and yielded the expected results. However, in the other panels, no calculation was performed, and the disk free percentage is being displayed.

  • What did you expect to happen?
    The “Add field from calculation” is executed in all panels that are being repeated.

  • Can you copy/paste the configuration(s) that you are having problems with?

query

{
  "datasource": {
    "uid": "1RP1uke7k",
    "type": "alexanderzobnin-zabbix-datasource"
  },
  "description": "",
  "fieldConfig": {
    "defaults": {
      "custom": {
        "drawStyle": "line",
        "lineInterpolation": "smooth",
        "barAlignment": 0,
        "lineWidth": 3,
        "fillOpacity": 50,
        "gradientMode": "opacity",
        "spanNulls": false,
        "showPoints": "auto",
        "pointSize": 5,
        "stacking": {
          "mode": "none",
          "group": "A"
        },
        "axisPlacement": "auto",
        "axisLabel": "",
        "axisColorMode": "text",
        "scaleDistribution": {
          "type": "linear"
        },
        "axisCenteredZero": false,
        "hideFrom": {
          "tooltip": false,
          "viz": false,
          "legend": false
        },
        "thresholdsStyle": {
          "mode": "off"
        }
      },
      "color": {
        "mode": "palette-classic"
      },
      "mappings": [],
      "thresholds": {
        "mode": "absolute",
        "steps": [
          {
            "color": "green",
            "value": null
          }
        ]
      },
      "decimals": 0,
      "max": 100,
      "min": 0,
      "unit": "percent"
    },
    "overrides": []
  },
  "gridPos": {
    "h": 5,
    "w": 6,
    "x": 0,
    "y": 12
  },
  "id": 29,
  "interval": "1m",
  "options": {
    "tooltip": {
      "mode": "single",
      "sort": "none"
    },
    "legend": {
      "showLegend": false,
      "displayMode": "list",
      "placement": "bottom",
      "calcs": []
    }
  },
  "pluginVersion": "9.3.2",
  "repeat": "servers",
  "repeatDirection": "h",
  "targets": [
    {
      "schema": 12,
      "queryType": "0",
      "group": {
        "filter": "Linux servers"
      },
      "host": {
        "filter": "$servers"
      },
      "application": {
        "filter": "Filesystems"
      },
      "itemTag": {
        "filter": ""
      },
      "item": {
        "filter": "Free disk space on / (percentage)"
      },
      "macro": {
        "filter": ""
      },
      "functions": [],
      "trigger": {
        "filter": ""
      },
      "countTriggersBy": "",
      "tags": {
        "filter": ""
      },
      "proxy": {
        "filter": ""
      },
      "textFilter": "",
      "options": {
        "showDisabledItems": false,
        "skipEmptyValues": false,
        "disableDataAlignment": false,
        "useZabbixValueMapping": false,
        "useTrends": "default",
        "count": true,
        "minSeverity": 3
      },
      "table": {
        "skipEmptyValues": false
      },
      "datasource": {
        "type": "alexanderzobnin-zabbix-datasource",
        "uid": "1RP1uke7k"
      },
      "hide": false,
      "refId": "used %",
      "resultFormat": "time_series",
      "triggers": {
        "acknowledged": 2
      }
    }
  ],
  "title": "Disk used %",
  "transformations": [
    {
      "id": "calculateField",
      "options": {
        "alias": "used %",
        "binary": {
          "left": "100",
          "operator": "-",
          "reducer": "sum",
          "right": "Zabbix server: Free disk space on / (percentage)"
        },
        "mode": "binary",
        "reduce": {
          "reducer": "sum"
        },
        "replaceFields": true
      }
    }
  ],
  "transparent": true,
  "type": "timeseries",
  "scopedVars": {
    "servers": {
      "text": "Zabbix server",
      "value": "Zabbix server",
      "selected": false
    }
  }
}
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    There are no errors displayed in the UI.