v0.4.0: monitoring & backup — scheduler, CPU/temp metrics, healthchecks, restic backups
Phase 2 (Monitoring & Health): - Central job scheduler replacing ad-hoc goroutines (internal/scheduler) - CPU usage collector via /proc/stat background sampling (internal/system/cpu_linux.go) - Temperature reading from /sys/class/thermal + /host/sys (Docker mount) - Load average from /proc/loadavg - Healthchecks.io-compatible HTTP pinger (internal/monitor/pinger.go) - System health checks: disk, memory, CPU, temp, Docker, protected containers (internal/monitor/healthcheck.go) Phase 3 (Backups): - Database auto-discovery via docker ps + docker inspect (internal/backup/dbdump.go) - Database dumping via docker exec (pg_dump / mariadb-dump) with atomic writes - Restic backup integration with auto-password generation (internal/backup/restic.go) - Backup orchestrator: DB dumps + restic snapshots + weekly prune (internal/backup/backup.go) - Manual backup trigger via dashboard button and POST /api/backup/run Dashboard UI: - CPU usage bar with load average display - Temperature with colored indicator dot - Backup status card with last run time, DB count, repo stats - "Mentés most" button for manual backup trigger Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
//go:build !linux
|
||||
|
||||
package system
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
// CPUCollector is a no-op on non-Linux platforms.
|
||||
type CPUCollector struct{}
|
||||
|
||||
// NewCPUCollector creates a no-op CPU collector on non-Linux platforms.
|
||||
func NewCPUCollector(_ time.Duration) *CPUCollector {
|
||||
return &CPUCollector{}
|
||||
}
|
||||
|
||||
// Start is a no-op on non-Linux platforms.
|
||||
func (c *CPUCollector) Start(_ context.Context) {}
|
||||
|
||||
// Stop is a no-op on non-Linux platforms.
|
||||
func (c *CPUCollector) Stop() {}
|
||||
|
||||
// CPUPercent always returns 0 on non-Linux platforms.
|
||||
func (c *CPUCollector) CPUPercent() float64 { return 0 }
|
||||
Reference in New Issue
Block a user