{
  "uid": "zadran-lab",
  "title": "Zadran Lab – Overview",
  "tags": [
    "overview",
    "homelab"
  ],
  "timezone": "browser",
  "editable": true,
  "graphTooltip": 1,
  "refresh": "1m",
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "schemaVersion": 39,
  "version": 6,
  "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": "🚦 Status",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 0,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 2,
      "type": "alertlist",
      "title": "Active alerts",
      "gridPos": {
        "x": 0,
        "y": 1,
        "w": 9,
        "h": 9
      },
      "description": "Firing and pending alerts from Homelab Alerts. Empty = all good.",
      "options": {
        "viewMode": "list",
        "groupMode": "default",
        "groupBy": [],
        "maxItems": 20,
        "sortOrder": 1,
        "dashboardAlerts": false,
        "alertName": "",
        "alertInstanceLabelFilter": "",
        "showInstances": true,
        "folder": null,
        "stateFilter": {
          "firing": true,
          "pending": true,
          "noData": false,
          "normal": false,
          "error": true,
          "recovering": true
        }
      }
    },
    {
      "id": 3,
      "type": "stat",
      "title": "Servers",
      "description": "Linux servers (node_exporter) and Windows servers (windows_exporter).",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 9,
        "y": 1,
        "w": 15,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "up{job=~\"node|windows\"}",
          "legendFormat": "{{host}}",
          "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": [
          {
            "matcher": {
              "id": "byName",
              "options": "nas-backup"
            },
            "properties": [
              {
                "id": "mappings",
                "value": [
                  {
                    "type": "value",
                    "options": {
                      "0": {
                        "text": "Sleeping",
                        "color": "blue"
                      },
                      "1": {
                        "text": "Online",
                        "color": "green"
                      }
                    }
                  }
                ]
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "blue",
                      "value": null
                    },
                    {
                      "color": "green",
                      "value": 1
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 4,
      "type": "stat",
      "title": "Targets down",
      "description": "Everything Prometheus scrapes that is not answering. Hosts that are switched off on purpose also count here.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 9,
        "y": 5,
        "w": 3,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "count(up == 0) or vector(0)",
          "legendFormat": "Down",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 1
              }
            ]
          },
          "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": 5,
      "type": "stat",
      "title": "Windows services",
      "description": "Critical services on DC1 and CM01 (AD, DNS, Kerberos, SCCM, SQL, IIS, WSUS). Shows how many are stopped.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 5,
        "w": 3,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum((windows_service_state{state=\"running\"} == bool 0) and on(instance, name) (windows_service_start_mode{start_mode=\"auto\"} == 1)) or vector(0)",
          "legendFormat": "Stopped",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 1
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "type": "value",
              "options": {
                "0": {
                  "text": "All OK",
                  "color": "green"
                }
              }
            }
          ]
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 6,
      "type": "stat",
      "title": "VMs & containers",
      "description": "All guests on proxmox and pve2. Stopped includes the old PBS VM 116, which goes away in the Phase 8 cleanup.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 15,
        "y": 5,
        "w": 5,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "count(pve_up{id=~\"(qemu|lxc)/.*\"} == 1) or vector(0)",
          "legendFormat": "Running",
          "refId": "A",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "count(pve_up{id=~\"(qemu|lxc)/.*\"} == 0) or vector(0)",
          "legendFormat": "Stopped",
          "refId": "B",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": []
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Stopped"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "text"
                }
              }
            ]
          }
        ]
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 7,
      "type": "stat",
      "title": "ZFS pools",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 20,
        "y": 5,
        "w": 4,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "zpool_healthy",
          "legendFormat": "{{host}} · {{pool}}",
          "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": "Problem",
                  "color": "red"
                },
                "1": {
                  "text": "Healthy",
                  "color": "green"
                }
              }
            }
          ]
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "value",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "horizontal",
        "wideLayout": true,
        "text": {
          "titleSize": 12,
          "valueSize": 14
        }
      }
    },
    {
      "id": 8,
      "type": "row",
      "title": "🌐 Services (Uptime Kuma)",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 10,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 9,
      "type": "stat",
      "title": "Family services",
      "description": "Live status from Uptime Kuma (checked every 60 s). Uptime Kuma also sends its own ntfy alerts.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 11,
        "w": 10,
        "h": 6
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "monitor_status{monitor_name=~\"Nextcloud.*|Home Assistant|Jellyfin|Immich\"}",
          "legendFormat": "{{monitor_name}}",
          "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": "Up",
                  "color": "green"
                },
                "2": {
                  "text": "Pending",
                  "color": "orange"
                },
                "3": {
                  "text": "Maintenance",
                  "color": "blue"
                }
              }
            }
          ]
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true,
        "text": {
          "titleSize": 14,
          "valueSize": 18
        }
      }
    },
    {
      "id": 10,
      "type": "stat",
      "title": "Infrastructure",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 10,
        "y": 11,
        "w": 14,
        "h": 6
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "monitor_status{monitor_name!~\"Nextcloud.*|Home Assistant|Jellyfin|Immich\"}",
          "legendFormat": "{{monitor_name}}",
          "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": "Up",
                  "color": "green"
                },
                "2": {
                  "text": "Pending",
                  "color": "orange"
                },
                "3": {
                  "text": "Maintenance",
                  "color": "blue"
                }
              }
            }
          ]
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true,
        "text": {
          "titleSize": 11,
          "valueSize": 14
        }
      }
    },
    {
      "id": 11,
      "type": "timeseries",
      "title": "Response time (family services)",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 17,
        "w": 24,
        "h": 6
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "monitor_response_time{monitor_name=~\"Nextcloud.*|Home Assistant|Jellyfin|Immich\"}",
          "legendFormat": "{{monitor_name}}",
          "refId": "A",
          "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": 12,
      "type": "row",
      "title": "🖥️ Servers",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 23,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 13,
      "type": "bargauge",
      "title": "CPU",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 24,
        "w": 6,
        "h": 7
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "(100 - avg by (host) (rate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100) or (100 - avg by (host) (rate(windows_cpu_time_total{mode=\"idle\"}[5m])) * 100)",
          "legendFormat": "{{host}}",
          "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"
          },
          "min": 0,
          "max": 100
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "orientation": "horizontal",
        "displayMode": "gradient",
        "showUnfilled": true,
        "valueMode": "color",
        "namePlacement": "left",
        "sizing": "auto"
      }
    },
    {
      "id": 14,
      "type": "bargauge",
      "title": "RAM used by apps",
      "description": "Real memory use. On TrueNAS the ZFS read cache (ARC) counts as free. On CM01, SQL Server keeps lots of RAM on purpose.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 6,
        "y": 24,
        "w": 6,
        "h": 7
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "100 * (1 - (node_memory_MemAvailable_bytes + (node_zfs_arc_size or 0 * node_memory_MemAvailable_bytes)) / node_memory_MemTotal_bytes) or 100 * (1 - windows_memory_available_bytes / windows_memory_physical_total_bytes)",
          "legendFormat": "{{host}}",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 85
              },
              {
                "color": "red",
                "value": 95
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "min": 0,
          "max": 100
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "orientation": "horizontal",
        "displayMode": "gradient",
        "showUnfilled": true,
        "valueMode": "color",
        "namePlacement": "left",
        "sizing": "auto"
      }
    },
    {
      "id": 15,
      "type": "bargauge",
      "title": "System disk (/ or C:)",
      "description": "Proxmox root disk and Windows C:. The TrueNAS system disks are the boot-pools under Storage.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 24,
        "w": 6,
        "h": 7
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "max by (host) (100 * (1 - node_filesystem_avail_bytes{host=~\"proxmox|pve2\", mountpoint=\"/\", fstype!~\"tmpfs|overlay\"} / node_filesystem_size_bytes{host=~\"proxmox|pve2\", mountpoint=\"/\", fstype!~\"tmpfs|overlay\"})) or 100 * (1 - windows_logical_disk_free_bytes{volume=\"C:\"} / windows_logical_disk_size_bytes{volume=\"C:\"})",
          "legendFormat": "{{host}}",
          "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"
          },
          "min": 0,
          "max": 100
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "orientation": "horizontal",
        "displayMode": "gradient",
        "showUnfilled": true,
        "valueMode": "color",
        "namePlacement": "left",
        "sizing": "auto"
      }
    },
    {
      "id": 16,
      "type": "bargauge",
      "title": "Temperatures",
      "description": "Hottest CPU core and hottest NVMe sensor per physical host (VMs have no sensors). CPU: orange 80 °C, red 90 °C. NVMe: orange 70 °C, red 80 °C (drives throttle around 80–85 °C). Alert above 85 °C.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 18,
        "y": 24,
        "w": 6,
        "h": 7
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "max by (host) (node_hwmon_temp_celsius{chip=~\".*coretemp.*\"})",
          "legendFormat": "{{host}} CPU",
          "refId": "A",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "max by (host) (node_hwmon_temp_celsius{chip=~\"nvme.*\"})",
          "legendFormat": "{{host}} NVMe",
          "refId": "B",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "celsius",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 80
              },
              {
                "color": "red",
                "value": 90
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "min": 0,
          "max": 100
        },
        "overrides": [
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".* NVMe"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "orange",
                      "value": 70
                    },
                    {
                      "color": "red",
                      "value": 80
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "orientation": "horizontal",
        "displayMode": "gradient",
        "showUnfilled": true,
        "valueMode": "color",
        "namePlacement": "left",
        "sizing": "auto",
        "text": {
          "titleSize": 11,
          "valueSize": 13
        }
      }
    },
    {
      "id": 17,
      "type": "timeseries",
      "title": "Network traffic per server (in + out)",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 31,
        "w": 16,
        "h": 7
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum by (host) (rate(node_network_receive_bytes_total{device!~\"lo|veth.*|tap.*|fwbr.*|fwpr.*|fwln.*|docker.*|br-.*|vmbr.*\"}[5m]) + rate(node_network_transmit_bytes_total{device!~\"lo|veth.*|tap.*|fwbr.*|fwpr.*|fwln.*|docker.*|br-.*|vmbr.*\"}[5m])) * 8 or sum by (host) (rate(windows_net_bytes_total[5m])) * 8",
          "legendFormat": "{{host}}",
          "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": 18,
      "type": "stat",
      "title": "Uptime",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 16,
        "y": 31,
        "w": 8,
        "h": 7
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "time() - node_boot_time_seconds or time() - windows_system_boot_time_timestamp",
          "legendFormat": "{{host}}",
          "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": "none",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "horizontal",
        "wideLayout": true,
        "text": {
          "titleSize": 16,
          "valueSize": 20
        }
      }
    },
    {
      "id": 19,
      "type": "row",
      "title": "💾 Storage",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 38,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 20,
      "type": "bargauge",
      "title": "Pool usage",
      "description": "Alert above 80 %. ZFS slows down when pools get full.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 39,
        "w": 12,
        "h": 6
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "zpool_capacity_percent",
          "legendFormat": "{{host}} · {{pool}}",
          "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": 80
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "min": 0,
          "max": 100
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "orientation": "horizontal",
        "displayMode": "gradient",
        "showUnfilled": true,
        "valueMode": "color",
        "namePlacement": "left",
        "sizing": "auto"
      }
    },
    {
      "id": 21,
      "type": "bargauge",
      "title": "Free space",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 39,
        "w": 12,
        "h": 6
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "zpool_free_bytes",
          "legendFormat": "{{host}} · {{pool}}",
          "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"
      }
    },
    {
      "id": 22,
      "type": "row",
      "title": "📶 Network (UniFi)",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 45,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 23,
      "type": "stat",
      "title": "Clients",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 46,
        "w": 12,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "count(unpoller_client_uptime_seconds) or vector(0)",
          "legendFormat": "Total",
          "refId": "A",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "count(unpoller_client_uptime_seconds{wired=\"false\"}) or vector(0)",
          "legendFormat": "Wi-Fi",
          "refId": "B",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "count(unpoller_client_uptime_seconds{wired=\"true\"}) or vector(0)",
          "legendFormat": "Wired",
          "refId": "C",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "count(unpoller_client_uptime_seconds{wired=\"false\", essid=~\"(?i).*guest.*\"}) or vector(0)",
          "legendFormat": "Guests",
          "refId": "D",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "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_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 24,
      "type": "stat",
      "title": "UniFi devices",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 46,
        "w": 12,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "count(changes(unpoller_device_uptime_seconds[5m]) > 0) or vector(0)",
          "legendFormat": "Online",
          "refId": "A",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "count(changes(unpoller_device_uptime_seconds[5m]) < 1) or vector(0)",
          "legendFormat": "Offline",
          "refId": "B",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": []
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Offline"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "red",
                      "value": 1
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 25,
      "type": "row",
      "title": "🏠 Home",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 51,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 26,
      "type": "stat",
      "title": "Temperature",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 52,
        "w": 12,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.h5075_5299_temperature\"}",
          "legendFormat": "Living room",
          "refId": "A",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_bedroom_temperature\"}",
          "legendFormat": "Bedroom",
          "refId": "B",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_kitchen_temperature\"}",
          "legendFormat": "Kitchen",
          "refId": "C",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_network_rack_temperature\"}",
          "legendFormat": "Network rack",
          "refId": "D",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_outdoor_temperature\"}",
          "legendFormat": "Outdoor",
          "refId": "E",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "celsius",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              },
              {
                "color": "green",
                "value": 18
              },
              {
                "color": "orange",
                "value": 26
              },
              {
                "color": "red",
                "value": 30
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 27,
      "type": "stat",
      "title": "CO₂",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 52,
        "w": 3,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.alpstuga_air_quality_monitor_carbon_dioxide\"}",
          "legendFormat": "Living room",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "ppm",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "yellow",
                "value": 800
              },
              {
                "color": "orange",
                "value": 1200
              },
              {
                "color": "red",
                "value": 1500
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0,
          "noValue": "Offline"
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 28,
      "type": "stat",
      "title": "Plugs now",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 15,
        "y": 52,
        "w": 3,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(hass_sensor_power_w{entity=~\"sensor.smart_plug_.*\"})",
          "legendFormat": "Total",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "watt",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 500
              },
              {
                "color": "red",
                "value": 1500
              }
            ]
          },
          "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": 29,
      "type": "stat",
      "title": "Energy this month",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 18,
        "y": 52,
        "w": 3,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(increase(hass_sensor_energy_kwh{entity=~\"sensor.smart_plug_.*_energy|sensor.smart_plug_desk_total_consumption\"}[$__range]))",
          "legendFormat": "Total",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "kwatth",
          "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": 30,
      "type": "stat",
      "title": "UPS battery",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 21,
        "y": 52,
        "w": 3,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=~\"sensor.ugreen_(usp_)?battery_charge\"}",
          "legendFormat": "{{friendly_name}}",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 50
              },
              {
                "color": "green",
                "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
      }
    }
  ]
}
