Skip to content

Services health monitoring page #2

Description

@LiukScot

Summary

New /services page that monitors the health of running services (Nextcloud, Immich, N8n, Beszel, PiHole, etc.) with HTTP health checks.

Problem

No visibility into whether services are actually responding, their response times, or SSL certificate expiry — only Docker container status is shown.

Implementation

  • services SQLite table: id, name, url, expected_status, check_interval, timeout, enabled, created_at
  • service_checks table: id, service_id, status_code, response_time_ms, error, checked_at
  • New internal/collectors/services.go: background goroutine polls each service every 30-60s, stores results
  • Check SSL cert expiry via TLS handshake (crypto/tls)
  • Calculate uptime percentage from check history
  • API endpoints:
    • GET /api/v1/services — list all services with latest status
    • POST /api/v1/services — add a service
    • PUT /api/v1/services/:id — update
    • DELETE /api/v1/services/:id — remove
    • GET /api/v1/services/:id/history — check history
  • Frontend: card grid with green/red/yellow status indicators, response time sparkline, SSL expiry warning badge, add/edit service modal

Files to create/modify

  • New internal/collectors/services.go
  • internal/db/schema.go — new tables
  • internal/server/server.go — new routes
  • New frontend/src/routes/services/+page.svelte
  • frontend/src/routes/+layout.svelte — add nav item

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions