Skip to content

Docker daemon — alert when dockerd hangs

docker info hangs >30 s — the daemon is in a split-brain state. Containers keep running (kernel holds the namespaces), but you cannot deploy a new release. systemctl status shows active.

Recipe

bash
#!/usr/bin/env bash
# /etc/cron.d/docker-hang
# */2 * * * * root /opt/docker-hang.sh

TIMEOUT=${TIMEOUT:-15}

# Use timeout — `docker info` will hang forever if daemon is wedged
if timeout "$TIMEOUT" docker info >/dev/null 2>&1; then
  echo "OK"
  exit 0
fi

curl -fsS "$HEARTBEAT_URL" --data "docker_hang=true,timeout=${TIMEOUT}s"
exit 2

Same thing in Enterno.io

Set up an Enterno heartbeat on a 2-minute schedule — learn about a daemon hang inside 4 minutes, not "the next morning when the first deploy fails CI".

Set up Heartbeat monitor → ← All recipes

Related recipes