Monitoring & Observabilité
Vue d’ensemble des mécanismes de surveillance en place sur l’infrastructure.
Notifications de Pannes (ntfy.sh)
Section intitulée « Notifications de Pannes (ntfy.sh) »Tous les containers sur clochette avec le label friloux.me/health-watch = "true"
sont surveillés automatiquement par le module notify-docker.
Deux mécanismes :
| Mécanisme | Déclencheur | Action |
|---|---|---|
notify-failure@ | Service systemd passe en failed | Notification ntfy.sh |
docker-health-watch@ (timer 30s) | docker inspect retourne unhealthy | docker kill → systemd restart → ntfy.sh |
Les notifications arrivent sur le topic ntfy.sh configuré dans services/ntfy/topic.
Vérifier l’État des Containers
Section intitulée « Vérifier l’État des Containers »# Vue rapide — tous les containersdocker ps --format "table {{.Names}}\t{{.Status}}\t{{.RunningFor}}"
# Santé détaillée d'un containerdocker inspect --format='{{.Name}} : {{.State.Health.Status}}' traefik
# Santé de tous les containers surveillésfor c in traefik crowdsec immich-server immich-postgres immich-redis; do echo "$c : $(docker inspect --format='{{.State.Health.Status}}' $c 2>/dev/null || echo 'not found')"doneHealth Check Endpoints
Section intitulée « Health Check Endpoints »| Service | Commande de Test |
|---|---|
| traefik | curl -s http://127.0.0.1:8080/ping |
| crowdsec | curl -s http://localhost:8080/health |
| immich | curl -s http://localhost:2283/api/server/ping |
| postgres | docker exec immich-postgres pg_isready -U immich -d immich |
| redis | docker exec immich-redis redis-cli ping |
Timers systemd Actifs
Section intitulée « Timers systemd Actifs »# Lister tous les timers et leur prochain déclenchementsystemctl list-timers --all
# Timers spécifiques à surveillersystemctl list-timers | grep -E "borg|health-watch|logrotate"Borg Backup
Section intitulée « Borg Backup »# Statut du dernier backupsystemctl status borgbackup-job-remote
# Journal du dernier backupjournalctl -u borgbackup-job-remote --since today
# Liste des archives disponiblesBORG_PASSPHRASE=$(cat /run/secrets/services/borg/passphrase) \BORG_RSH="ssh -i /run/secrets/services/borg/key/private" \borg list ssh://backup@storage2.friloux.me/~/clochette.friloux.me
# Vérification d'intégrité manuellesystemctl start borgbackup-check# Logs d'un service Docker via journaldjournalctl -u docker-traefik -fjournalctl -u docker-immich-server --since "1 hour ago"
# Logs applicatifs Traefik (fichier rotaté)tail -f /srv/docker/traefik/logs/traefik.log
# Logrotate — vérifier la dernière exécutionjournalctl -u logrotate --since todayUptime Kuma (à Venir)
Section intitulée « Uptime Kuma (à Venir) »Uptime Kuma sera installé sur une prochaine machine NixOS pour fournir une surveillance externe indépendante de clochette.