{
  "title": "ulaknode Overview",
  "schemaVersion": 38,
  "version": 4,
  "templating": {
    "list": []
  },
  "panels": [
    {
      "id": 1,
      "type": "row",
      "title": "Overview",
      "collapsed": false,
      "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 },
      "panels": []
    },
    {
      "id": 2,
      "type": "stat",
      "title": "Active Postscreen Connections",
      "gridPos": { "h": 4, "w": 4, "x": 0, "y": 1 },
      "targets": [
        { "expr": "postfix_postscreen_active_connections", "legendFormat": "active" }
      ]
    },
    {
      "id": 3,
      "type": "stat",
      "title": "Active Dovecot Sessions",
      "gridPos": { "h": 4, "w": 4, "x": 4, "y": 1 },
      "targets": [
        { "expr": "ulaknode_dovecot_active_sessions", "legendFormat": "active" }
      ]
    },
    {
      "id": 4,
      "type": "stat",
      "title": "Active Fail2ban Bans",
      "gridPos": { "h": 4, "w": 4, "x": 8, "y": 1 },
      "targets": [
        { "expr": "ulaknode_fail2ban_active_bans", "legendFormat": "banned" }
      ]
    },
    {
      "id": 5,
      "type": "stat",
      "title": "Load (1m)",
      "gridPos": { "h": 4, "w": 4, "x": 12, "y": 1 },
      "targets": [
        { "expr": "ulaknode_node_load1", "legendFormat": "load1" }
      ]
    },
    {
      "id": 6,
      "type": "stat",
      "title": "Memory Available",
      "gridPos": { "h": 4, "w": 4, "x": 16, "y": 1 },
      "fieldConfig": { "defaults": { "unit": "percent", "max": 100, "min": 0 } },
      "targets": [
        {
          "expr": "100 * ulaknode_node_memory_available_bytes / ulaknode_node_memory_total_bytes",
          "legendFormat": "available"
        }
      ]
    },
    {
      "id": 7,
      "type": "stat",
      "title": "/var/mail Free",
      "gridPos": { "h": 4, "w": 4, "x": 20, "y": 1 },
      "fieldConfig": { "defaults": { "unit": "percent", "max": 100, "min": 0 } },
      "targets": [
        {
          "expr": "100 * ulaknode_node_filesystem_avail_bytes{mountpoint=\"/var/mail\"} / ulaknode_node_filesystem_size_bytes{mountpoint=\"/var/mail\"}",
          "legendFormat": "free"
        }
      ]
    },
    {
      "id": 8,
      "type": "timeseries",
      "title": "Mail Delivery Outcomes",
      "gridPos": { "h": 8, "w": 8, "x": 0, "y": 5 },
      "targets": [
        { "expr": "rate(postfix_deliveries_total[5m])", "legendFormat": "{{status}}" }
      ]
    },
    {
      "id": 9,
      "type": "timeseries",
      "title": "Postscreen Connections by Result",
      "gridPos": { "h": 8, "w": 8, "x": 8, "y": 5 },
      "targets": [
        { "expr": "rate(postfix_postscreen_connections_total[5m])", "legendFormat": "{{result}}" }
      ]
    },
    {
      "id": 10,
      "type": "timeseries",
      "title": "Authentication Failures",
      "gridPos": { "h": 8, "w": 8, "x": 16, "y": 5 },
      "targets": [
        { "expr": "rate(postfix_sasl_auth_failures_total[5m])", "legendFormat": "postfix sasl" },
        { "expr": "rate(ulaknode_dovecot_login_failures_total[5m])", "legendFormat": "dovecot" }
      ]
    },

    {
      "id": 11,
      "type": "row",
      "title": "Postfix / Postscreen",
      "collapsed": true,
      "gridPos": { "h": 1, "w": 24, "x": 0, "y": 13 },
      "panels": [
        {
          "id": 38,
          "type": "stat",
          "title": "Total Postscreen Connections",
          "gridPos": { "h": 4, "w": 6, "x": 0, "y": 14 },
          "targets": [
            { "expr": "sum(postfix_postscreen_connections_total)", "legendFormat": "total" }
          ]
        },
        {
          "id": 39,
          "type": "stat",
          "title": "Total DNSBL Hits",
          "gridPos": { "h": 4, "w": 6, "x": 6, "y": 14 },
          "targets": [
            { "expr": "postfix_postscreen_dnsbl_hits_total", "legendFormat": "total" }
          ]
        },
        {
          "id": 40,
          "type": "stat",
          "title": "Total SASL Auth Failures",
          "gridPos": { "h": 4, "w": 6, "x": 12, "y": 14 },
          "targets": [
            { "expr": "postfix_sasl_auth_failures_total", "legendFormat": "total" }
          ]
        },
        {
          "id": 41,
          "type": "stat",
          "title": "Total Deliveries",
          "gridPos": { "h": 4, "w": 6, "x": 18, "y": 14 },
          "targets": [
            { "expr": "sum(postfix_deliveries_total)", "legendFormat": "total" }
          ]
        },
        {
          "id": 12,
          "type": "timeseries",
          "title": "Postscreen Connections by Result",
          "gridPos": { "h": 8, "w": 12, "x": 0, "y": 18 },
          "targets": [
            { "expr": "rate(postfix_postscreen_connections_total[5m])", "legendFormat": "{{result}}" }
          ]
        },
        {
          "id": 13,
          "type": "timeseries",
          "title": "Postscreen DNSBL Hits",
          "gridPos": { "h": 8, "w": 12, "x": 12, "y": 18 },
          "targets": [
            { "expr": "rate(postfix_postscreen_dnsbl_hits_total[5m])", "legendFormat": "dnsbl" }
          ]
        },
        {
          "id": 14,
          "type": "timeseries",
          "title": "Postfix SASL Auth Failures",
          "gridPos": { "h": 8, "w": 12, "x": 0, "y": 26 },
          "targets": [
            { "expr": "rate(postfix_sasl_auth_failures_total[5m])", "legendFormat": "failures" }
          ]
        },
        {
          "id": 15,
          "type": "timeseries",
          "title": "Postfix Deliveries by Status",
          "gridPos": { "h": 8, "w": 12, "x": 12, "y": 26 },
          "targets": [
            { "expr": "rate(postfix_deliveries_total[5m])", "legendFormat": "{{status}}" }
          ]
        }
      ]
    },

    {
      "id": 16,
      "type": "row",
      "title": "Dovecot",
      "collapsed": true,
      "gridPos": { "h": 1, "w": 24, "x": 0, "y": 14 },
      "panels": [
        {
          "id": 42,
          "type": "stat",
          "title": "Total Dovecot Logins",
          "gridPos": { "h": 4, "w": 8, "x": 0, "y": 15 },
          "targets": [
            { "expr": "ulaknode_dovecot_logins_total", "legendFormat": "total" }
          ]
        },
        {
          "id": 43,
          "type": "stat",
          "title": "Total Dovecot Login Failures",
          "gridPos": { "h": 4, "w": 8, "x": 8, "y": 15 },
          "targets": [
            { "expr": "ulaknode_dovecot_login_failures_total", "legendFormat": "total" }
          ]
        },
        {
          "id": 44,
          "type": "stat",
          "title": "Total Dovecot LMTP Deliveries",
          "gridPos": { "h": 4, "w": 8, "x": 16, "y": 15 },
          "targets": [
            { "expr": "ulaknode_dovecot_lmtp_deliveries_total", "legendFormat": "total" }
          ]
        },
        {
          "id": 17,
          "type": "timeseries",
          "title": "Dovecot Active Sessions",
          "gridPos": { "h": 8, "w": 12, "x": 0, "y": 19 },
          "targets": [
            { "expr": "ulaknode_dovecot_active_sessions", "legendFormat": "active" }
          ]
        },
        {
          "id": 18,
          "type": "timeseries",
          "title": "Dovecot Logins Rate",
          "gridPos": { "h": 8, "w": 12, "x": 12, "y": 19 },
          "targets": [
            { "expr": "rate(ulaknode_dovecot_logins_total[5m])", "legendFormat": "logins" }
          ]
        },
        {
          "id": 19,
          "type": "timeseries",
          "title": "Dovecot Login Failures Rate",
          "gridPos": { "h": 8, "w": 12, "x": 0, "y": 27 },
          "targets": [
            { "expr": "rate(ulaknode_dovecot_login_failures_total[5m])", "legendFormat": "failures" }
          ]
        },
        {
          "id": 20,
          "type": "timeseries",
          "title": "Dovecot LMTP Deliveries Rate",
          "gridPos": { "h": 8, "w": 12, "x": 12, "y": 27 },
          "targets": [
            { "expr": "rate(ulaknode_dovecot_lmtp_deliveries_total[5m])", "legendFormat": "deliveries" }
          ]
        }
      ]
    },

    {
      "id": 21,
      "type": "row",
      "title": "ClamAV",
      "collapsed": true,
      "gridPos": { "h": 1, "w": 24, "x": 0, "y": 15 },
      "panels": [
        {
          "id": 45,
          "type": "stat",
          "title": "Total ClamAV Updates",
          "gridPos": { "h": 4, "w": 24, "x": 0, "y": 16 },
          "targets": [
            { "expr": "ulaknode_clamav_updates_total", "legendFormat": "total" }
          ]
        },
        {
          "id": 22,
          "type": "timeseries",
          "title": "ClamAV Update Events Rate",
          "gridPos": { "h": 8, "w": 12, "x": 0, "y": 20 },
          "targets": [
            { "expr": "rate(ulaknode_clamav_updates_total[5m])", "legendFormat": "updates" }
          ]
        },
        {
          "id": 23,
          "type": "timeseries",
          "title": "ClamAV Database Signatures",
          "gridPos": { "h": 8, "w": 12, "x": 12, "y": 20 },
          "targets": [
            { "expr": "ulaknode_clamav_database_signatures", "legendFormat": "{{database}}" }
          ]
        }
      ]
    },

    {
      "id": 24,
      "type": "row",
      "title": "SpamAssassin",
      "collapsed": true,
      "gridPos": { "h": 1, "w": 24, "x": 0, "y": 16 },
      "panels": [
        {
          "id": 46,
          "type": "stat",
          "title": "Total SpamAssassin Scans",
          "gridPos": { "h": 4, "w": 12, "x": 0, "y": 17 },
          "targets": [
            { "expr": "ulaknode_spamassassin_scans_total", "legendFormat": "total" }
          ]
        },
        {
          "id": 47,
          "type": "stat",
          "title": "Total SpamAssassin Spam Hits",
          "gridPos": { "h": 4, "w": 12, "x": 12, "y": 17 },
          "targets": [
            { "expr": "ulaknode_spamassassin_hits_total", "legendFormat": "total" }
          ]
        },
        {
          "id": 25,
          "type": "timeseries",
          "title": "SpamAssassin Scans Rate",
          "gridPos": { "h": 8, "w": 12, "x": 0, "y": 21 },
          "targets": [
            { "expr": "rate(ulaknode_spamassassin_scans_total[5m])", "legendFormat": "scans" }
          ]
        },
        {
          "id": 26,
          "type": "timeseries",
          "title": "SpamAssassin Spam Hits Rate",
          "gridPos": { "h": 8, "w": 12, "x": 12, "y": 21 },
          "targets": [
            { "expr": "rate(ulaknode_spamassassin_hits_total[5m])", "legendFormat": "hits" }
          ]
        }
      ]
    },

    {
      "id": 27,
      "type": "row",
      "title": "Postgrey",
      "collapsed": true,
      "gridPos": { "h": 1, "w": 24, "x": 0, "y": 17 },
      "panels": [
        {
          "id": 48,
          "type": "stat",
          "title": "Total Postgrey Greylisted",
          "gridPos": { "h": 4, "w": 24, "x": 0, "y": 18 },
          "targets": [
            { "expr": "ulaknode_postgrey_greylisted_total", "legendFormat": "total" }
          ]
        },
        {
          "id": 28,
          "type": "timeseries",
          "title": "Postgrey Greylisting Rate",
          "gridPos": { "h": 8, "w": 24, "x": 0, "y": 22 },
          "targets": [
            { "expr": "rate(ulaknode_postgrey_greylisted_total[5m])", "legendFormat": "greylisted" }
          ]
        }
      ]
    },

    {
      "id": 29,
      "type": "row",
      "title": "Fail2ban",
      "collapsed": true,
      "gridPos": { "h": 1, "w": 24, "x": 0, "y": 18 },
      "panels": [
        {
          "id": 49,
          "type": "stat",
          "title": "Total Fail2ban Bans",
          "gridPos": { "h": 4, "w": 12, "x": 0, "y": 19 },
          "targets": [
            { "expr": "ulaknode_fail2ban_bans_total", "legendFormat": "total" }
          ]
        },
        {
          "id": 50,
          "type": "stat",
          "title": "Total Fail2ban SMTP Rejections",
          "gridPos": { "h": 4, "w": 12, "x": 12, "y": 19 },
          "targets": [
            { "expr": "ulaknode_fail2ban_rejections_total", "legendFormat": "total" }
          ]
        },
        {
          "id": 30,
          "type": "timeseries",
          "title": "Fail2ban Active Bans",
          "gridPos": { "h": 8, "w": 8, "x": 0, "y": 23 },
          "targets": [
            { "expr": "ulaknode_fail2ban_active_bans", "legendFormat": "active" }
          ]
        },
        {
          "id": 31,
          "type": "timeseries",
          "title": "Fail2ban Ban Rate",
          "gridPos": { "h": 8, "w": 8, "x": 8, "y": 23 },
          "targets": [
            { "expr": "rate(ulaknode_fail2ban_bans_total[5m])", "legendFormat": "bans" }
          ]
        },
        {
          "id": 32,
          "type": "timeseries",
          "title": "Fail2ban SMTP Rejections Rate",
          "gridPos": { "h": 8, "w": 8, "x": 16, "y": 23 },
          "targets": [
            { "expr": "rate(ulaknode_fail2ban_rejections_total[5m])", "legendFormat": "rejections" }
          ]
        }
      ]
    },

    {
      "id": 33,
      "type": "row",
      "title": "Host",
      "collapsed": true,
      "gridPos": { "h": 1, "w": 24, "x": 0, "y": 19 },
      "panels": [
        {
          "id": 51,
          "type": "stat",
          "title": "Total Network Received",
          "description": "Cumulative since the host's network interface was last brought up (normally host boot, not exporter deploy). Excludes loopback and virtual/tunnel devices (docker0, wg*, veth*, br-*) to avoid double-counting traffic that also transits the physical interface.",
          "gridPos": { "h": 4, "w": 12, "x": 0, "y": 20 },
          "fieldConfig": { "defaults": { "unit": "bytes" } },
          "targets": [
            { "expr": "sum(ulaknode_node_network_receive_bytes_total{device!~\"lo|docker.*|wg.*|veth.*|br-.*|tun.*\"})", "legendFormat": "total" }
          ]
        },
        {
          "id": 52,
          "type": "stat",
          "title": "Total Network Transmitted",
          "description": "Cumulative since the host's network interface was last brought up (normally host boot, not exporter deploy). Excludes loopback and virtual/tunnel devices (docker0, wg*, veth*, br-*) to avoid double-counting traffic that also transits the physical interface.",
          "gridPos": { "h": 4, "w": 12, "x": 12, "y": 20 },
          "fieldConfig": { "defaults": { "unit": "bytes" } },
          "targets": [
            { "expr": "sum(ulaknode_node_network_transmit_bytes_total{device!~\"lo|docker.*|wg.*|veth.*|br-.*|tun.*\"})", "legendFormat": "total" }
          ]
        },
        {
          "id": 34,
          "type": "timeseries",
          "title": "Load Average",
          "gridPos": { "h": 8, "w": 12, "x": 0, "y": 24 },
          "targets": [
            { "expr": "ulaknode_node_load1", "legendFormat": "1m" },
            { "expr": "ulaknode_node_load5", "legendFormat": "5m" },
            { "expr": "ulaknode_node_load15", "legendFormat": "15m" }
          ]
        },
        {
          "id": 35,
          "type": "timeseries",
          "title": "Memory Usage",
          "gridPos": { "h": 8, "w": 12, "x": 12, "y": 24 },
          "fieldConfig": { "defaults": { "unit": "bytes" } },
          "targets": [
            { "expr": "ulaknode_node_memory_total_bytes", "legendFormat": "total" },
            { "expr": "ulaknode_node_memory_available_bytes", "legendFormat": "available" }
          ]
        },
        {
          "id": 36,
          "type": "timeseries",
          "title": "Disk Free % by Mountpoint",
          "gridPos": { "h": 8, "w": 12, "x": 0, "y": 32 },
          "fieldConfig": { "defaults": { "unit": "percent", "max": 100, "min": 0 } },
          "targets": [
            {
              "expr": "100 * ulaknode_node_filesystem_avail_bytes / ulaknode_node_filesystem_size_bytes",
              "legendFormat": "{{mountpoint}}"
            }
          ]
        },
        {
          "id": 37,
          "type": "timeseries",
          "title": "Network Throughput",
          "gridPos": { "h": 8, "w": 12, "x": 12, "y": 32 },
          "fieldConfig": { "defaults": { "unit": "Bps" } },
          "targets": [
            { "expr": "rate(ulaknode_node_network_receive_bytes_total[5m])", "legendFormat": "{{device}} rx" },
            { "expr": "rate(ulaknode_node_network_transmit_bytes_total[5m])", "legendFormat": "{{device}} tx" }
          ]
        }
      ]
    }
  ],
  "refresh": "30s",
  "time": {
    "from": "now-1h",
    "to": "now"
  }
}
