รายงานหลังการบำรุงรักษา 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.
1. Host Information (as observed 2026-05-31)
หัวข้อที่มีชื่อว่า “1. Host Information (as observed 2026-05-31)”| 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.
2. Scope — Phase 1 (Quick Wins)
หัวข้อที่มีชื่อว่า “2. Scope — Phase 1 (Quick Wins)”ตามผลการประเมินก่อนดำเนินการ งาน 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 |
3. What Was Done
หัวข้อที่มีชื่อว่า “3. What Was Done”3.1 Compose Backup
หัวข้อที่มีชื่อว่า “3.1 Compose Backup”cp -a /home/mtd/metrics/docker-compose.yml \ /home/mtd/metrics/docker-compose.yml.bak-202605313.2 Image Tag Pinning
หัวข้อที่มีชื่อว่า “3.2 Image Tag Pinning”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).
3.3 Prometheus Healthcheck Re-enabled
หัวข้อที่มีชื่อว่า “3.3 Prometheus Healthcheck Re-enabled”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: 120s3.4 Apply & Cleanup
หัวข้อที่มีชื่อว่า “3.4 Apply & Cleanup”cd /home/mtd/metricsdocker compose config -q # rc=0 (valid)docker compose up -d # rc=0, recreated 6 metrics servicesdocker image prune -f # dangling images removeddocker builder prune -f # build cache → 0BTotal reclaimed ≈ 2.04 GB (build cache 1.078 GB + dangling images). Image count dropped 28 → 13.
4. Verification
หัวข้อที่มีชื่อว่า “4. Verification”| 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) |
5. Deferred Items (not skipped — tracked for later)
หัวข้อที่มีชื่อว่า “5. Deferred Items (not skipped — tracked for later)”| 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 |
| 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 |
6. Rollback
หัวข้อที่มีชื่อว่า “6. Rollback”If any issue arises, restore the previous compose and recreate:
cd /home/mtd/metricscp -a docker-compose.yml.bak-20260531 docker-compose.ymldocker compose up -dThe original :latest image tags still exist locally alongside the version tags (same image IDs), so rollback requires no pull.
7. Phase 2b — Old Backup Archival (COMPLETED 2026-05-31)
หัวข้อที่มีชื่อว่า “7. Phase 2b — Old Backup Archival (COMPLETED 2026-05-31)”The 27 stale monitoring backups in /home/mtd/backups (11 GB, Oct–Nov 2025) were archived off-host and removed to reclaim space.
7.1 What was archived
หัวข้อที่มีชื่อว่า “7.1 What was archived”| 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 |
7.2 Procedure
หัวข้อที่มีชื่อว่า “7.2 Procedure”- Generated md5 manifest on host (
SOURCE.md5, 27 entries). - 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). - Verified every file’s md5 against the manifest (independent re-check: 27/27 OK, 0 mismatch).
- Deleted the 27 files from the host after verification.
7.3 Result
หัวข้อที่มีชื่อว่า “7.3 Result”| 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) |
7.4 ⚠️ Security & hygiene findings
หัวข้อที่มีชื่อว่า “7.4 ⚠️ Security & hygiene findings”- Credentials in backups: every
monitoring-backup-*.tar.gzcontainsmetrics/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.
การลงนามรับมอบงาน (Sign-off)
หัวข้อที่มีชื่อว่า “การลงนามรับมอบงาน (Sign-off)”| บทบาท | ชื่อ | วันที่ |
|---|---|---|
| ผู้ดำเนินการ (RACKSYNC) | นายดำรงวิศว์ หนูสุข | 31 พฤษภาคม 2569 |
| ผู้ตรวจสอบ (RACKSYNC) | — | — |
| ผู้รับมอบงาน (OBH) | — | — |
เอกสารอ้างอิง (References)
หัวข้อที่มีชื่อว่า “เอกสารอ้างอิง (References)”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)