1
0

sos-linux 1.0 KB

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