Skip to content

Instantly share code, notes, and snippets.

@ganesh-d-murthy
ganesh-d-murthy / checkDockerDisks.sh
Created January 25, 2024 20:30 — forked from robsonke/checkDockerDisks.sh
This Bash script will loop through all running docker containers on a host and list the disk usage per mount. In case it's breaching the 65%, it will email you.
#!/bin/bash
# get all running docker container names
containers=$(sudo docker ps | awk '{if(NR>1) print $NF}')
host=$(hostname)
# loop through all containers
for container in $containers
do
echo "Container: $container"