-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrundiag.sh
108 lines (79 loc) · 3.62 KB
/
rundiag.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#! /bin/sh
####################################################################
# USB stack and host controller driver for SGI IRIX 6.5 #
# #
# Programmed by BSDero #
# bsdero at gmail dot com #
# 2011/2012 #
# #
# #
# File: rundiag.sh #
# Description: Diagnostics script #
####################################################################
#############################################################################################
# Fixlist (Latest at top) #
#############################################################################################
# Author MM-DD-YYYY Description #
#############################################################################################
# BSDero 08-01-2012 -Initial version #
# #
#############################################################################################
if [ -e diaginfo ]; then
rm -rf diaginfo
fi
if [ -e diaginfo.tar ]; then
rm -f diaginfo.tar
fi
if [ -e diaginfo.tar.Z ]; then
rm -f diaginfo.tar.Z
fi
if [ -e diaginfo.tar.bz2 ]; then
rm -f diaginfo.tar.bz2
fi
mkdir -p diaginfo/analysis
mkdir -p diaginfo/disam
##########################################################################################
# Get the last 5000 lines for SYSLOG
##########################################################################################
tail -8000 /var/adm/SYSLOG > diaginfo/SYSLOG
##########################################################################################
# Get analysis files
##########################################################################################
cp /var/adm/crash/analysis* diaginfo/analysis
##########################################################################################
# Also get kernel modules base address
##########################################################################################
grep "diaginfo" diaginfo/SYSLOG > diaginfo/analysis/kmodules_base_address
##########################################################################################
# Disassembled files add for core analysis
##########################################################################################
cp *.disam diaginfo/disam/
cp diaginfo/analysis/kmodules_base_address diaginfo/disam/
##########################################################################################
# Retrieve info
##########################################################################################
OUTPUT=diaginfo/machine.info
echo "#date">$OUTPUT
date>>$OUTPUT
echo>>$OUTPUT
echo "#uname -a">>$OUTPUT
uname -a>>$OUTPUT
echo >>$OUTPUT
echo "#hinv -v">>$OUTPUT
hinv -v>>$OUTPUT
echo>>$OUTPUT
echo "#hinv">>$OUTPUT
hinv >>$OUTPUT
echo>>$OUTPUT
echo "#df -h">>$OUTPUT
df -h>>$OUTPUT
echo>>$OUTPUT
echo "#ml">>$OUTPUT
ml>>$OUTPUT
echo>>$OUTPUT
echo "#versions | grep -i compiler">>$OUTPUT
versions | grep -i compiler>>$OUTPUT
echo>>$OUTPUT
tar cvf diaginfo.tar diaginfo
compress diaginfo.tar
echo "Done. Take file diaginfo.tar.Z and send to maintainer"