Markus Michalski FAQ

Watchdog: Docker Exec

Runs a command inside a Docker container through the Docker API and evaluates the exit code. Type docker_exec, runner Dashboard or Agent. Fields and statuses.

Deutsche Version

Back to check types

Watchdog: Docker Exec

The check runs a command in a running container and evaluates only the exit code. The command's output is discarded.

Property Value
Type identifier docker_exec
Runner Dashboard or Agent
Target in the email Container

Fields

Field Key Default Meaning
Container name container_name Required. Exact container name
Command command Required. Command run in the container via sh -c, for example php bin/console app:health
Timeout (seconds) timeout 10 Time limit for start, execution and evaluation, at least 1

Behaviour

Situation Status Message
Exit code 0 OK Exit code 0
Exit code other than 0 FAIL Exit code <n>
Container not found, API error or timeout FAIL Docker API error: <reason>
Socket missing UNKNOWN Docker socket not available at /var/run/docker.sock
No container name UNKNOWN No container_name configured
No command UNKNOWN No command configured

The command runs in the container as its default user. You can check the reachability of a database inside the Docker network, for example, by running mysqladmin ping in the database container.

The command comes from the check's configuration and runs through the Docker API in any container the daemon knows. Restrict access to the UI and to the Docker socket accordingly.

The socket requirements are the same as for the Docker check.