DumbMonit

IntegraçõesSites e servidores web

Monitorar Caddy com o DumbMonit

The web server and reverse proxy: upstreams failing their health checks, a configuration reload that failed, handler errors and the share of 5xx answers.

DocumentaçãoSite oficial: Caddy

As descrições estão em inglês, como no produto. Os rótulos da página seguem o seu idioma.

O que o DumbMonit vigia

The web server and reverse proxy: upstreams failing their health checks, a configuration reload that failed, handler errors and the share of 5xx answers.

Uso típico. Web server and reverse proxy: upstream health, failed reloads, handler errors, 5xx share

Exemplos

  • Caddy in Docker
  • Caddy as a reverse proxy
  • Caddy on a Linux host

Como se conecta

O que você precisa

  • Read-only viewThe user of the basic_auth block of the read-only view (recommended).

Não é preciso nenhuma conta.

Portas de rede a abrir

  • 2019/TCPAdmin API (HTTP, default)
Etapas de configuração: Publish a read-only view of Caddy's admin API
  1. Hash a password for the user dumbmonit.

    caddy hash-password --plaintext 'a-long-password'
  2. Add this site to the Caddyfile, put the hash in place of HASH, then reload Caddy.

    :2020 {
    basic_auth {
    dumbmonit HASH
    }
    @readonly {
    method GET
    path /config/apps/http/servers /reverse_proxy/upstreams /metrics
    }
    handle @readonly {
    reverse_proxy localhost:2019 {
    header_up Host localhost:2019
    }
    }
    respond 403
    }
  3. Optional: add metrics to the global options block at the top of the Caddyfile to count requests and errors.

    metrics
  4. Filter port 2020 so that only the DumbMonit host reaches it.

  5. In DumbMonit, enter the Caddy host with that port, for example caddy.lan:2020, and the user dumbmonit with its password.

Atenção. Never expose the admin API itself: whoever reaches port 2019 can replace the configuration or stop Caddy.