DumbMonit

Мониторы

Веб-серверы и обратные прокси

Traefik, Caddy, Nginx, Apache и Nginx Proxy Manager: бэкенды, сертификаты и доля ошибок.

Описания мониторов и тексты правил оповещений на английском, как в самом продукте. Подписи на странице соответствуют вашему языку.

Traefik

traefik

The reverse proxy: routers disabled by a configuration error, backend servers failing their health check, certificates that never arrive or are not renewed, and the share of 5xx answers.

Примеры

  • Traefik in Docker
  • Traefik on Kubernetes
  • Traefik in front of self-hosted apps

Что понадобится

  • basicAuth userThe user of the basicAuth middleware in front of the API and the metrics.

Учётная запись не нужна.

Порт по умолчанию: 8080

Встроенные правила оповещений 7

  • ПредупреждениеTraefik router disabledA router is disabled by a configuration error (missing service or middleware, invalid rule): its sites are not served.
  • ПредупреждениеTraefik backend server downA server of a load-balanced service fails its health check.
  • ТревогаTraefik service without a serverNo server of a service answers its health check: its sites get 503.
  • ПредупреждениеTraefik certificate not obtainedRouters ask a certificate resolver for a certificate that no certificate held by Traefik covers yet: Traefik serves its default self-signed certificate.
  • ПредупреждениеProxy certificate not renewedA certificate Traefik holds or a Nginx Proxy Manager host presents expires in less than 14 days: automatic renewal starts at 30, so it is failing.
  • ПредупреждениеReverse proxy answering 5xxMore than 5 % of the answers over ten minutes were 5xx, with at least fifty requests. Needs the proxy's metrics.
Показать ещё 1
  • ТревогаMonitor unreachableNo measurement received for more than three minutes. bottomk by (target) (1, time() - tlast_over_time(dumbmonit_up[7d]))
Шаги настройки: Let DumbMonit read Traefik's API
  1. Add these arguments to Traefik's command (or the same keys to its static configuration), then restart it.

    --api.insecure=true
    --metrics.prometheus=true
  2. Open http://traefik.lan:8080/api/overview from the DumbMonit host: it must answer with JSON.

  3. Optional: protect /api and /metrics with a basicAuth middleware on an entry point of your own, and create the user with htpasswd.

    htpasswd -nbB dumbmonit 'a-long-password'
  4. In DumbMonit, enter the Traefik host, for example traefik.lan, with the port of that entry point if it is not 8080.

Обратите внимание. Port 8080 answers without a password: filter it so that only the DumbMonit host reaches it.

Документация

Caddy

caddy

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

Примеры

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

Что понадобится

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

Учётная запись не нужна.

Порт по умолчанию: 2019

Встроенные правила оповещений 4

  • ПредупреждениеCaddy upstream unhealthyA backend fails Caddy's active or passive health check.
  • ПредупреждениеCaddy configuration reload failedCaddy refused its last configuration reload and still runs the previous one.
  • ПредупреждениеReverse proxy answering 5xxMore than 5 % of the answers over ten minutes were 5xx, with at least fifty requests. Needs the proxy's metrics.
  • ТревогаMonitor unreachableNo measurement received for more than three minutes. bottomk by (target) (1, time() - tlast_over_time(dumbmonit_up[7d]))
Шаги настройки: 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.

Обратите внимание. Never expose the admin API itself: whoever reaches port 2019 can replace the configuration or stop Caddy.

Документация

Nginx

nginx

The web server and reverse proxy: active and waiting connections, the accept/handled/request rates, and upstream health when the commercial NGINX Plus API is available.

Примеры

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

Что понадобится

  • Basic authIf the status page sits behind a basic auth block or directive.

Учётная запись не нужна.

Порт по умолчанию: 80

Встроенные правила оповещений 1

  • ТревогаMonitor unreachableNo measurement received for more than three minutes. bottomk by (target) (1, time() - tlast_over_time(dumbmonit_up[7d]))
Шаги настройки: Enable Nginx's stub_status module
  1. Add this location to the server block Nginx already serves, restricted to the DumbMonit host (adjust the address).

    location /basic_status {
    stub_status;
    allow 10.0.0.5;
    deny all;
    }
  2. Reload Nginx.

    nginx -s reload
  3. Open http://nginx.lan/basic_status from the DumbMonit host: it must show Active connections.

  4. In DumbMonit, enter the Nginx host, for example nginx.lan, and the path if it is not /basic_status.

  5. If NGINX Plus is installed, tick Read the NGINX Plus API to add upstream health and per-zone counters.

Обратите внимание. stub_status only counts connections and requests: a configuration error in a server block or an unreachable backend does not show there.

Документация

Apache httpd

apache

The web server: busy and idle workers, the worker scoreboard by state, and request/byte rates when ExtendedStatus is on.

Примеры

  • Apache in Docker
  • Apache on a Linux host
  • A LAMP stack

Что понадобится

  • Basic authIf the status page sits behind a basic auth block or directive.

Учётная запись не нужна.

Порт по умолчанию: 80

Встроенные правила оповещений 1

  • ТревогаMonitor unreachableNo measurement received for more than three minutes. bottomk by (target) (1, time() - tlast_over_time(dumbmonit_up[7d]))
Шаги настройки: Enable Apache's mod_status
  1. Enable mod_status (it ships with Apache and is usually on already).

    a2enmod status
  2. Add this location to the Apache configuration, restricted to the DumbMonit host (adjust the address).

    <Location "/server-status">
    SetHandler server-status
    Require ip 10.0.0.5
    </Location>
  3. Optional: turn on the request and byte counters.

    ExtendedStatus On
  4. Reload Apache, then open http://apache.lan/server-status?auto from the DumbMonit host.

    apachectl graceful
  5. In DumbMonit, enter the Apache host, for example apache.lan, and the path if it is not /server-status.

Обратите внимание. Without ExtendedStatus, requests and bytes are not reported at all: the chart stays empty rather than flat.

Документация

Nginx Proxy Manager

npm

The proxy manager: hosts nginx refused to load, disabled hosts, and the certificates the hosts present, before Let's Encrypt renewal failures turn into expired sites.

Примеры

  • Nginx Proxy Manager in Docker
  • NPM in front of self-hosted apps

Что понадобится

  • User email and passwordA user of its own, allowed to view the hosts and nothing else.

Порт по умолчанию: 81

Встроенные правила оповещений 3

  • ПредупреждениеNginx Proxy Manager host offlinenginx refused an enabled host's configuration: the host is not served.
  • ПредупреждениеProxy certificate not renewedA certificate Traefik holds or a Nginx Proxy Manager host presents expires in less than 14 days: automatic renewal starts at 30, so it is failing.
  • ТревогаMonitor unreachableNo measurement received for more than three minutes. bottomk by (target) (1, time() - tlast_over_time(dumbmonit_up[7d]))
Шаги настройки: Create a view-only Nginx Proxy Manager user
  1. In Nginx Proxy Manager, open Users → Add User, give it an email of its own such as [email protected], and leave every role unticked.

  2. From that user's menu, open Permissions and set the levels listed below.

  3. From the same menu, choose Change Password and set a password.

  4. In DumbMonit, enter the Nginx Proxy Manager host with its web port, for example npm.lan:81, and that email and password.

Обратите внимание. Leave SSL Certificates on Hidden: Nginx Proxy Manager hands private keys to any user allowed to view them.

Документация