ข้ามไปยังเนื้อหา

รายงานหลังการบำรุงรักษา Monitoring Host

Post-Maintenance Report: Monitoring Host (194.1.0.15) — Overbrook Hospital Chiang Rai

ข้อมูลเอกสาร รายละเอียด
ลูกค้า โรงพยาบาลโอเวอร์บรุ๊ค เชียงราย (Overbrook Hospital Chiang Rai)
ผู้ให้บริการ บริษัท แรคซิงค์ จำกัด (RACKSYNC Co., Ltd.)
เลขที่สัญญา PM065-2026 (MA ประจำปี 2569)
ระบบเป้าหมาย Monitoring Stack monitor (194.1.0.15)
วันที่ดำเนินการ 31 พฤษภาคม 2569
สถานะ Phase 1 + Phase 2b เสร็จสมบูรณ์ — ตรวจสอบแล้วระบบทำงานปกติ

Phase 1 maintenance of the monitor VM: pinned all floating :latest image tags in the metrics stack to the exact running versions, re-enabled the Prometheus container healthcheck, and reclaimed ~2 GB of dangling images and build cache. No version upgrades were performed (those are deferred to Phase 2/3). All services verified healthy after the change.


Item Value
Hostname monitoring
IP Address 194.1.0.15
Access path via gateway jump (ssh root@cf-rilf-gw → ssh monitor)
Host OS Debian 12 bookworm
Docker Engine 28.5.1
Uptime 109 days
Disk 502 GB total, 77 GB used (17%), 400 GB free

Note: direct cf-rilf-metrics SSH was unavailable this session (no cached Cloudflare Access token for rilf-shell-metrics, plus stale ~/.cloudflared/*.lock files that had to be cleared locally); all work was performed via the gateway jump host, which carries a valid token.


ตามผลการประเมินก่อนดำเนินการ งาน Phase 1 ที่มีความเสี่ยงต่ำ 3 รายการ:

Step Action Risk Status
1a Pin floating :latest image tags to current versions Zero ✅ Done
1b docker system prune (images + build cache) Low ✅ Done
1c Re-enable Prometheus healthcheck Zero ✅ Done

cp -a /home/mtd/metrics/docker-compose.yml \
/home/mtd/metrics/docker-compose.yml.bak-20260531

To guarantee the pinned tag equals the byte-identical running image (no registry pull, no surprise version), each running :latest image was first re-tagged locally to its exact version, then the compose file was updated to reference that version.

Container Before After (pinned) Image ID (sha256, short)
prometheus prom/prometheus:v2.47.2 (already pinned) —
grafana grafana/grafana:latest grafana/grafana:12.2.1 bac4f177a0d5
alertmanager prom/alertmanager:latest prom/alertmanager:v0.29.0 e0057376123c
node-exporter prom/node-exporter:latest prom/node-exporter:v1.10.2 696e69e899e0
cloudflared cloudflare/cloudflared:latest cloudflare/cloudflared:2025.11.1 3d2cdb3dbe34
nginx nginx:alpine nginx:1.29.3-alpine d4918ca78576

Versions were taken from the actual running binaries (docker exec ... --version), not the 2026-05-13 report — which corrected two assumptions: alertmanager is 0.29.0 (report said 0.28.x stable) and cloudflared is 2025.11.1 (not the local client’s 2026.2.0).

The commented-out block was restored to an active healthcheck:

healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9090/-/healthy"]
interval: 90s
timeout: 30s
retries: 10
start_period: 120s
cd /home/mtd/metrics
docker compose config -q # rc=0 (valid)
docker compose up -d # rc=0, recreated 6 metrics services
docker image prune -f # dangling images removed
docker builder prune -f # build cache → 0B

Total reclaimed ≈ 2.04 GB (build cache 1.078 GB + dangling images). Image count dropped 28 → 13.


Check Result
Containers running 12 / 12
Restarting 0
Unhealthy 0
Prometheus http://localhost:9090/-/healthy HTTP 200
Grafana http://localhost:3000/api/health HTTP 200
AlertManager http://localhost:9093/-/healthy HTTP 200
Prometheus scrape targets up 6 / 6 (self, local node-exporter, ha, db, fg, gw)
:latest tags remaining in metrics compose 0
Disk reclaimed ~2.04 GB (build cache → 0B, images 28→13)

Item Phase Reason
Grafana 12.2.1 → 13.x Phase 2 Major upgrade; test dashboards, plugins, provisioning first
Prometheus 2.47.2 → 3.x Phase 3 / MA 2570 Config-breaking (remote_write→remote.write, rule changes); coordinate with db Prometheus
Archive 11 GB old backups (Oct–Nov 2025) Phase 2 Done 2026-05-31 — see §7
Weather stack :latest images (4) Later Separate compose /home/mtd/weather/; custom local builds + phpmyadmin/cloudflared
GitHub Actions runner on monitoring host (2.3 GB) Review Mixes CI/CD with production monitoring

If any issue arises, restore the previous compose and recreate:

cd /home/mtd/metrics
cp -a docker-compose.yml.bak-20260531 docker-compose.yml
docker compose up -d

The original :latest image tags still exist locally alongside the version tags (same image IDs), so rollback requires no pull.


The 27 stale monitoring backups in /home/mtd/backups (11 GB, Oct–Nov 2025) were archived off-host and removed to reclaim space.

Type Count Size
monitoring-backup-*.tar.gz 20 ~420 MB – 1 GB each
prometheus-config-backup-*.tar.gz 7 ~3.9 KB each
Total 27 11 GB
  1. Generated md5 manifest on host (SOURCE.md5, 27 entries).
  2. Streamed each file to local storage via the gateway jump (ssh -n gw "ssh monitor 'cat …'") — ProxyJump was not usable (local key not authorized directly on monitor).
  3. Verified every file’s md5 against the manifest (independent re-check: 27/27 OK, 0 mismatch).
  4. Deleted the 27 files from the host after verification.
Metric Before After
Files in /home/mtd/backups 27 0 (empty)
Host root usage 29 GB 18 GB (≈11 GB reclaimed)
Local archive — SmileX-Storage/backup/obh-iot/monitor-194.1.0.15/2026-05-31/ (11 GB, 27 files + SOURCE.md5)
  • Credentials in backups: every monitoring-backup-*.tar.gz contains metrics/actions-runner/.credentials (GitHub Actions self-hosted runner registration secret) plus the runner’s _work/ build artifacts. These archives are kept only in local storage (never committed to git). Recommendation: treat the runner credential as exposed and rotate it.
  • Backup bloat: the ~420 MB size is almost entirely the actions-runner working directory, not monitoring config. Recommendation: fix the backup job to exclude actions-runner/_work (and ideally .credentials) so future backups are small. Consider moving the GitHub Actions runner off the production monitoring host entirely.
  • No rotation: 27 backups accumulated with no retention policy (e.g. five near-identical snapshots within one hour on 2025-11-11). Recommendation: add a retention/rotation policy to the backup job.

บทบาท ชื่อ วันที่
ผู้ดำเนินการ (RACKSYNC) นายดำรงวิศว์ หนูสุข 31 พฤษภาคม 2569
ผู้ตรวจสอบ (RACKSYNC) — —
ผู้รับมอบงาน (OBH) — —

  • final-report.pdf — รายงานสรุปการบำรุงรักษาประจำปี 2569 (เอกสารหลัก)
  • /home/mtd/metrics/docker-compose.yml — monitoring stack compose (edited)
  • /home/mtd/metrics/docker-compose.yml.bak-20260531 — pre-change backup (on host)