Uptime monitoring ด้วย Uptime Kuma

Uptime Kuma คือทางเลือก self-hosted ของ UptimeRobot / Pingdom เป็น Docker container ตัวเดียว UI สวย และรองรับ monitor types ทุกแบบ ที่ผมต้องการจริง ๆ

Deploy

# docker-compose.yml
version: "3.8"
services:
  uptime-kuma:
    image: louislam/uptime-kuma:1
    container_name: uptime-kuma
    restart: unless-stopped
    volumes:
      - uptime_data:/app/data
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - "127.0.0.1:3001:3001"  # Bind localhost เท่านั้น
volumes:
  uptime_data:

แล้วเปิดผ่าน Caddy บน private subdomain (เช่น status.internal.example.com) ข้างหลัง WireGuard VPN

ติดตามอะไรบ้าง

ผมเพิ่ม monitor ใน 3 หมวด:

External services (HTTP/HTTPS)

  • https://nuteo.info — เว็บหลัก
  • https://api.nuteo.info/health — API endpoint
  • https://github.com/nuteo — public profile

Internal infrastructure (TCP / DNS)

  • 10.10.10.1:5432 — PostgreSQL
  • 10.10.10.1:6379 — Redis
  • 10.10.10.1:25 — SMTP

Cron jobs (ผ่าน push)

  • Backup script — POST ไป /api/push/xxx?status=up&msg=OK เมื่อเสร็จ
  • Cert renewal — certbot renew hook POST success/fail

Notifications

Uptime Kuma รองรับ 90+ notification types ผมใช้:

  • Telegram สำหรับทุกอย่าง (chat ID + bot token)
  • Email เป็น backup สำหรับ alerts ที่สำคัญ
  • Slack สำหรับ monitors ที่แชร์กับทีม

Check fail ส่ง alert หลัง 2 retries (ตั้งค่าได้) Service กลับมา ส่ง “back up” message — มีประโยชน์ตอนตื่นมาตี 3

Status page (public)

Uptime Kuma มี status page ในตัว ผมเปิด public เล็ก ๆ:

status.nuteo.info {
  reverse_proxy localhost:3001
  # ไม่มี auth — public
}

คนเข้ามาเห็น: จุดเขียว/เหลือง/แดง, uptime 90 วัน, กราฟ response time ดีกว่า service ที่ต้องจ่ายเงินหลายเจ้า