Health Endpoint
The bouncer provides a health check endpoint when metrics are enabled.
Endpoint
Section titled “Endpoint”GET http://<listen_addr>:<listen_port>/healthDefault: http://localhost:2112/health
Response format
Section titled “Response format”{ "status": "healthy", "version": "1.3.0", "crowdsec_connected": true, "routeros_connected": true, "active_decisions": 1483, "last_pull": "2024-01-15T14:30:00Z"}HTTP status codes
Section titled “HTTP status codes”| Code | Status | Meaning |
|---|---|---|
200 | OK | All systems operational |
503 | Unhealthy | One or more components unhealthy |
Integration examples
Section titled “Integration examples”services: cs-routeros-bouncer: image: ghcr.io/jmrplens/cs-routeros-bouncer:latest healthcheck: test: ["CMD", "wget", "-q", "--spider", "http://localhost:2112/health"] interval: 30s timeout: 10s retries: 3 start_period: 15slivenessProbe: httpGet: path: /health port: 2112 initialDelaySeconds: 15 periodSeconds: 30 timeoutSeconds: 10
readinessProbe: httpGet: path: /health port: 2112 initialDelaySeconds: 5 periodSeconds: 10groups: - name: cs-routeros-bouncer rules: - alert: BouncerUnhealthy expr: up{job="cs-routeros-bouncer"} == 0 for: 5m labels: severity: critical annotations: summary: "CrowdSec RouterOS bouncer is down"