blob: f8b90e72b6ce4f65e07945f3ca47705bb8259234 [file] [log] [blame]
#!/bin/sh
#### This program collects some information about a system running myri10ge
#### Non trivial bug reports should include the output file generated by this program
#### to ease/speed-up problem resolution diagnotic
error ()
{
echo >&2
echo "ERROR:$@" >&2
exit 1
}
delim ()
{
set +x
echo ""
echo "***************"
echo "***************"
echo "** $@"
echo "***************"
}
delimx ()
{
set +x
delim "$@"
set -x
}
PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
test -f myri10ge_checks.h || ( echo "**ERROR: myri10ge_checks.h not found: be sure myri10ge has been compiled" && exit -1 )
test -f myri10ge_version.h || ( echo "**ERROR: myri10ge_version.h not found: be sure myri10ge has been compiled" && exit -1 )
headers=`sed -r -ne 's@^.* ([^ ]*/include).*$@\1@p' < myri10ge_checks.h`
output="myri10ge_bug.`hostname --short`-`date +%F_%H%m%S`.txt"
test "`id -nu`" = root || echo "**WARNING: not root user: report will be incomplete:please run as root**" >&2
echo "Will collect system info in file:" >&2
echo " $output.gz " >&2
echo " " >&2
echo " Starting collecting system information..." >&2
(
exec > "$output" || error "cannot create $output file"
exec 2>&1
exec < /dev/null
###########################################
#Start collection various system information
###########################################
set -x
id -a
uname -a
set +x
for f in /etc/debian_version /etc/cat /etc/redhat-release /etc/SuSE-release; do
if test -r $f ; then
delim $f
cat "$f"
fi
done
delim myri10ge version
cat myri10ge_version.h
delim myri10ge checks
cat myri10ge_checks.h
for f in /proc/cpuinfo /proc/meminfo /proc/version /proc/uptime \
/proc/cmdline /proc/interrupts /proc/net/dev /proc/iomem \
/proc/mtrr; do
delim "$f:"
cat $f
done
delim "dmesg output"
dmesg
for logfile in /var/log/messages.1 /var/log/messages.0 /var/log/messages ; do
if test -r $logfile ; then
delim "$logfile extract"
egrep -A3 -B3 -i "myri10ge" "$logfile" | tail -2000
fi
done
delim "lspci -vv -xxx"
lspci -vv -xxx
delim "lspci -vvv -xxxx -d 14c1:"
lspci -vvv -xxxx -d 14c1:
if test -d /sys/modules/myri10ge/parameters; then
delim "myri10ge module params"
find /sys/modules/myri10ge/parameters -type f | xargs head
fi
delim "lsmod"
lsmod
if test -f /proc/config.gz ; then
delim /proc/config.gz
zcat /proc/config.gz
else
if test -f /boot/config-`uname -r` ; then
delim "/boot/config-`uname -r`"
cat /boot/config-`uname -r`
else
delim "/lib/modules/`uname -r`/build/.config"
cat /lib/modules/`uname -r`/build/.config
fi
fi
for header in ${headers}/linux/{interrupt,pci,pm,skbuff}.h ; do
delim "kernel header ${header}"
cat ${header}
done
for f in /var/log/dmesg /var/log/boot.msg; do
if test -r $f ; then
delim $f
cat "$f"
fi
done
delim "sysctl info"
sysctl -a
for i in `ifconfig -a | grep -i '00:60:dd' | awk '{print $1}'`
do
delim "ifconfig $i"
ifconfig $i
delim "ethtool -i $i"
ethtool -i $i
delim "ethtool -S $i"
ethtool -S $i
delim "ethtool -k $i"
ethtool -k $i
delim "ethtool -C $i"
ethtool -c $i
done
delim "netstat -s"
netstat -s
for FW_DIR in /lib/firmware /usr/lib/hotplug/firmware;
do
if [ -d $FW_DIR ];
then
delim "contents of $FW_DIR"
ls -l $FW_DIR/myri*.dat
else
delim "$FW_DIR does not exist"
fi
done
if test -r /etc/vmware-release ; then
delim "/etc/vmware-release"
cat /etc/vmware-release
fi
if test -r /proc/vmware/log ; then
delim "/proc/vmware/log"
cat /proc/vmware/log
fi
if test -r /etc/vmware/esx.conf ; then
delim "/etc/vmware/esx.conf"
cat /etc/vmware/esx.conf
fi
if test -e /usr/sbin/esxcfg-nics ; then
delim "esxcfg-nics"
/usr/sbin/esxcfg-nics -l
fi
if test -e /usr/sbin/esxcfg-vswitch ; then
delim "esxcfg-vswitch"
/usr/sbin/esxcfg-vswitch -l
fi
if test -e /usr/sbin/esxcfg-info ; then
delim "esxcfg-info"
/usr/sbin/esxcfg-info -n
fi
if test -e /usr/sbin/esxcfg-info ; then
delim "esxcfg-info"
/usr/sbin/esxcfg-info -n
fi
if test -e /usr/sbin/esxcfg-module ; then
delim "esxcfg-module -l"
/usr/sbin/esxcfg-module -l
delim "esxcfg-module -g myri10ge"
esxcfg-module -g myri10ge
fi
delim "END OF BUG REPORT"
exit 0
) || error "collection failed"
### end of collection, compress file #####
echo >&2
rm -f "$output.gz"
gzip -9 "$output" || error "Cannot compress $output!?"
echo "" >&2
echo " $output.gz created" >&2
echo " Please send it to help@myri.com with a description of your problem" >&2
echo "" >&2