ระบบจัดการ Server และ Deployment อัตโนมัติ

พอมีเซิร์ฟเวอร์เกิน 5 ตัว จะเริ่มจำไม่ได้ว่าตัวไหนรันอะไร เครื่องมือนี้แก้ปัญหานั้น single source of truth สำหรับ: server, role, สถานะ deploy, uptime, alerts

ทำอะไรได้บ้าง

  • 📋 Inventory — ชื่อ, IP, บทบาท, environment, tags
  • 🚀 Deploy queue — กำลัง deploy อะไรที่ไหน สถานะ
  • 📊 Dashboard — uptime, deploy ล่าสุด, alerts
  • 🔔 Notifications — Slack/Telegram เมื่อ deployment fail

Stack

  • Python (FastAPI) สำหรับ API
  • SQLite เก็บข้อมูล local (Postgres optional)
  • HTMX สำหรับ dashboard (ไม่ใช้ React ไม่ต้อง build)
  • systemd + cron สำหรับ agent-side collection

Architecture

┌─────────────┐    ┌──────────────┐    ┌─────────────┐
│  each host  │    │  central     │    │  dashboard  │
│             │    │  API         │    │             │
│  agent.py ──┼──▶ │  FastAPI ────┼──▶ │  /dashboard │
│  (cron 5m)  │    │  SQLite      │    │  (HTMX)     │
└─────────────┘    └──────────────┘    └─────────────┘
                          │
                          ▼
                   ┌─────────────┐
                   │  Telegram   │
                   │  alerts     │
                   └─────────────┘

Agent เป็น Python script 50 บรรทัด รันผ่าน cron ทุก 5 นาที เก็บ uptime, df, docker ps แล้ว POST ไป central API

ทำไมไม่ใช้ Prometheus + Grafana?

ผมใช้ — สำหรับ metrics เครื่องมือนี้สำหรับ metadata และ deploy tracking ซึ่ง Prometheus ไม่เก่ง Prometheus เป็น real-time metrics, อันนี้เป็น who-owns-what, deploy history, on-call schedule

สถานะ

สร้างและใช้งานทุกวัน Source จะปล่อยเร็ว ๆ นี้หลังจากเก็บกวาดส่วนที่น่าอาย