Files
linuxkit/alpine/packages/diagnostics/diagnostics-download
David Scott d842e1b5dc Allow diagnostics to be downloaded on port 62374
A client like `pinata diagnose` can do the equivalent of:

  nc 192.168.64.2 62374 > foo.tar

and find `foo.tar` contains

- the output of `/usr/bin/diagnostics`
- `iptables -L`
- `netstat -an`
- `ps uax`
- `docker ps`
- `dig docker.com`
- `wget http://docker.com`

This will allow us to diagnose various in-VM faults, without having
to ask the user to access the console and run commands.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-03-30 10:31:55 +01:00

21 lines
458 B
Bash
Executable File

#!/bin/sh
# Gather diagnostic data and write a .tar file to stdout
TEMP=$(mktemp -d diagnoseXXXXXXX)
trap 'rm -rf "$TEMP"' EXIT
cd $TEMP
# gather diagnostic data
ps uax > "ps -aux"
netstat -an > "netstat -an"
iptables -L > "iptables -L"
dmesg > dmesg
timeout -t 2 docker ps > "docker ps"
/usr/bin/diagnostics > "diagnostics"
dig docker.com > "dig docker.com"
wget -O - http://www.docker.com/ &> "wget docker.com"
# send everything to the client
tar -c .