Add a Technitium DNS Server integration for its statistics and health

A new integration type (Network, next to AdGuard Home) reads Technitium's API
every two minutes with a non-expiring API token in the Authorization header:
version and uptime, whether blocking is on, block lists and their next update,
the last day's queries and how they ended, cache and zone counts, the top
clients and names, zone health (expired or unsynced secondary zones), DHCP
leases — and puts one real DNS question to it over UDP. A Technitium page
shows it; alerts: DNS not answering (critical), blocking left off, block lists
overdue, zones expired or not syncing; /metrics gets homelab_technitium_*.
Nothing is changed on the server. Technitium's API has no CPU, memory or disk
figures; the page says a server agent covers that. New table technitium_state
(migration 0081).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-01 21:48:46 +01:00
1 parent e4cd01e9ba
commit 312093d3f7
24 files changed
+10189 -7

No files matched your search

+24
View File
@@ -571,6 +571,7 @@ export const integrationTypes = [
"radarr",
"prowlarr",
"adguard",
"technitium",
"grafana",
"lidarr",
"readarr",
@@ -1382,6 +1383,29 @@ export const adguardState = sqliteTable("adguard_state", {
updatedAt: text("updated_at").notNull(), // ISO
});
// ─── Technitium DNS Server ──────────────────────────────────────────────────
// How a Technitium DNS Server (an integration of type "technitium") is right now, one row each, replaced at every read: its version and when it started, whether blocking is on, its settings that
// matter (block lists and when they are next updated, the cache size, recursion), the statistics of the last day, the health of its zones, its DHCP leases and the result of a real DNS question
// put to it — plus since when blocking has been off and the question unanswered, which only this app can know. A column that is null could not be read. Read by services/technitiumSync.ts.
export const technitiumState = sqliteTable("technitium_state", {
integrationId: integer("integration_id")
.primaryKey()
.references(() => integrations.id, { onDelete: "cascade" }),
version: text("version"),
startedAt: text("started_at"), // ISO: when the DNS server last started; null when it did not say
dnsPort: integer("dns_port").notNull().default(53),
blockingEnabled: integer("blocking_enabled", { mode: "boolean" }).notNull().default(true),
blockingOffSince: text("blocking_off_since"), // ISO: the first read that showed blocking off; null while it is on
settings: text("settings").notNull(), // JSON: { blockLists: { count, intervalHours, nextUpdate }, cacheMaximumEntries, recursion, dnssecValidation }
stats: text("stats"), // JSON: the last day's queries and how they ended, cache and zone counts, top clients and names; null: could not be read
zones: text("zones"), // JSON: { total, disabled, issues: [{ name, problem }] }; null: could not be read
dhcp: text("dhcp"), // JSON: { scopes, enabledScopes, leases }; null: no DHCP server, or could not be read
probe: text("probe"), // JSON: the DNS question — { ok, ms, error, name, host }
probeFailSince: text("probe_fail_since"), // ISO: the first read in which the question went unanswered; null while it is answered
updatedAt: text("updated_at").notNull(), // ISO
});
// ─── Grafana ────────────────────────────────────────────────────────────────
// How a Grafana (an integration of type "grafana") is right now, one row each, replaced at every read: the alert rules that are firing, pending or cannot be evaluated (and how many there are), and