Skip to content

Instantly share code, notes, and snippets.

@adamreese
Last active September 15, 2015 17:45
Show Gist options
  • Save adamreese/a26c58bc510cf24d6728 to your computer and use it in GitHub Desktop.
Save adamreese/a26c58bc510cf24d6728 to your computer and use it in GitHub Desktop.
Check docker ps in all fleet hosts
#!/usr/bin/env bash
set -e
# check for fleetctl in $PATH
if ! which fleetctl > /dev/null; then
echo 'Please install fleetctl and ensure it is in your $PATH.'
exit 1
fi
MACHINES=$(fleetctl list-machines -fields machine --full --no-legend)
for m in $MACHINES; do
#echo "Checking images in ${m}"
#fleetctl ssh $m docker images | awk '/deis/'
#echo
echo "Checking containers in ${m}"
fleetctl ssh $m docker ps | awk '/deis/ {print $2}'
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment