mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 10:09:07 +00:00
Merge pull request #59 from djs55/diagnostics-server
Allow diagnostics to be downloaded on port 62374
This commit is contained in:
commit
3473f0717f
@ -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/
|
||||
|
35
alpine/packages/diagnostics/diagnostics-download
Executable file
35
alpine/packages/diagnostics/diagnostics-download
Executable 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 .
|
7
alpine/packages/diagnostics/diagnostics-server
Executable file
7
alpine/packages/diagnostics/diagnostics-server
Executable 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
|
@ -10,4 +10,5 @@ start()
|
||||
ebegin "Checking system state"
|
||||
|
||||
/usr/bin/diagnostics
|
||||
/usr/bin/diagnostics-server &
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user