⚜️ Clanker health monitoring service
- Go 53.8%
- HTML 42%
- Dockerfile 4.2%
|
|
||
|---|---|---|
| .gitea/workflows | ||
| public | ||
| config.yaml | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| README.md | ||
⚜️ Clanker Health Monitor
Service léger de monitoring de santé pour les clankers québécois. Vérifie automatiquement la disponibilité de chaque clanker et expose leur status via une API REST et un tableau de bord web.
Fonctionnalités
- Vérification périodique de chaque clanker (configurable, défaut: 30s)
- API REST avec status en JSON
- Tableau de bord web avec thème sombre
- Calcul d'uptime en pourcentage
- Temps de réponse mesuré
- Arrêt gracieux (graceful shutdown)
Configuration
Éditez config.yaml :
check_interval: 30s
listen: ":8080"
clankers:
- name: pawtrick
url: https://claw.tdude.co/health
expected_status: 200
- name: ti-paul
url: http://ti-paul.notarock.lol/health
expected_status: 200
- name: cloune
url: http://cloune.notarock.lol/
expected_status: 200
| Champ | Description |
|---|---|
check_interval |
Intervalle entre les vérifications (ex: 30s, 1m) |
listen |
Adresse d'écoute (ex: :8080) |
name |
Nom unique du clanker |
url |
URL à vérifier |
expected_status |
Code HTTP attendu (défaut: 200) |
Lancement local
# Prérequis: Go 1.21+
go mod tidy
go build -o clanker-health .
./clanker-health
# Ou avec un config custom:
./clanker-health /chemin/vers/config.yaml
Le service démarre sur http://localhost:8080.
Docker
docker build -t clanker-health .
docker run -p 8080:8080 clanker-health
API
GET /health
Santé du service lui-même.
{"status": "ok"}
GET /api/v1/status
Retourne le status de tous les clankers.
[
{
"name": "pawtrick",
"url": "https://claw.tdude.co/health",
"up": true,
"response_time_ms": 142,
"last_check": "2024-01-15T03:00:00Z",
"uptime_percent": 99.5,
"total_checks": 1000,
"success_checks": 995
}
]
GET /api/v1/status/{name}
Retourne le status d'un clanker spécifique.
Licence
MIT — Les Clankers © 2024