Skip to content

Per-DVR Health

Each configured DVR has a health endpoint that returns a JSON snapshot of its current monitoring state. This is useful for scripting, dashboards, and troubleshooting one DVR without reading the aggregate /api/health response.

GET /api/v1/dvrs/{dvr_id}/health

Use a DVR ID from GET /api/v1/dvrs.

The current backend response model is DvrHealthResponse, with these fields:

FieldTypeDescription
dvr_idstringDVR identifier
dvr_namestringConfigured DVR name
hoststringDVR host
portnumberDVR port
connectedbooleanWhether the backend could reach the DVR during the current health read
versionstring or nullDVR version from /status
version_compatibleboolean or nullTested-range compatibility result
version_warningstring or nullCompatibility warning text when applicable
disk_statusstringDisk summary from the backend helper (normal, warning, critical, or unknown)
disk_free_gbnumber or nullFree DVR storage in GiB
disk_total_gbnumber or nullTotal DVR storage in GiB
last_checkedstringISO timestamp for this health response
last_event_atstring or nullLast observed event timestamp when available
last_freshness_atstring or nullTimestamp of the latest freshness snapshot
last_freshness_sourcestring or nullFreshness source label from the monitoring snapshot
freshness_age_secondsnumber or nullCurrent freshness age
freshness_statusstringFreshness state from the monitoring summary
monitoring_statusstringOverall monitoring state for this DVR
monitoring_readybooleanWhether this DVR is currently considered ready by the monitoring summary
monitoring_reasonstring or nullReason text when the DVR is degraded or missing
session_state_sizenumber or nullSize of the current session-state snapshot
recent_alert_ratenumber or nullRecent alert count derived from the activity database window

Example response:

{
"dvr_id": "dvr_abc12345",
"dvr_name": "Living Room",
"host": "192.168.1.100",
"port": 8089,
"connected": true,
"version": "2025.06.15",
"version_compatible": true,
"version_warning": null,
"disk_status": "normal",
"disk_free_gb": 1160.0,
"disk_total_gb": 2000.0,
"last_checked": "2026-04-21T07:05:00+00:00",
"last_event_at": "2026-04-21T06:59:45+00:00",
"last_freshness_at": "2026-04-21T07:05:00+00:00",
"last_freshness_source": "watchdog",
"freshness_age_seconds": 15.0,
"freshness_status": "fresh",
"monitoring_status": "healthy",
"monitoring_ready": true,
"monitoring_reason": null,
"session_state_size": 3,
"recent_alert_rate": 4.0
}

The current source-backed route returns 404 when the DVR ID does not exist. For an existing DVR, it returns the DvrHealthResponse JSON shape described above.

This page does not assume a special per-DVR 503 stale contract. Degraded monitoring state is represented in the JSON fields such as monitoring_status, monitoring_ready, monitoring_reason, and the freshness fields.

The endpoint combines two data sources:

  1. live per-request DVR reads such as /status and /dvr
  2. the monitoring summary snapshot used by /api/health and /healthz/ready

That is why the response includes both immediate fields like connected and snapshot-driven fields like freshness_status, monitoring_status, and monitoring_ready.

The current per-DVR health response does not expose a per-DVR configurable staleness threshold field. If you need the aggregate threshold value used by the readiness summary, inspect /healthz/ready, which includes stale_threshold_seconds at the aggregate level.