Check a value, not just "is it up": JSON value checks on web endpoints

A web check can read a value out of a JSON answer (power.now, state,
data.result[0].value[1]) and judge it: below, above, equal to, contains, is there.
The value read is shown on the Endpoints page, charted under History, exported as
homelab_endpoint_value and in the read API. A check can also send one header (a
token), stored encrypted, never returned, and not forwarded to another host on a
redirect.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-21 21:13:44 +02:00
1 parent e114567d64
commit 3cb3e4988f
21 files changed
+6804 -47

No files matched your search

+21
View File
@@ -943,6 +943,8 @@ export interface EndpointStats {
avgMs24h: number | null;
recent: { at: string; ok: boolean; ms: number | null }[];
}
export type EndpointValueOp = "<" | "<=" | ">" | ">=" | "=" | "!=" | "contains" | "exists";
export interface EndpointCheck {
id: number;
name: string;
@@ -951,6 +953,16 @@ export interface EndpointCheck {
port: number | null;
expectStatus: string | null;
keyword: string | null;
/** A web check can judge a value in a JSON answer: where it is, how it must compare, and what to. */
valuePath: string | null;
valueOp: EndpointValueOp | null;
valueExpected: string | null;
valueUnit: string | null;
/** A header sent with the request (its value is never sent back, only that there is one). */
headerName: string | null;
hasHeader: boolean;
/** What was read the last time, as text. */
lastValue: string | null;
insecure: boolean;
intervalMinutes: number;
timeoutSeconds: number;
@@ -972,6 +984,8 @@ export interface EndpointCheck {
export interface EndpointHistory {
check: { id: number; name: string };
days: number;
/** The numbers a value check read, as far back as the results are kept; null for a check that reads none. */
values: { unit: string | null; days: number; points: { t: string; v: number; lo: number; hi: number }[]; latest: number | null; lowest: number | null; highest: number | null } | null;
/** Which figures it is drawn from: each answer (a day or two), the hourly figures, or the daily ones. */
source: "results" | "hourly" | "daily";
points: { t: string; availability: number | null; avgMs: number | null; maxMs: number | null; checks: number }[];
@@ -998,6 +1012,13 @@ export interface EndpointInput {
port?: number | null;
expectStatus?: string | null;
keyword?: string | null;
valuePath?: string | null;
valueOp?: EndpointValueOp | null;
valueExpected?: string | null;
valueUnit?: string | null;
headerName?: string | null;
/** Left out, an edit keeps the value already saved. */
headerValue?: string | null;
insecure?: boolean;
intervalMinutes?: number;
timeoutSeconds?: number;