← 返回
未分类 中文

Docker Health Monitor

Monitor Docker container health: running status, CPU/memory usage, restart counts, and available image updates. Use when a user requests Docker health checks...
监控Docker容器健康状态:运行状态、CPU/内存使用率、重启次数以及可用镜像更新。用户请求Docker健康检查时使用。
laolaoqi
未分类 clawhub v1.0.0 1 版本 99596.8 Key: 无需
★ 0
Stars
📥 247
下载
💾 0
安装
1
版本
#latest

概述

Docker Health Monitor

Script

scripts/docker-health.sh — the single entry point for all checks.

The script is self-contained and works on any system with Docker installed. It auto-detects the Docker socket availability and gracefully handles permission issues.

Quick Start

Run a full health report:

bash scripts/docker-health.sh --all

Or with no arguments (same as --all):

bash scripts/docker-health.sh

Individual Checks

Run any single check by name:

CommandWhat it checks
------
--statusLists all containers with their current status (running, stopped, paused, etc.)
--resourcesShows CPU and memory usage per container via docker stats
--restartsFlags containers that have restarted more than 3 times
--imagesChecks for available image updates by comparing local image digests with registry
--fullRuns all checks in sequence (same as --all)

Example:

bash scripts/docker-health.sh --status --restarts

Full Audit Workflow

  1. Run bash scripts/docker-health.sh --all
  2. The script outputs a formatted report to stdout
  3. Key sections: container status summary, resource usage table, restart warnings, image update availability

Common Findings & Recommendations

  • High restart counts (>3): Indicates container instability — check logs with docker logs and review healthcheck configuration
  • High memory usage: Consider setting --memory limits in the container's run/stack config; check for memory leaks in the application
  • High CPU usage: Investigate application processes; consider CPU limits or horizontal scaling
  • Outdated images: Run docker pull to update images; consider automated update workflows (watchtower, renovate-bot)
  • Exited containers: Check exit codes — 0 means intentional stop, non-zero indicates errors

Notes

  • Requires access to the Docker socket (/var/run/docker.sock) — run as root or add user to the docker group
  • --resources runs docker stats in non-streaming mode (one-shot per container) for quick snapshots
  • --images checks are advisory — uses docker inspect for image digests and checks for newer versions; requires network access to the registry
  • Works with both local Docker and remote Docker contexts (DOCKER_HOST env var)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-21 15:01 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 673 📥 325,054
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,073 📥 806,307
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,374 📥 319,869