{
  "uid": "system-monitor-overview",
  "title": "System Monitor Overview",
  "timezone": "browser",
  "schemaVersion": 41,
  "version": 1,
  "refresh": "30s",
  "time": {"from": "now-3h", "to": "now"},
  "style": "dark",
  "tags": ["system-monitor"],
  "templating": {
    "list": [
      {
        "name": "datasource",
        "type": "datasource",
        "query": "prometheus",
        "current": {"text": "Prometheus", "value": "Prometheus"},
        "hide": 0
      }
    ]
  },
  "panels": [
    {"id": 1, "type": "row", "title": "OVERVIEW", "collapsed": false, "gridPos": {"h": 1, "w": 24, "x": 0, "y": 0}},
    {
      "id": 2, "type": "stat", "title": "Mem available %", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes * 100"}],
      "fieldConfig": {"defaults": {"unit": "percent", "thresholds": {"mode": "absolute", "steps": [{"color": "red"}, {"color": "yellow", "value": 8}, {"color": "green", "value": 15}]}}, "overrides": []},
      "options": {"colorMode": "background", "graphMode": "area", "reduceOptions": {"calcs": ["lastNotNull"], "values": false}},
      "gridPos": {"h": 4, "w": 3, "x": 0, "y": 1}
    },
    {
      "id": 3, "type": "stat", "title": "Swap used %", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "(1 - node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes) * 100"}],
      "fieldConfig": {"defaults": {"unit": "percent", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "yellow", "value": 80}, {"color": "red", "value": 90}]}}, "overrides": []},
      "options": {"colorMode": "background", "graphMode": "area", "reduceOptions": {"calcs": ["lastNotNull"], "values": false}},
      "gridPos": {"h": 4, "w": 3, "x": 3, "y": 1}
    },
    {
      "id": 4, "type": "stat", "title": "CPU busy %", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "100 * (1 - avg(irate(node_cpu_seconds_total{mode=\"idle\"}[1m])))"}],
      "fieldConfig": {"defaults": {"unit": "percent", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "yellow", "value": 75}, {"color": "red", "value": 90}]}}, "overrides": []},
      "options": {"colorMode": "background", "graphMode": "area", "reduceOptions": {"calcs": ["lastNotNull"], "values": false}},
      "gridPos": {"h": 4, "w": 3, "x": 6, "y": 1}
    },
    {
      "id": 5, "type": "stat", "title": "Load1", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "node_load1"}],
      "fieldConfig": {"defaults": {"unit": "none", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "yellow", "value": 8}, {"color": "red", "value": 12}]}}, "overrides": []},
      "options": {"colorMode": "background", "graphMode": "area", "reduceOptions": {"calcs": ["lastNotNull"], "values": false}},
      "gridPos": {"h": 4, "w": 3, "x": 9, "y": 1}
    },
    {
      "id": 6, "type": "stat", "title": "Root FS free %", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "node_filesystem_avail_bytes{mountpoint=\"/\",fstype!~\"tmpfs|ramfs|overlay|squashfs\"} / node_filesystem_size_bytes{mountpoint=\"/\",fstype!~\"tmpfs|ramfs|overlay|squashfs\"} * 100"}],
      "fieldConfig": {"defaults": {"unit": "percent", "thresholds": {"mode": "absolute", "steps": [{"color": "red"}, {"color": "yellow", "value": 10}, {"color": "green", "value": 20}]}}, "overrides": []},
      "options": {"colorMode": "background", "graphMode": "area", "reduceOptions": {"calcs": ["lastNotNull"], "values": false}},
      "gridPos": {"h": 4, "w": 3, "x": 12, "y": 1}
    },
    {
      "id": 7, "type": "stat", "title": "/tmp used %", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "node_tmp_used_percent"}],
      "fieldConfig": {"defaults": {"unit": "percent", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "yellow", "value": 85}, {"color": "red", "value": 95}]}}, "overrides": []},
      "options": {"colorMode": "background", "graphMode": "area", "reduceOptions": {"calcs": ["lastNotNull"], "values": false}},
      "gridPos": {"h": 4, "w": 3, "x": 15, "y": 1}
    },
    {
      "id": 8, "type": "stat", "title": "Max temp C", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "max(node_hwmon_temp_celsius or node_thermal_zone_temp)"}],
      "fieldConfig": {"defaults": {"unit": "celsius", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "yellow", "value": 90}, {"color": "red", "value": 95}]}}, "overrides": []},
      "options": {"colorMode": "background", "graphMode": "area", "reduceOptions": {"calcs": ["lastNotNull"], "values": false}},
      "gridPos": {"h": 4, "w": 3, "x": 18, "y": 1}
    },
    {
      "id": 9, "type": "stat", "title": "Failed units", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "count(node_systemd_unit_state{state=\"failed\"} == 1)"}],
      "fieldConfig": {"defaults": {"unit": "short", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "red", "value": 1}]}}, "overrides": []},
      "options": {"colorMode": "background", "graphMode": "none", "reduceOptions": {"calcs": ["lastNotNull"], "values": false}},
      "gridPos": {"h": 4, "w": 2, "x": 21, "y": 1}
    },
    {
      "id": 10, "type": "stat", "title": "Uptime", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "time() - node_boot_time_seconds"}],
      "fieldConfig": {"defaults": {"unit": "s", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}]}}, "overrides": []},
      "options": {"colorMode": "none", "graphMode": "none", "reduceOptions": {"calcs": ["lastNotNull"], "values": false}},
      "gridPos": {"h": 4, "w": 1, "x": 23, "y": 1}
    },

    {"id": 11, "type": "row", "title": "MEMORY & PRESSURE", "collapsed": false, "gridPos": {"h": 1, "w": 24, "x": 0, "y": 5}},
    {
      "id": 12, "type": "timeseries", "title": "Memory and swap", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [
        {"refId": "A", "expr": "node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes", "legendFormat": "used"},
        {"refId": "B", "expr": "node_memory_MemAvailable_bytes", "legendFormat": "available"},
        {"refId": "C", "expr": "node_memory_Cached_bytes", "legendFormat": "cached"},
        {"refId": "D", "expr": "node_memory_SwapTotal_bytes - node_memory_SwapFree_bytes", "legendFormat": "swap used"}
      ],
      "fieldConfig": {"defaults": {"unit": "bytes", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 8, "x": 0, "y": 6}
    },
    {
      "id": 13, "type": "timeseries", "title": "PSI stalled %", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [
        {"refId": "A", "expr": "rate(node_pressure_memory_stalled_seconds_total[1m]) * 100", "legendFormat": "memory"},
        {"refId": "B", "expr": "rate(node_pressure_cpu_stalled_seconds_total[1m]) * 100", "legendFormat": "cpu"},
        {"refId": "C", "expr": "rate(node_pressure_io_stalled_seconds_total[1m]) * 100", "legendFormat": "io"}
      ],
      "fieldConfig": {"defaults": {"unit": "percent", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "yellow", "value": 20}, {"color": "red", "value": 30}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 8, "x": 8, "y": 6}
    },
    {
      "id": 14, "type": "timeseries", "title": "Exhaustion ETA", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "clamp_max(node_mem_exhaustion_eta_seconds, 3600)", "legendFormat": "eta"}],
      "fieldConfig": {"defaults": {"unit": "s", "thresholds": {"mode": "absolute", "steps": [{"color": "red"}, {"color": "yellow", "value": 90}, {"color": "green", "value": 360}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 8, "x": 16, "y": 6}
    },

    {"id": 15, "type": "row", "title": "CPU", "collapsed": false, "gridPos": {"h": 1, "w": 24, "x": 0, "y": 14}},
    {
      "id": 16, "type": "timeseries", "title": "Per-core busy %", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "sum by (cpu) (irate(node_cpu_seconds_total{mode!=\"idle\"}[1m])) * 100", "legendFormat": "cpu {{cpu}}"}],
      "fieldConfig": {"defaults": {"unit": "percent", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "yellow", "value": 75}, {"color": "red", "value": 90}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 8, "x": 0, "y": 15}
    },
    {
      "id": 17, "type": "timeseries", "title": "Total vs build classification", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [
        {"refId": "A", "expr": "100 * (1 - avg(irate(node_cpu_seconds_total{mode=\"idle\"}[1m])))", "legendFormat": "total"},
        {"refId": "B", "expr": "node_cpu_nonbuild_busy_percent", "legendFormat": "non-build"},
        {"refId": "C", "expr": "node_cpu_build_busy_percent", "legendFormat": "build"}
      ],
      "fieldConfig": {"defaults": {"unit": "percent", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "yellow", "value": 75}, {"color": "red", "value": 90}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 8, "x": 8, "y": 15}
    },
    {
      "id": 18, "type": "timeseries", "title": "Load average", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [
        {"refId": "A", "expr": "node_load1", "legendFormat": "load1"},
        {"refId": "B", "expr": "node_load5", "legendFormat": "load5"},
        {"refId": "C", "expr": "node_load15", "legendFormat": "load15"}
      ],
      "fieldConfig": {"defaults": {"unit": "none", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 8, "x": 16, "y": 15}
    },

    {"id": 19, "type": "row", "title": "DISK & FILESYSTEM", "collapsed": false, "gridPos": {"h": 1, "w": 24, "x": 0, "y": 23}},
    {
      "id": 20, "type": "timeseries", "title": "Filesystem used %", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "(1 - node_filesystem_avail_bytes{fstype!~\"tmpfs|ramfs|overlay|squashfs\"} / node_filesystem_size_bytes{fstype!~\"tmpfs|ramfs|overlay|squashfs\"}) * 100", "legendFormat": "{{mountpoint}}"}],
      "fieldConfig": {"defaults": {"unit": "percent", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "yellow", "value": 85}, {"color": "red", "value": 90}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 6, "x": 0, "y": 24}
    },
    {
      "id": 21, "type": "timeseries", "title": "Inodes used %", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "(1 - node_filesystem_files_free{fstype!~\"tmpfs|ramfs|overlay|squashfs\"} / node_filesystem_files{fstype!~\"tmpfs|ramfs|overlay|squashfs\"}) * 100", "legendFormat": "{{mountpoint}}"}],
      "fieldConfig": {"defaults": {"unit": "percent", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "yellow", "value": 85}, {"color": "red", "value": 90}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 6, "x": 6, "y": 24}
    },
    {
      "id": 22, "type": "timeseries", "title": "Fill prediction", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "predict_linear(node_filesystem_avail_bytes{fstype!~\"tmpfs|ramfs|overlay|squashfs\"}[1h], 3600)", "legendFormat": "{{mountpoint}} avail in 1h"}],
      "fieldConfig": {"defaults": {"unit": "bytes", "thresholds": {"mode": "absolute", "steps": [{"color": "red"}, {"color": "green", "value": 1}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 6, "x": 12, "y": 24}
    },
    {
      "id": 23, "type": "timeseries", "title": "Disk IO", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [
        {"refId": "A", "expr": "rate(node_disk_io_time_seconds_total[1m])", "legendFormat": "{{device}} io time"},
        {"refId": "B", "expr": "rate(node_disk_read_bytes_total[1m])", "legendFormat": "{{device}} read"},
        {"refId": "C", "expr": "rate(node_disk_written_bytes_total[1m])", "legendFormat": "{{device}} write"}
      ],
      "fieldConfig": {"defaults": {"unit": "Bps", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 6, "x": 18, "y": 24}
    },

    {"id": 24, "type": "row", "title": "tmpfs /tmp", "collapsed": false, "gridPos": {"h": 1, "w": 24, "x": 0, "y": 32}},
    {
      "id": 25, "type": "timeseries", "title": "/tmp pressure", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [
        {"refId": "A", "expr": "node_tmp_used_percent", "legendFormat": "used"},
        {"refId": "B", "expr": "node_tmp_inodes_percent", "legendFormat": "inodes"}
      ],
      "fieldConfig": {"defaults": {"unit": "percent", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "yellow", "value": 85}, {"color": "red", "value": 95}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 12, "x": 0, "y": 33}
    },
    {
      "id": 26, "type": "timeseries", "title": "Stale junk bytes", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "node_tmp_stale_bytes", "legendFormat": "stale"}],
      "fieldConfig": {"defaults": {"unit": "bytes", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 12, "x": 12, "y": 33}
    },

    {"id": 27, "type": "row", "title": "PROCESSES & FD", "collapsed": false, "gridPos": {"h": 1, "w": 24, "x": 0, "y": 41}},
    {
      "id": 28, "type": "timeseries", "title": "Processes and threads", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [
        {"refId": "A", "expr": "node_processes_state", "legendFormat": "{{state}} procs"},
        {"refId": "B", "expr": "node_processes_threads", "legendFormat": "threads"}
      ],
      "fieldConfig": {"defaults": {"unit": "short", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 12, "x": 0, "y": 42}
    },
    {
      "id": 29, "type": "timeseries", "title": "File descriptors", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [
        {"refId": "A", "expr": "node_filefd_allocated", "legendFormat": "allocated"},
        {"refId": "B", "expr": "node_filefd_maximum", "legendFormat": "maximum"},
        {"refId": "C", "expr": "node_filefd_allocated / node_filefd_maximum * 100", "legendFormat": "used %"}
      ],
      "fieldConfig": {"defaults": {"unit": "short", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "yellow", "value": 80}, {"color": "red", "value": 90}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 12, "x": 12, "y": 42}
    },

    {"id": 30, "type": "row", "title": "NETWORK", "collapsed": false, "gridPos": {"h": 1, "w": 24, "x": 0, "y": 50}},
    {
      "id": 31, "type": "timeseries", "title": "Throughput", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [
        {"refId": "A", "expr": "rate(node_network_receive_bytes_total{device!=\"lo\"}[1m])", "legendFormat": "{{device}} rx"},
        {"refId": "B", "expr": "rate(node_network_transmit_bytes_total{device!=\"lo\"}[1m])", "legendFormat": "{{device}} tx"}
      ],
      "fieldConfig": {"defaults": {"unit": "Bps", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 12, "x": 0, "y": 51}
    },
    {
      "id": 32, "type": "timeseries", "title": "Errors and drops", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [
        {"refId": "A", "expr": "rate(node_network_receive_errs_total{device!=\"lo\"}[1m])", "legendFormat": "{{device}} rx err"},
        {"refId": "B", "expr": "rate(node_network_transmit_errs_total{device!=\"lo\"}[1m])", "legendFormat": "{{device}} tx err"},
        {"refId": "C", "expr": "rate(node_network_receive_drop_total{device!=\"lo\"}[1m])", "legendFormat": "{{device}} rx drop"},
        {"refId": "D", "expr": "rate(node_network_transmit_drop_total{device!=\"lo\"}[1m])", "legendFormat": "{{device}} tx drop"}
      ],
      "fieldConfig": {"defaults": {"unit": "ops", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "red", "value": 1}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 12, "x": 12, "y": 51}
    },

    {"id": 33, "type": "row", "title": "HEALTH", "collapsed": false, "gridPos": {"h": 1, "w": 24, "x": 0, "y": 59}},
    {
      "id": 34, "type": "timeseries", "title": "Temperatures", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [
        {"refId": "A", "expr": "node_hwmon_temp_celsius", "legendFormat": "{{chip}} {{sensor}}"},
        {"refId": "B", "expr": "node_thermal_zone_temp", "legendFormat": "{{type}}"}
      ],
      "fieldConfig": {"defaults": {"unit": "celsius", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "yellow", "value": 90}, {"color": "red", "value": 95}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 6, "x": 0, "y": 60}
    },
    {
      "id": 35, "type": "table", "title": "SMART", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [
        {"refId": "A", "expr": "node_smartmon_device_smart_healthy", "format": "table", "instant": true},
        {"refId": "B", "expr": "node_smartmon_reallocated_sector_ct_raw_value", "format": "table", "instant": true},
        {"refId": "C", "expr": "node_smartmon_power_on_hours_raw_value", "format": "table", "instant": true}
      ],
      "fieldConfig": {"defaults": {"unit": "short", "thresholds": {"mode": "absolute", "steps": [{"color": "red"}, {"color": "green", "value": 1}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 6, "x": 6, "y": 60}
    },
    {
      "id": 36, "type": "table", "title": "Failed systemd units", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "node_systemd_unit_state{state=\"failed\"} == 1", "format": "table", "instant": true}],
      "fieldConfig": {"defaults": {"unit": "short", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "red", "value": 1}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 6, "x": 12, "y": 60}
    },
    {
      "id": 37, "type": "timeseries", "title": "OOM kills", "datasource": {"type": "prometheus", "uid": "$datasource"},
      "targets": [{"refId": "A", "expr": "node_vmstat_oom_kill", "legendFormat": "oom kills"}],
      "fieldConfig": {"defaults": {"unit": "short", "thresholds": {"mode": "absolute", "steps": [{"color": "green"}, {"color": "red", "value": 1}]}}, "overrides": []},
      "gridPos": {"h": 8, "w": 6, "x": 18, "y": 60}
    }
  ]
}
