- Exposes basic host metrics via HTTP:
- uptime
- CPU usage & load
- RAM usage
- average CPU temperature
- Renders a live SVG status badge
- Optimized for low overhead and edge caching
GET /metrics– JSON metricsGET /badge.svg– embeddable SVG badge
Example badge usage:
JSON:
{
"uptime_seconds": 1064790,
"uptime_human": "12d 7h 46m",
"cpu": {
"percent": 15.8,
"load_1m": 0.5869140625
},
"ram": {
"used_mb": 9773,
"total_mb": 15819,
"percent": 61.8
},
"temperature": {
"cpu_avg": 46.5
}
}- Minimal CPU & memory usage
- No agents, no background loops
- Read-only access to host (
/proc,/sys) - Edge-cached via Cloudflare (
s-maxage=15) - Restricted CORS (suffix-based, configurable)
Built and published automatically via GitHub Actions:
Docker image: kcn333/server-stats
docker-compose.yml:
services:
server-stats:
image: kcn333/server-stats:latest
ports:
- "8000:8000"
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
environment:
ALLOWED_CORS_SUFFIX: ".domain.com"MIT