Merge pull request #59 from djs55/diagnostics-server

Allow diagnostics to be downloaded on port 62374
This commit is contained in:
Justin Cormack 2016-03-31 12:16:00 +01:00
commit 3473f0717f
4 changed files with 45 additions and 0 deletions

View File

@ -34,6 +34,8 @@ COPY packages/docker/docker /usr/bin/
COPY packages/docker/etc /etc/
COPY packages/docker-x/docker-x /usr/bin/
COPY packages/diagnostics/diagnostics /usr/bin/
COPY packages/diagnostics/diagnostics-server /usr/bin/
COPY packages/diagnostics/diagnostics-download /usr/bin/
COPY packages/diagnostics/etc /etc/
COPY packages/automount/etc /etc/
COPY packages/9pinit/etc /etc/

View File

@ -0,0 +1,35 @@
#!/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
date > "date"
uname -a > "uname -a"
ps uax > "ps -aux"
netstat -tulpn > "netstat -tulpn"
iptables -t nat -L > "iptables -t nat -L"
ifconfig -a > "ifconfig -a"
route -n > "route -n"
brctl show > "brctl show"
dmesg > dmesg
timeout -t 2 docker ps > "docker ps"
tail /var/log/docker.log > "docker.log"
mount > "mount"
df > "df"
ls -l /var &> "ls -l var"
ls -l /var/lib &> "ls -l var_lib"
ls -l /var/lib/docker &> "ls -l var_lib_docker"
/usr/bin/diagnostics > "diagnostics"
ping -w 5 8.8.8.8 &> "ping -w 5 8.8.8.8"
cp /etc/resolv.conf .
dig docker.com > "dig docker.com"
wget -O - http://www.docker.com/ &> "wget docker.com"
# send everything to the client
cd ..
tar -c .

View File

@ -0,0 +1,7 @@
#!/bin/sh
# Allow clients (e.g. pinata diagnose) to download diagnostic data
while /bin/true; do
nc -l -p 62374 -e /usr/bin/diagnostics-download 2>> /var/log/diagnostics-server.log
done

View File

@ -10,4 +10,5 @@ start()
ebegin "Checking system state"
/usr/bin/diagnostics
/usr/bin/diagnostics-server &
}