Permalink
Browse files

Enable diagnostics report submission, will be used with

crash-dumps for debugging kernel panics and such
  • Loading branch information...
1 parent 5be7a88 commit 90ae8ad10268fb6ef118c5c20721a2f840fa7c86 @kmoore134 kmoore134 committed Sep 5, 2013
View
44 src-sh/pc-extractoverlay/ports-overlay/usr/local/bin/ixinitdiag
@@ -0,0 +1,44 @@
+#!/bin/sh
+# Script to upload the initial system diagonostics report
+#
+# No personal data is contained in this report, it is just
+# used for crash dump diagnostics and metrics
+########################################################
+
+DIAGFILE=`mktemp /tmp/.diagFile.XXXXXX` || exit 1
+
+# Create the diagnostics file now
+echo "hostid: `cat /etc/hostid`" > ${DIAGFILE}
+echo "#########################" >> ${DIAGFILE}
+
+echo "dmesg output:" >> ${DIAGFILE}
+echo "#########################" >> ${DIAGFILE}
+dmesg >> ${DIAGFILE}
+echo "#########################" >> ${DIAGFILE}
+
+echo "pkg output:" >> ${DIAGFILE}
+echo "#########################" >> ${DIAGFILE}
+pkg info >> ${DIAGFILE}
+echo "#########################" >> ${DIAGFILE}
+
+echo "gpart output:" >> ${DIAGFILE}
+echo "#########################" >> ${DIAGFILE}
+gpart show >> ${DIAGFILE}
+echo "#########################" >> ${DIAGFILE}
+
+echo "pciconf output:" >> ${DIAGFILE}
+echo "#########################" >> ${DIAGFILE}
+pciconf -lv >> ${DIAGFILE}
+echo "#########################" >> ${DIAGFILE}
+
+echo "zpool status output:" >> ${DIAGFILE}
+echo "#########################" >> ${DIAGFILE}
+zpool status >> ${DIAGFILE}
+echo "#########################" >> ${DIAGFILE}
+
+/usr/local/bin/crashuploader $DIAGFILE
+if [ $? -eq 0 ] ; then
+ # Good upload? Ok, we can ignore this from now on
+ touch /var/db/ix_diag_init
+fi
+rm $DIAGFILE
View
6 src-sh/pc-extractoverlay/ports-overlay/usr/local/etc/rc.d/ix_diagnose
@@ -22,6 +22,12 @@ ix_diagnose_start()
# add /usr/local/bin for python..
PATH="$PATH:/usr/local/bin:/usr/local/sbin"
export PATH
+
+ # Check if we have sent a diag report yet
+ if [ ! -e "/var/db/ix_diag_init" ] ; then
+ (/usr/local/bin/ixinitdiag >/dev/null 2>/dev/null) &
+ fi
+
_pidfile=`mktemp -t ix_diagnose`
(
sh -x /usr/local/bin/ixdiagnose -b \

0 comments on commit 90ae8ad

Please sign in to comment.