Debian Codegraph @

sos-linux

raw
1 #! /bin/sh
2
3 me="`basename $0`"
4 outf="$HOME/sos-`hostname`-`date +%Y%m%d-%H%M%S`.txt"
5
6 if test "`whoami`" != "root"; then
7 echo "$me: please run $me as root" 1>&2
8 exit 1
9 fi
10 echo "$me: output file is $outf"
11
12 exec > $outf
13 exec 2>&1
14 set -x
15 uname -a
16 grep . /etc/*release* /etc/*version* | sed 50q
17 find /sys/module/aoe -name version | xargs cat
18 cat /proc/mounts
19 aoe-version
20 aoe-stat
21 cat /proc/mdstat
22 pvs
23 ifconfig -a
24 free
25 dmesg | tail -n 50
26 lspci
27 set +x
28 for i in `aoe-stat | awk '{print $3}' | sed 's!,! !g'`; do
29 echo ethtool -S $i
30 done | sort | uniq | sh -x
31 # top -b -n 1
32
33 # check for old-style sysfs-exported debug information, ignoring errors
34 grep . /sys/block/etherd*/debug /dev/null
35
36 # check for new-style debugfs-exported debug information, ignoring errors
37 dmnt=/sys/kernel/debug
38 didmount=
39 mounted=`awk '$3=="debugfs"{print $2}' /proc/mounts`
40 if test "x$mounted" = "x" && mount -t debugfs none "$dmnt"; then
41 didmount="$dmnt"
42 mounted="$dmnt"
43 fi
44 cd "$mounted"/aoe && grep . e[0-9]*.*[0-9]
45 cd /
46 if test "x$didmount" != "x"; then
47 umount "$didmount"
48 fi
49 exit 0