-
Notifications
You must be signed in to change notification settings - Fork 11
/
configCollector.ksh
168 lines (139 loc) · 4.4 KB
/
configCollector.ksh
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#!/bin/ksh
# Created by: K. March -- 24Mar03
## /tmp/$SUNdata (IP xxx.xxx.xxx.xxx ADDRESS) - March 12 2003
## Should be run as uid: root
########################################################
SUNdata=/tmp/`uname -n`data.txt
LN=-------------------------------------------------------------------------
touch $SUNdata
## Display IP address of machine #
echo "##/$SUNdata (`ifconfig hme0 | grep inet| awk '{print $2}'`)
`/usr/bin/date`" >> $SUNdata
echo "##`uname -i|grep -v SUNW`" >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get hostid ######
echo "Hostid: `/usr/bin/hostid`" >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get Serial # ######
## Must be manually edited
echo "Serial Number: _ _ _ _ _ _ _" >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get uname -a ######
echo "uname -a:" >> $SUNdata
/usr/bin/uname -a >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get /etc/release ####
echo "/etc/release:" >> $SUNdata
cat /etc/release >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get Sys Memory ######
echo "System Memory:" >> $SUNdata
prtconf | grep Mem >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get Psrinfo ######
echo "Processor information:" >> $SUNdata
/usr/sbin/psrinfo >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get nic speed #####
## Assumes one is using eri for NIC ##
echo "NIC speed: (ndd -get /dev/eri link_speed) [0=10; 1=100]: `ndd -get
/dev/eri link_speed`" >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get hosts info ####
echo "/etc/hosts:" >> $SUNdata
cat /etc/hosts >> $SUNdata
echo $LN >> $SUNdata
####### Get resolv.conf ####
echo "/etc/resolv.conf:" >> $SUNdata
cat /etc/resolv.conf >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get defaultrouter ####
echo "/etc/defaultrouter:" >> $SUNdata
cat /etc/defaultrouter >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get passwd ####
echo "/etc/passwd:" >> $SUNdata
cat /etc/passwd >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get vfstab ####
echo "/etc/vfstab:" >> $SUNdata
cat /etc/vfstab >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get dfstab ####
echo "/etc/dfs/dfstab:" >> $SUNdata
cat /etc/dfs/dfstab >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get system ####
echo "/etc/system:" >> $SUNdata
tail -40 /etc/system >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get eeprom ####
echo "eeprom values:" >> $SUNdata
/usr/sbin/eeprom >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
####### Get nddsets ####
echo "/etc/init.d/nddsets:" >> $SUNdata
cat /etc/init.d/nddsets >> $SUNdata
echo "" >> $SUNdata
echo $LN >> $SUNdata
##### !! Only get when a disk is mirrored ########
##### Uncomment the following lines if needed #####
####### get metadb info ##
#metadb >> $SUNdata
#echo "" >> $SUNdata
###### get metastat
#metastat >> $SUNdata
#echo "" >> $SUNdata
# !! ####
###################################################
### The following script defaults to grab
### information from a server with two disks.
### Uncomment lines based on number of disks in server.
####### Disk Partitions:
echo "" >> $SUNdata
echo "Disk Partitions:\c" >> $SUNdata
echo "0\n" "p\n" "p\n" | format >> $SUNdata
echo "" >> $SUNdata
echo "1\n" "p\n" "p\n" | format >> $SUNdata
#echo "" >> $SUNdata
#echo "2\n" "p\n" "p\n" | format >> $SUNdata
#echo "" >> $SUNdata
#echo "3\n" "p\n" "p\n" | format >> $SUNdata
#echo "" >> $SUNdata
#echo "4\n" "p\n" "p\n" | format >> $SUNdata
#echo "" >> $SUNdata
#echo "5\n" "p\n" "p\n" | format >> $SUNdata
#echo "" >> $SUNdata
#
echo $LN >> $SUNdata
## Mail file to specified e-mail address for archival.
## uncomment as needed.
#mailx -s "System information for `uname -n`; collected on `date +u %m%d`"
'place e-mail@address here' < $SUNdata
## END
##############################################################################
### This script is submitted to BigAdmin by a user of the BigAdmin community.
### Sun Microsystems, Inc. is not responsible for the
### contents or the code enclosed.
###
###
### Copyright 2007 Sun Microsystems, Inc. ALL RIGHTS RESERVED
### Use of this software is authorized pursuant to the
### terms of the license found at
### http://www.sun.com/bigadmin/common/berkeley_license.html
##############################################################################