#!/bin/sh # Gather diagnostic data and write a .tar file to stdout TEMP=$(mktemp -d diagnoseXXXXXXX) trap 'rm -rf "$TEMP"' EXIT mkdir $TEMP/moby cd $TEMP/moby # gather diagnostic data timeout -t 2 date > "date" timeout -t 2 uname -a > "uname -a" timeout -t 2 ps uax > "ps -aux" timeout -t 2 netstat -tulpn > "netstat -tulpn" timeout -t 2 iptables-save > "iptables-save" timeout -t 2 ifconfig -a > "ifconfig -a" timeout -t 2 route -n > "route -n" timeout -t 2 brctl show > "brctl show" timeout -t 2 dmesg > dmesg timeout -t 2 docker ps > "docker ps" timeout -t 2 tail /var/log/docker.log > "docker.log" timeout -t 2 mount > "mount" timeout -t 2 df > "df" timeout -t 2 ls -l /var &> "ls -l var" timeout -t 2 ls -l /var/lib &> "ls -l var_lib" timeout -t 2 ls -l /var/lib/docker &> "ls -l var_lib_docker" timeout -t 2 /usr/bin/diagnostics > "diagnostics" timeout -t 2 ping -w 5 8.8.8.8 &> "ping -w 5 8.8.8.8" timeout -t 2 cp /etc/resolv.conf . timeout -t 2 dig docker.com > "dig docker.com" timeout -t 2 wget -O - http://www.docker.com/ &> "wget docker.com" # send everything to the client cd .. tar -c .