{
  "uid": "internet-pfsense",
  "title": "Internet & pfSense",
  "tags": [
    "network",
    "pfsense",
    "internet"
  ],
  "timezone": "browser",
  "editable": true,
  "graphTooltip": 1,
  "refresh": "1m",
  "time": {
    "from": "now-24h",
    "to": "now"
  },
  "schemaVersion": 39,
  "version": 1,
  "links": [
    {
      "title": "All dashboards",
      "type": "dashboards",
      "asDropdown": true,
      "includeVars": false,
      "keepTime": true,
      "tags": [],
      "targetBlank": false,
      "icon": "external link"
    }
  ],
  "templating": {
    "list": []
  },
  "annotations": {
    "list": []
  },
  "panels": [
    {
      "id": 1,
      "type": "row",
      "title": "🌍 Internet right now",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 0,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 2,
      "type": "stat",
      "title": "Download now",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 1,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(rate(node_network_receive_bytes_total{host=\"pfsense\", iface=\"WAN\"}[2m])) * 8",
          "legendFormat": "Download",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bps",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 3,
      "type": "stat",
      "title": "Upload now",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 4,
        "y": 1,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(rate(node_network_transmit_bytes_total{host=\"pfsense\", iface=\"WAN\"}[2m])) * 8",
          "legendFormat": "Upload",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bps",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "purple",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 4,
      "type": "stat",
      "title": "Downloaded today",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 8,
        "y": 1,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(node_network_receive_bytes_total{host=\"pfsense\", iface=\"WAN\"}[$__range]))",
          "legendFormat": "Downloaded today",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/d",
      "hideTimeOverride": true
    },
    {
      "id": 5,
      "type": "stat",
      "title": "Uploaded today",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 1,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(node_network_transmit_bytes_total{host=\"pfsense\", iface=\"WAN\"}[$__range]))",
          "legendFormat": "Uploaded today",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "purple",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/d",
      "hideTimeOverride": true
    },
    {
      "id": 6,
      "type": "stat",
      "title": "Downloaded this month",
      "description": "Since the 1st of this month, 00:00.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 16,
        "y": 1,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(node_network_receive_bytes_total{host=\"pfsense\", iface=\"WAN\"}[$__range]))",
          "legendFormat": "Downloaded this month",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/M",
      "hideTimeOverride": true
    },
    {
      "id": 7,
      "type": "stat",
      "title": "Uploaded this month",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 20,
        "y": 1,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(node_network_transmit_bytes_total{host=\"pfsense\", iface=\"WAN\"}[$__range]))",
          "legendFormat": "Uploaded this month",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "purple",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/M",
      "hideTimeOverride": true
    },
    {
      "id": 8,
      "type": "timeseries",
      "title": "WAN traffic",
      "description": "Traffic on the pfSense WAN port, the same data your provider counts.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 5,
        "w": 24,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(rate(node_network_receive_bytes_total{host=\"pfsense\", iface=\"WAN\"}[2m])) * 8",
          "legendFormat": "Download",
          "refId": "A",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(rate(node_network_transmit_bytes_total{host=\"pfsense\", iface=\"WAN\"}[2m])) * 8",
          "legendFormat": "Upload",
          "refId": "B",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bps",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "fillOpacity": 10,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "none",
              "group": "A"
            }
          },
          "min": 0
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Upload"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "purple"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Download"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Upload"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "transparent",
                      "value": null
                    },
                    {
                      "color": "purple",
                      "value": 77000000.0
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "lastNotNull",
            "min",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 9,
      "type": "row",
      "title": "📡 ISP report card",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 13,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 10,
      "type": "stat",
      "title": "Internet",
      "description": "Online while at least one of Cloudflare (1.1.1.1), Google (8.8.8.8) or Quad9 (9.9.9.9) answers a ping. Checked every 30 s.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 14,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "max(probe_success{job=\"isp-ping\", probe=\"internet\"})",
          "legendFormat": "Internet",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "green",
                "value": 1
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "type": "value",
              "options": {
                "0": {
                  "text": "DOWN",
                  "color": "red"
                },
                "1": {
                  "text": "Online",
                  "color": "green"
                }
              }
            }
          ]
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 11,
      "type": "stat",
      "title": "Availability this month",
      "description": "Share of 30-second checks this month in which the internet answered.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 4,
        "y": 14,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "100 * avg_over_time((max(probe_success{job=\"isp-ping\", probe=\"internet\"}))[$__range:30s])",
          "legendFormat": "Availability",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 99
              },
              {
                "color": "green",
                "value": 99.9
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 3
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/M",
      "hideTimeOverride": true
    },
    {
      "id": 12,
      "type": "stat",
      "title": "Outages this month",
      "description": "How many times the internet went down (all three targets silent at once).",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 8,
        "y": 14,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum_over_time(((max(probe_success{job=\"isp-ping\", probe=\"internet\"}) == bool 0) > bool (max(probe_success{job=\"isp-ping\", probe=\"internet\"} offset 30s) == bool 0))[$__range:30s])",
          "legendFormat": "Outages",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 1
              },
              {
                "color": "red",
                "value": 5
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/M",
      "hideTimeOverride": true
    },
    {
      "id": 13,
      "type": "stat",
      "title": "Downtime this month",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 14,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum_over_time((max(probe_success{job=\"isp-ping\", probe=\"internet\"}) == bool 0)[$__range:30s]) * 30",
          "legendFormat": "Downtime",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "s",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 60
              },
              {
                "color": "red",
                "value": 1800
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/M",
      "hideTimeOverride": true
    },
    {
      "id": 14,
      "type": "stat",
      "title": "Ping now",
      "description": "Average round trip to the three internet targets.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 16,
        "y": 14,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "avg(probe_icmp_duration_seconds{job=\"isp-ping\", probe=\"internet\", phase=\"rtt\"}) * 1000",
          "legendFormat": "Ping",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "ms",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 40
              },
              {
                "color": "red",
                "value": 100
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 15,
      "type": "stat",
      "title": "Packet loss (24 h)",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 20,
        "y": 14,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "100 * (1 - avg(avg_over_time(probe_success{job=\"isp-ping\", probe=\"internet\"}[24h])))",
          "legendFormat": "Loss",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 1
              },
              {
                "color": "red",
                "value": 5
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 2
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 16,
      "type": "timeseries",
      "title": "Ping to the internet",
      "description": "If only the internet targets get slow, the problem is at your provider. If pfSense gets slow too, it is inside the house.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 18,
        "w": 12,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "probe_icmp_duration_seconds{job=\"isp-ping\", probe=\"internet\", phase=\"rtt\"} * 1000",
          "legendFormat": "{{instance}}",
          "refId": "A",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "probe_icmp_duration_seconds{job=\"isp-ping\", probe=\"pfsense\", phase=\"rtt\"} * 1000",
          "legendFormat": "pfSense (home network)",
          "refId": "B",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "ms",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "fillOpacity": 10,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "none",
              "group": "A"
            }
          },
          "min": 0
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "lastNotNull",
            "min",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 17,
      "type": "state-timeline",
      "title": "Internet up / down",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 18,
        "w": 12,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "max(probe_success{job=\"isp-ping\", probe=\"internet\"})",
          "legendFormat": "Internet",
          "refId": "A",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "green",
                "value": 1
              }
            ]
          },
          "mappings": [
            {
              "type": "value",
              "options": {
                "0": {
                  "text": "Down",
                  "color": "red"
                },
                "1": {
                  "text": "Up",
                  "color": "green"
                }
              }
            }
          ],
          "custom": {
            "fillOpacity": 80,
            "lineWidth": 0
          }
        },
        "overrides": []
      },
      "options": {
        "showValue": "never",
        "mergeValues": true,
        "alignValue": "left",
        "rowHeight": 0.8,
        "legend": {
          "showLegend": false
        },
        "tooltip": {
          "mode": "single"
        }
      },
      "description": "Red stripes are outages. Zoom out to 7 or 30 days to see the history."
    },
    {
      "id": 18,
      "type": "stat",
      "title": "Last test: download",
      "description": "Green from 80 % of your contract (777 Mbit/s), red below 50 %.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 26,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "(speedtest_download_bits_per_second > 0)",
          "legendFormat": "Download",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bps",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 388500000.0
              },
              {
                "color": "green",
                "value": 621600000.0
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 19,
      "type": "stat",
      "title": "Last test: upload",
      "description": "Contract: 77 Mbit/s.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 4,
        "y": 26,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "(speedtest_upload_bits_per_second > 0)",
          "legendFormat": "Upload",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bps",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 38500000.0
              },
              {
                "color": "green",
                "value": 61600000.0
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 20,
      "type": "stat",
      "title": "Last test: ping",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 8,
        "y": 26,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "speedtest_ping_latency_milliseconds and speedtest_success == 1",
          "legendFormat": "Ping",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "ms",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 40
              },
              {
                "color": "red",
                "value": 100
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 21,
      "type": "stat",
      "title": "Last test",
      "description": "Tests run at 08:00, 14:00 and 20:00. Each test uses roughly 0.5-2 GB, which also shows up in the data totals.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 26,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "speedtest_last_success_timestamp_seconds * 1000",
          "legendFormat": "When",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "dateTimeFromNow",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": []
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 22,
      "type": "stat",
      "title": "Average download this month",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 16,
        "y": 26,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "avg_over_time((speedtest_download_bits_per_second > 0)[$__range:5m])",
          "legendFormat": "Avg",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bps",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 388500000.0
              },
              {
                "color": "green",
                "value": 621600000.0
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/M",
      "hideTimeOverride": true
    },
    {
      "id": 23,
      "type": "stat",
      "title": "Slowest download this month",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 20,
        "y": 26,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "min_over_time((speedtest_download_bits_per_second > 0)[$__range:5m])",
          "legendFormat": "Min",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bps",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 388500000.0
              },
              {
                "color": "green",
                "value": 621600000.0
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/M",
      "hideTimeOverride": true
    },
    {
      "id": 24,
      "type": "timeseries",
      "title": "Speed tests (last 30 days)",
      "description": "Each step is one test. Dashed lines: your contract speeds.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 30,
        "w": 24,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "(speedtest_download_bits_per_second > 0)",
          "legendFormat": "Download",
          "refId": "A",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "(speedtest_upload_bits_per_second > 0)",
          "legendFormat": "Upload",
          "refId": "B",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bps",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "fillOpacity": 10,
            "showPoints": "always",
            "spanNulls": true,
            "stacking": {
              "mode": "none",
              "group": "A"
            },
            "lineInterpolation": "stepAfter",
            "pointSize": 5,
            "thresholdsStyle": {
              "mode": "dashed"
            }
          },
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "transparent",
                "value": null
              },
              {
                "color": "blue",
                "value": 777000000.0
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Upload"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "purple"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Download"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Upload"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "transparent",
                      "value": null
                    },
                    {
                      "color": "purple",
                      "value": 77000000.0
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "lastNotNull",
            "mean",
            "min",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "timeFrom": "now-30d",
      "hideTimeOverride": true
    },
    {
      "id": 25,
      "type": "row",
      "title": "📅 Data per month",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 38,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 26,
      "type": "stat",
      "title": "Last month: download",
      "description": "The whole previous calendar month.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 39,
        "w": 6,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(node_network_receive_bytes_total{host=\"pfsense\", iface=\"WAN\"}[$__range]))",
          "legendFormat": "Last month: download",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/M",
      "hideTimeOverride": true,
      "timeShift": "1M/M"
    },
    {
      "id": 27,
      "type": "stat",
      "title": "Last month: upload",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 6,
        "y": 39,
        "w": 6,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(node_network_transmit_bytes_total{host=\"pfsense\", iface=\"WAN\"}[$__range]))",
          "legendFormat": "Last month: upload",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "purple",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/M",
      "hideTimeOverride": true,
      "timeShift": "1M/M"
    },
    {
      "id": 28,
      "type": "stat",
      "title": "Average download per day",
      "description": "Average of the last 30 days. Days before monitoring started are left out, so it is right from the first day.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 39,
        "w": 6,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "avg_over_time((sum(increase(node_network_receive_bytes_total{host=\"pfsense\", iface=\"WAN\"}[1d])))[30d:1d])",
          "legendFormat": "Avg",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 29,
      "type": "stat",
      "title": "Total this year (down + up)",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 18,
        "y": 39,
        "w": 6,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(node_network_receive_bytes_total{host=\"pfsense\", iface=\"WAN\"}[$__range])) + sum(increase(node_network_transmit_bytes_total{host=\"pfsense\", iface=\"WAN\"}[$__range]))",
          "legendFormat": "Total this year (down + up)",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/y",
      "hideTimeOverride": true
    },
    {
      "id": 30,
      "type": "barchart",
      "title": "Data per month (last 12 months)",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "description": "Calendar months. Prometheus keeps 2 years of data, so up to 24 months can be shown. Older months appear if you imported your pfSense Traffic Totals (vnstat) history, see Part 6. Units are GiB, the same as pfSense shows.",
      "gridPos": {
        "x": 0,
        "y": 43,
        "w": 12,
        "h": 9
      },
      "timeFrom": "now-11M/M",
      "hideTimeOverride": true,
      "interval": "1d",
      "maxDataPoints": 400,
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(node_network_receive_bytes_total{host=\"pfsense\", iface=\"WAN\"}[1d] offset -1d))",
          "legendFormat": "Download",
          "refId": "A",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(node_network_transmit_bytes_total{host=\"pfsense\", iface=\"WAN\"}[1d] offset -1d))",
          "legendFormat": "Upload",
          "refId": "B",
          "range": true,
          "instant": false
        }
      ],
      "transformations": [
        {
          "id": "joinByField",
          "options": {
            "byField": "Time",
            "mode": "outer"
          }
        },
        {
          "id": "formatTime",
          "options": {
            "timeField": "Time",
            "outputFormat": "YYYY-MM",
            "useTimezone": true
          }
        },
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "Time": {
                "operation": "groupby",
                "aggregations": []
              },
              "Download": {
                "operation": "aggregate",
                "aggregations": [
                  "sum"
                ]
              },
              "Upload": {
                "operation": "aggregate",
                "aggregations": [
                  "sum"
                ]
              }
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "renameByName": {
              "Download (sum)": "Download",
              "Upload (sum)": "Upload",
              "Time": "Month"
            }
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes",
          "decimals": 0,
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "fillOpacity": 80,
            "lineWidth": 0
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Upload"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "purple"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Download"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Upload"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "transparent",
                      "value": null
                    },
                    {
                      "color": "purple",
                      "value": 77000000.0
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "options": {
        "stacking": "none",
        "showValue": "auto",
        "xField": "Month",
        "groupWidth": 0.7,
        "barWidth": 0.9,
        "orientation": "auto",
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 31,
      "type": "timeseries",
      "title": "Data per day (last 30 days)",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 43,
        "w": 12,
        "h": 9
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(node_network_receive_bytes_total{host=\"pfsense\", iface=\"WAN\"}[1d] offset -1d))",
          "legendFormat": "Download",
          "refId": "A",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(node_network_transmit_bytes_total{host=\"pfsense\", iface=\"WAN\"}[1d] offset -1d))",
          "legendFormat": "Upload",
          "refId": "B",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "bars",
            "lineWidth": 1,
            "fillOpacity": 80,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "none",
              "group": "A"
            }
          },
          "min": 0
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Upload"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "purple"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Download"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Upload"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "transparent",
                      "value": null
                    },
                    {
                      "color": "purple",
                      "value": 77000000.0
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "calcs": [
            "sum",
            "mean",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "timeFrom": "now-30d/d",
      "hideTimeOverride": true,
      "interval": "1d"
    },
    {
      "id": 32,
      "type": "row",
      "title": "🕒 When is the internet used",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 52,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 33,
      "type": "timeseries",
      "title": "Data per hour (last 7 days)",
      "description": "Each bar is one hour. Evenings, weekends and big downloads (updates, backups to the cloud) stand out.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 53,
        "w": 24,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(node_network_receive_bytes_total{host=\"pfsense\", iface=\"WAN\"}[1h] offset -1h))",
          "legendFormat": "Download",
          "refId": "A",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(node_network_transmit_bytes_total{host=\"pfsense\", iface=\"WAN\"}[1h] offset -1h))",
          "legendFormat": "Upload",
          "refId": "B",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "bars",
            "lineWidth": 1,
            "fillOpacity": 80,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "none",
              "group": "A"
            }
          },
          "min": 0
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Upload"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "purple"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Download"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Upload"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "transparent",
                      "value": null
                    },
                    {
                      "color": "purple",
                      "value": 77000000.0
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "calcs": [
            "sum",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "timeFrom": "now-7d/d",
      "hideTimeOverride": true,
      "interval": "1h"
    },
    {
      "id": 34,
      "type": "row",
      "title": "🔀 Traffic per network (pfSense interfaces)",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 61,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 35,
      "type": "bargauge",
      "title": "This month per network (in + out)",
      "description": "LAN counts all inside traffic, including the VLANs. VLAN 10 and VLAN 20 are also shown on their own.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 62,
        "w": 8,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum by (iface) (increase(node_network_receive_bytes_total{host=\"pfsense\", iface=~\".+\"}[$__range]) + increase(node_network_transmit_bytes_total{host=\"pfsense\", iface=~\".+\"}[$__range]))",
          "legendFormat": "{{iface}}",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bytes",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "min": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "orientation": "horizontal",
        "displayMode": "gradient",
        "showUnfilled": true,
        "valueMode": "color",
        "namePlacement": "left",
        "sizing": "auto"
      },
      "timeFrom": "now/M",
      "hideTimeOverride": true
    },
    {
      "id": 36,
      "type": "timeseries",
      "title": "Live traffic per network (in + out)",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 8,
        "y": 62,
        "w": 16,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum by (iface) (rate(node_network_receive_bytes_total{host=\"pfsense\", iface=~\".+\"}[2m]) + rate(node_network_transmit_bytes_total{host=\"pfsense\", iface=~\".+\"}[2m])) * 8",
          "legendFormat": "{{iface}}",
          "refId": "A",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "bps",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "fillOpacity": 10,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "none",
              "group": "A"
            }
          },
          "min": 0
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "lastNotNull",
            "min",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 37,
      "type": "row",
      "title": "🛡️ pfSense health",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 70,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 38,
      "type": "stat",
      "title": "pfSense",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 71,
        "w": 4,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "up{job=\"pfsense\"}",
          "legendFormat": "pfSense",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "green",
                "value": 1
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "type": "value",
              "options": {
                "0": {
                  "text": "Offline",
                  "color": "red"
                },
                "1": {
                  "text": "Online",
                  "color": "green"
                }
              }
            }
          ]
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 39,
      "type": "stat",
      "title": "Uptime",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 4,
        "y": 71,
        "w": 4,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "time() - node_boot_time_seconds{host=\"pfsense\"}",
          "legendFormat": "Uptime",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "dtdurations",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": []
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 40,
      "type": "stat",
      "title": "CPU",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 8,
        "y": 71,
        "w": 4,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "100 - avg(rate(node_cpu_seconds_total{host=\"pfsense\", mode=\"idle\"}[5m])) * 100",
          "legendFormat": "CPU",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 70
              },
              {
                "color": "red",
                "value": 90
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 41,
      "type": "stat",
      "title": "Memory used",
      "description": "Active + wired memory (FreeBSD). Free, inactive and cache count as available.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 71,
        "w": 4,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "100 * (node_memory_active_bytes{host=\"pfsense\"} + node_memory_wired_bytes{host=\"pfsense\"}) / node_memory_size_bytes{host=\"pfsense\"}",
          "legendFormat": "RAM",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 80
              },
              {
                "color": "red",
                "value": 90
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 42,
      "type": "stat",
      "title": "Disk used",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 16,
        "y": 71,
        "w": 4,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "max(100 * (1 - node_filesystem_avail_bytes{host=\"pfsense\", mountpoint=\"/\"} / node_filesystem_size_bytes{host=\"pfsense\", mountpoint=\"/\"}))",
          "legendFormat": "Disk",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 75
              },
              {
                "color": "red",
                "value": 85
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 43,
      "type": "stat",
      "title": "WAN errors (24 h)",
      "description": "Damaged packets on the WAN port. A few are normal; many point to a cable or modem problem.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 20,
        "y": 71,
        "w": 4,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "(sum(increase(node_network_receive_errs_total{host=\"pfsense\", iface=\"WAN\"}[24h])) + sum(increase(node_network_transmit_errs_total{host=\"pfsense\", iface=\"WAN\"}[24h]))) or vector(0)",
          "legendFormat": "Errors",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 1
              },
              {
                "color": "red",
                "value": 100
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 44,
      "type": "timeseries",
      "title": "CPU and memory",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 76,
        "w": 24,
        "h": 6
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "100 - avg(rate(node_cpu_seconds_total{host=\"pfsense\", mode=\"idle\"}[5m])) * 100",
          "legendFormat": "CPU",
          "refId": "A",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "100 * (node_memory_active_bytes{host=\"pfsense\"} + node_memory_wired_bytes{host=\"pfsense\"}) / node_memory_size_bytes{host=\"pfsense\"}",
          "legendFormat": "Memory",
          "refId": "B",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "fillOpacity": 10,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "none",
              "group": "A"
            }
          },
          "min": 0
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "lastNotNull",
            "min",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    }
  ]
}