Sonarr/Radarr/Prowlarr, Hetzner load balancers/floating IPs/certificates, traffic forecast

New integration kinds sonarr, radarr and prowlarr (shared adapter and sync, page under
Apps -> Media managers): own health findings, stuck downloads, nearly full disks.
Hetzner now reads load balancers (target health), floating IPs and certificates, includes
them in the cost estimate, and forecasts the month's traffic against the quota.
Migrations 0072 and 0073; docs, metrics and tests included.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-27 20:04:55 +01:00
1 parent 9a3d5c466a
commit d9083adb5b
38 files changed
+18374 -42

No files matched your search

+11
View File
@@ -392,6 +392,15 @@ osTicket's API cannot close a ticket, so this is the one place in the app that *
name, not by its text, which is in the language Nextcloud is set to — gives the alert above and the *Background jobs* line on the page. Any other of those checks that reports an **error** is one alert, and ones that report a **warning** (HTTP headers, a PHP setting …) are only listed on the page, as in Nextcloud's own admin overview.
**Before Nextcloud 28** there is no such page: cron and the checks are then *not known* (and say so, never *fine*). The same read gives the version Nextcloud itself says is available, shown on the page. With **Nextcloud AIO** the admin pages are the mastercontainer's, but the Nextcloud behind it is an ordinary one and is read the same way (use its own address, not the AIO admin address).
### Sonarr, Radarr and Prowlarr
- **Config fields:** the application's **URL** and its **API key** (in the application: Settings → General → Security → API Key; stored encrypted), and *Allow self-signed certificate* if it is on HTTPS with its own certificate. Add each application as its own integration, as the kind it is — the *Test* button says if the address turns out to be another one. The key is sent as `X-Api-Key`; the app only ever sends GET requests.
- **Required access:** the application's address reachable from the app. Sonarr and Radarr answer under `/api/v3`, Prowlarr under `/api/v1`. A read is five to six requests, every five minutes.
- **What it does:** every **five minutes** each application is read — its version, what its own checks found (`/health`), its **download queue** (`/queue`: the first 100, and how many there are), its **disks** (`/diskspace`), for Sonarr and Radarr how many **wanted** items have no file (`/wanted/missing`), and for Prowlarr its **indexers** and which it has switched off after failures (`/indexer`, `/indexerstatus`). **Apps → Media managers** shows them. Nothing is searched, grabbed, removed or changed.
- **Alerts** (sources *Sonarr*, *Radarr*, *Prowlarr*; held back by maintenance on the integration): what the application **says is wrong** with itself (a finding of type warning or error — a download client that cannot be reached, a root folder gone, indexers unavailable; a *notice*, such as an update being available, is shown but not raised); **downloads that are stuck** (in the queue for two hours or more and judged warning or error, failed, or blocked from importing — one alert for the lot, naming the first three and why); a **disk nearly full** (under 10% free, critical under 5%; folders on one disk count once, and a disk under 2 GB is not a media disk). See [MONITORING.md](docs/MONITORING.md#media-managers-sonarr-radarr-prowlarr).
- If an application cannot be read for 20 minutes its alerts are neither raised nor cleared, the Alerts page says it could not check, and the integration is raised as failing like any other. A part that could not be read (the queue, say) is shown as *could not be read*, never as empty.
- `/metrics` has `homelab_arr_health_issues`, `homelab_arr_queue_items`, `homelab_arr_queue_stuck_items`, `homelab_arr_wanted_missing` and `homelab_arr_disk_free_bytes`.
- **Not verified against live installs** — the endpoints and fields are as the applications' published OpenAPI files and source have them (HealthResource, QueueResource, DiskSpaceResource, IndexerStatusResource), and the reader is tried against pretend ones. A finding is raised under a key made from the check and its words (numbers left out), so a finding whose wording changes is raised anew. Lidarr, Readarr and Bazarr are not read.
### Hetzner Cloud
- **Config fields:** the project's **API token** (Hetzner Console → the project → Security → API tokens → *Generate API token*; stored encrypted). **Read** permission is enough — and recommended: the app only ever sends GET requests. A token belongs to **one project**, so add one integration for each project you want to watch.
@@ -399,6 +408,8 @@ osTicket's API cannot close a ticket, so this is the one place in the app that *
- **What it does:** every **five minutes** the project's servers, volumes, snapshots and backups, primary IPs and Hetzner's price list are read and stored. The **Hetzner Cloud** page shows them with a monthly cost estimate; a server's own page gets a card when it is one of them (matched by address, else by name).
- **Alerts** (source *Hetzner*; held back by maintenance on the integration): a server that **was running and is off** (warning; left alone after a week), one **stuck** migrating or rebuilding for half an hour, **traffic** at 80% of the month's quota (critical at 100%), **rescue mode** left on for an hour, and **backups** enabled but late (the same limit as Proxmox guests' backups, 48 hours by default). See [MONITORING.md](docs/MONITORING.md#hetzner-cloud).
- If Hetzner cannot be read for 20 minutes its alerts are neither raised nor cleared, the Alerts page says it could not check, and the integration is raised as failing like any other. A list that could not be asked (the volumes, say) is shown as *could not be read*, never as empty.
- **Load balancers, floating IPs and certificates** are read with the rest (a list that cannot be asked is shown as *could not be read*, never as none): the Hetzner page lists each **load balancer** with the health of its targets, each **floating IP** and what it points at, and each **certificate** with when it ends. Their prices (a load balancer's type, a floating IP's kind and place) are now in the cost estimate. Alerts: a **load balancer with an unhealthy target** (warning; critical when none of its targets is healthy), a **certificate** that is in use and ends within 14 days (critical within 3, or past its end) or that Hetzner could not issue or renew, and a **floating IP that points at no server** (it is billed all the same). A certificate nothing uses is not raised.
- **Traffic forecast:** from the month's traffic the app writes down about every six hours it works out how the month is going — by the last week's rate, or, with too little of it, by the month's average (after three days) — and warns, below the 80% alert, when a server is **on course to pass its quota before the month ends**: "at this rate web will pass its 20.0 TB traffic quota on 24 June". The page shows the date, or what the month will come to, under each server's traffic bar. The month is the calendar month in UTC; a counter that goes down starts the history over.
- `/metrics` has `homelab_hetzner_server_running`, `homelab_hetzner_traffic_outgoing_bytes`, `homelab_hetzner_traffic_included_bytes` and `homelab_hetzner_monthly_cost`.
- **Not verified against a live project** — the endpoints (`/servers`, `/volumes`, `/images?type=snapshot` and `type=backup`, `/primary_ips`, `/pricing`) and their fields are as Hetzner's published OpenAPI file has them, and the reader is tried against a pretend server. **Traffic** is read as bytes and shown in binary units (Hetzner's 20 TB is 20 TiB); a server's *included* traffic and the *outgoing* traffic of the current billing month come from the server itself. The **cost** is the list price including VAT (the `gross` prices): check it against Hetzner's invoice the first time. Dedicated (Robot) servers and Hetzner Storage Boxes are a different API and are not read.