mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-04-11 23:03:56 +00:00
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>
21 lines
458 B
Bash
Executable File
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 .
|