Grafana dashboard: Network Traffic

Please see the [instructions/README](https://www.technicallywizardry.com/raspberry-pi-network-monitor/).

{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "bargauge",
      "name": "Bar Gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.6.2"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 12619,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1601468661923,
  "links": [],
  "panels": [
    {
      "collapsed": false,
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 11,
      "panels": [],
      "title": "Overview",
      "type": "row"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 11,
        "w": 24,
        "x": 0,
        "y": 1
      },
      "hiddenSeries": false,
      "id": 2,
      "interval": "30s",
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null as zero",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/Down/",
          "transform": "negative-Y"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum by(dst) (rate(ntm_bytes_total{dst=~\"$LocalIPs\",src!~\"($ExcludedServers)|($LocalIPs)\",proto=~\"$Protos\",service=~\"$Services\"}[$__interval]))",
          "interval": "",
          "legendFormat": "{{ dst }} (Down)",
          "refId": "A"
        },
        {
          "expr": "sum by(src) (rate(ntm_bytes_total{src=~\"$LocalIPs\",dst!~\"($ExcludedServers)|($LocalIPs)\",proto=~\"$Protos\",service=~\"$Services\"}[$__interval]))",
          "interval": "",
          "legendFormat": "{{ src }} (Up)",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Network Traffic (By Local IP Address)",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "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
      }
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 12
      },
      "hiddenSeries": false,
      "id": 136,
      "interval": "30s",
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": false,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/.*\\(Down\\).*/",
          "transform": "negative-Y"
        }
      ],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum by(dst) (increase(ntm_bytes_total{dst=~\"$LocalIPs\",src!~\"($ExcludedServers)|($LocalIPs)\",proto=~\"$Protos\",service=~\"$Services\"}[$__interval]))",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{ dst }} (Down)",
          "refId": "A"
        },
        {
          "expr": "sum by(src) (increase(ntm_bytes_total{src=~\"$LocalIPs\",dst!~\"($ExcludedServers)|($LocalIPs)\",proto=~\"$Protos\",service=~\"$Services\"}[$__interval]))",
          "interval": "",
          "legendFormat": "{{ src }} (Up)",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Bytes Transferred (by Local IP)",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "decbytes",
          "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
      }
    },
    {
      "aliasColors": {},
      "bars": true,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 21
      },
      "hiddenSeries": false,
      "id": 93,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": false,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/.*\\(Down\\).*/",
          "transform": "negative-Y"
        }
      ],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum by(src) (topk(10, increase(ntm_bytes_total{dst=~\"$LocalIPs\",src!~\"($ExcludedServers)|($LocalIPs)\",proto=~\"$Protos\",service=~\"$Services\"}[$__interval]) > 0))",
          "interval": "30s",
          "legendFormat": "{{ src }} (Down)",
          "refId": "A"
        },
        {
          "expr": "sum by(dst) (topk(10, increase(ntm_bytes_total{src=~\"$LocalIPs\",dst!~\"($ExcludedServers)|($LocalIPs)\",proto=~\"$Protos\",service=~\"$Services\"}[$__interval]) > 0))",
          "interval": "30s",
          "legendFormat": "{{ dst }} (Up)",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Bytes Transferred (by Server)",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "decbytes",
          "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
      }
    },
    {
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 30
      },
      "id": 6,
      "options": {
        "displayMode": "lcd",
        "fieldOptions": {
          "calcs": [
            "sum"
          ],
          "defaults": {
            "mappings": [],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "green",
                  "value": null
                }
              ]
            },
            "unit": "decbytes"
          },
          "overrides": [],
          "values": false
        },
        "orientation": "horizontal",
        "showUnfilled": true
      },
      "pluginVersion": "6.6.2",
      "targets": [
        {
          "expr": "topk(10, sum by(src) (increase(ntm_bytes_total{dst=~\"$LocalIPs\",src!~\"($ExcludedServers)|($LocalIPs)\",proto=~\"$Protos\",service=~\"$Services\"}[$__range])))",
          "instant": true,
          "legendFormat": "{{ src }}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Downloads (by Server)",
      "type": "bargauge"
    },
    {
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 30
      },
      "id": 4,
      "options": {
        "displayMode": "lcd",
        "fieldOptions": {
          "calcs": [
            "sum"
          ],
          "defaults": {
            "mappings": [],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "green",
                  "value": null
                }
              ]
            },
            "unit": "decbytes"
          },
          "overrides": [],
          "values": false
        },
        "orientation": "horizontal",
        "showUnfilled": true
      },
      "pluginVersion": "6.6.2",
      "targets": [
        {
          "expr": "topk(10, sum by(dst) (increase(ntm_bytes_total{src=~\"$LocalIPs\",dst!~\"($ExcludedServers)|($LocalIPs)\",proto=~\"$Protos\",service=~\"$Services\"}[$__range])))",
          "instant": true,
          "legendFormat": "{{ dst }}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Uploads (by Server)",
      "type": "bargauge"
    },
    {
      "collapsed": true,
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 38
      },
      "id": 8,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 7,
            "w": 24,
            "x": 0,
            "y": 28
          },
          "hiddenSeries": false,
          "id": 12,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null as zero",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "scopedVars": {
            "LocalIPs": {
              "selected": false,
              "text": "192.168.0.10",
              "value": "192.168.0.10"
            }
          },
          "seriesOverrides": [
            {
              "alias": "/Down/",
              "transform": "negative-Y"
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "sum by(dst) (rate(ntm_bytes_total{dst=~\"$LocalIPs\",src!~\"($ExcludedServers)|($LocalIPs)\",proto=~\"$Protos\",service=~\"$Services\"}[1m]))",
              "legendFormat": "{{ server }} (Down)",
              "refId": "A"
            },
            {
              "expr": "sum by(src) (rate(ntm_bytes_total{src=~\"$LocalIPs\",dst!~\"($ExcludedServers)|($LocalIPs)\",proto=~\"$Protos\",service=~\"$Services\"}[1m]))",
              "legendFormat": "{{ client }} (Up)",
              "refId": "B"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Throughput",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "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
          }
        }
      ],
      "repeat": "LocalIPs",
      "title": "$LocalIPs",
      "type": "row"
    }
  ],
  "refresh": "30s",
  "schemaVersion": 22,
  "style": "light",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(ntm_bytes_total, src)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "LocalIPs",
        "options": [],
        "query": "label_values(ntm_bytes_total, src)",
        "refresh": 2,
        "regex": "/^((127\\.\\d+\\.)|(10\\.\\d+\\.)|(172\\.1[6-9]\\.)|(172\\.2[0-9]\\.)|(172\\.3[0-1]\\.)|(192\\.168\\.)\\d+\\.\\d+)$/",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(ntm_bytes_total, service)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "Services",
        "options": [],
        "query": "label_values(ntm_bytes_total, service)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(ntm_bytes_total, proto)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "Protos",
        "options": [],
        "query": "label_values(ntm_bytes_total, proto)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {
          "text": "",
          "value": ""
        },
        "hide": 0,
        "label": null,
        "name": "ExcludedServers",
        "options": [
          {
            "selected": false,
            "text": "(den\\\\d|.*speedtest|1e100\\\\.net).*",
            "value": "(den\\\\d|.*speedtest|1e100\\\\.net).*"
          }
        ],
        "query": "",
        "skipUrlSync": false,
        "type": "textbox"
      }
    ]
  },
  "time": {
    "from": "now-3h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Network Traffic",
  "uid": "CfEaYZCZz",
  "version": 18
}