2 #############################################
4 # system characterization script
5 # "scs" collects data from Atria
6 # customer sites for analysis by
8 ######################################
10 #########################
11 # For Solaris 5.x systems
12 #########################
17 /usr/sbin/ndd /dev/$i \? | awk '{print $1}' | \
18 egrep -v '\?|directed|respond'> /tmp/$$
19 for j in `cat /tmp/$$`
21 printf "%-30s %s\n" $j `/usr/sbin/ndd /dev/$i $j`
29 show "System Device Configuration" /usr/sbin/prtconf -vP
30 show "System Configuration" /usr/sbin/sysdef -i
31 show "System Customization" '/bin/cat /etc/system | \
32 /bin/grep -v "^\*" | /bin/grep -v "^$"'
33 show "Network Configuration" nddit
34 show "System Messages" /bin/dmesg
35 show "Patches" /bin/showrev -p
37 show "Processes" '/usr/ucb/ps auxww | /bin/fold -80'
38 show "Network Configuration" /usr/sbin/ifconfig -a
39 show "Network Utilization Summary" /bin/netstat -i
40 show "Network Protocol Statistics" /bin/netstat -s
41 show "Network Mbuf Statistics" /bin/netstat -m
42 show "VM Statistics" /bin/vmstat -s
43 show "Cache Flush Statistics" /bin/vmstat -c
44 show "Interrupts" /bin/vmstat -i
45 show "NFS Statistics" /bin/nfsstat
46 show "NFS Responses" /bin/nfsstat -m
48 show "CPU Utilization" /bin/sar -u 1 10
49 show "Buffer Activity" /bin/sar -b 1 10
50 show "Block Device Activity" /bin/sar -d 1 10
51 show "Disk Device Activity" iostat -x 1 10
52 show "Paging In Activity" /bin/sar -p 1 5
53 show "Paging Out Activity" /bin/sar -g 1 5
54 show "Free Memory" /bin/sar -r 1 5
55 show "vmstat snapshot" /bin/vmstat 2 10
56 show "Kernel Memory Allocation Activity" /bin/sar -k 1 5
57 show "KMA statistics" echo kmastat | /usr/sbin/crash
61 #######################
62 # For SUNOS 4.x systems
63 #######################
67 show "Memory " '/etc/dmesg | grep mem'
68 show "System Messages" /etc/dmesg
69 show "Processes" '/bin/ps auxww | /usr/ucb/fold -80'
70 show "Network Utilization Summary" /usr/ucb/netstat -i
71 show "Network Protocol Statistics" /usr/ucb/netstat -s
72 show "Network Mbuf Statistics" /usr/ucb/netstat -m
73 show "VM Statistics" /usr/ucb/vmstat -s
74 show "Cache Flush Statistics" /usr/ucb/vmstat -c
75 show "Interrupts" /usr/ucb/vmstat -i
76 show "NFS Statistics" /usr/etc/nfsstat
78 show "Disk Device Activity" /bin/iostat -D 1 10
79 show "CPU Activity" /usr/ucb/vmstat 1 10
80 show "Tables" /etc/pstat -T
81 show "vmstat snapshot" /usr/ucb/vmstat 2 10
86 #######################
88 #######################
92 show "Processes" '/usr/bin/ps -elf '
93 show "Network Utilization Summary" /bin/netstat -i
94 show "Network Protocol Statistics" /bin/netstat -s
95 show "Network Mbuf Statistics" /bin/netstat -m
96 show "Network Configurables" /usr/sbin/no -a
97 show "NFS Statistics" /usr/sbin/nfsstat
99 show "System Attributes" /usr/sbin/lsattr -E -l sys0
100 show "CPU Utilization" sar -u 1 10
101 show "Buffer Activity" sar -b 1 10
102 show "Disk Activity" /bin/iostat 1 10
103 show "Paging Stats" sar -r 1 5
104 show "Network Monitor for 30s" '/bin/netpmon -v -o /tmp/$$; sleep 30; trcstop'
108 #######################
110 #######################
113 show "Boot Messages" 'echo "";echo ""; echo "";uerf -r 300 | tail -100'
114 show "Processes" '/usr/bin/ps glww | fold -80'
115 show "Network Utilization Summary" /usr/sbin/netstat -i
116 show "Network Protocol Statistics" /usr/sbin/netstat -s
117 show "Network Mbuf Statistics" /usr/sbin/netstat -m
118 show "NFS Statistics" /usr/bin/nfsstat
119 show "Kernel memory usage" /usr/bin/vmstat -M
120 show "vmstat snapshopt" /usr/bin/vmstat 2 10
121 show "Disk Device snapshot" /bin/iostat 2 10
125 #######################
127 #######################
130 show "System Device Configuration" /usr/sbin/sysconf
131 show "System Hardware Configuration" /usr/bin/hinv
132 show "System Software Configuration" /etc/chkconfig
133 show "Disk Usage" /usr/sbin/df -l -k
134 show "System Customization" '/bin/cat /var/sysgen/stune | \
135 /bin/grep -v "^\*" | /bin/grep -v "^$"'
137 show "Processes" '/usr/bin/ps -elf | /bin/fold -80'
138 show "Network Utilization Summary" /usr/etc/netstat -i
139 show "Network Protocol Statistics" /usr/etc/netstat -s
140 show "Network Mbuf Statistics" /usr/etc/netstat -m
141 show "NFS Statistics" /usr/etc/nfsstat
143 show "CPU Utilization" sar -u 1 10
144 show "Buffer Activity" sar -b 1 10
145 show "Block Device Activity" sar -d 1 10
146 show "Paging In Activity" sar -p 1 5
147 show "Paging Out Activity" sar -g 1 5
148 show "Free Memory" sar -r 1 5
153 #####################
154 # For HP-UX 9/800 systems
155 #####################
158 #first the shared info
160 # now the system specific
161 show "System definition" /etc/sysdef
162 show "CPU Utilization" /usr/bin/sar -u 1 10
163 show "Buffer Activity" /usr/bin/sar -b 1 10
164 show "Block Device Activity" /usr/bin/sar -d 1 10
166 #####################
167 # For HP-UX 9/700 systems
168 #####################
171 # just the shared info
174 #####################
175 # For All HP-UX 9 systems
176 #####################
179 show "Memory " grep Physical /usr/adm/messages
180 show "System Messages" /etc/dmesg
181 show "Swap Space" /etc/swapinfo
182 show "Patches" ls -ld /system/PH*
183 show "IO devices" /etc/ioscan -f
185 show "Processes" '/bin/ps -elf | /usr/bin/fold -80'
186 show "Network Utilization Summary" /usr/bin/netstat -i
187 show "Network Protocol Statistics" /usr/bin/netstat -s
188 show "Network Mbuf Statistics" /usr/bin/netstat -m
189 show "VM Statistics" /usr/bin/vmstat -s
190 show "NFS Statistics" /usr/etc/nfsstat
191 show "Network errors" /etc/netfmt -t 30 -f /usr/adm/nettl.LOG00
193 show "Disk Utilization" df -l
194 show "vmstat snapshot" /usr/bin/vmstat 2 10
197 #####################
198 # For HP-UX 10 systems
199 #####################
203 show "Memory " grep Physical /var/adm/syslog/syslog.log
204 show "System DMessages" /usr/sbin/dmesg
205 show "System definition" /usr/sbin/sysdef
206 show "Messages" "tail -100 /usr/adm/syslog/syslog.log"
207 show "IO status" /etc/ioscan -f
208 show "Patches" '/usr/sbin/swlist -l product | grep PH'
210 show "Processes" '/usr/bin/ps -elf | /usr/bin/fold -80'
211 show "Network Utilization Summary" /usr/bin/netstat -i
212 show "Network Protocol Statistics" /usr/bin/netstat -s
213 show "Network Mbuf Statistics" /usr/bin/netstat -m
214 show "VM Statistics" /usr/bin/vmstat -s
215 show "NFS Statistics" /usr/bin/nfsstat
217 show "CPU Utilization" /usr/bin/sar -u 1 10
218 show "Buffer Activity" /usr/bin/sar -b 1 10
219 show "Block Device Activity" /usr/bin/sar -d 1 10
220 show "vmstat snapshot" /usr/bin/vmstat 2 10
222 #####################
223 # For Unixware systems
224 #####################
227 show "Memory size" /sbin/memsize
228 show "Message log" cat /usr/adm/log/osmlog
229 show "System Configuration" /usr/sbin/sysdef
230 show "Processes" '/usr/bin/ps -elf '
231 show "Network Utilization Summary" /bin/netstat -i
232 show "Network Protocol Statistics" /bin/netstat -s
233 show "NFS Statistics" /usr/sbin/nfsstat
235 show "CPU Utilization" /sbin/sar -u 1 10
236 show "Buffer Activity" /sbin/sar -b 1 10
237 show "Block Device Activity" /sbin/sar -d 1 10
238 show "Paging In Activity" /sbin/sar -p 1 5
239 show "Paging Out Activity" /sbin/sar -g 1 5
240 show "Free Memory" /sbin/sar -r 1 5
241 show "Historical sar data" /sbin/sar -A
246 ####################################
247 # display informationin a uniform way
248 ####################################
250 echo "----------------------------------------------------"
252 echo "----------------------------------------------------"
257 ##################################################
258 # check uw network - works for Unixware
259 ##################################################
262 netstat -i $interface
264 netstat -i $interface
267 ##################################################
268 # check network - works for HP-UX and SUNOS 5.x
269 ##################################################
271 printf "%8s %8s %8s %8s %8s %8s \n" time inpkts inerrs \
272 outpkts outerrs colls
273 netstat -i -I $interface $interval | (
274 (line ; line ; line) > /dev/null
275 t_inpkts=0 # initialize counter
276 t_inerrs=0 # initialize counter
277 t_outpkts=0 # initialize counter
278 t_outerrs=0 # initialize counter
279 t_colls=0 # initialize counter
281 while test $i -lt $count ; do # for each of the lines
284 set -- `line` # get the line
285 printf "%8s %8s %8s %8s %8s\n" $1 $2 $3 $4 $5
286 t_inpkts=`expr $1 + $t_inpkts` # accumulate in packets
288 t_inerrs=`expr $1 + $t_inerrs` # accumulate in errors
290 t_outpkts=`expr $1 + $t_outpkts` # accumulate out packets
292 t_outerrs=`expr $1 + $t_outerrs` # accumulate out errors
294 t_colls=`expr $1 + $t_colls` # accumulate collisions
297 printf "\n%8s %8s %8s %8s %8s %8s \n" \
298 total $t_inpkts $t_inerrs $t_outpkts $t_outerrs $t_colls
299 # now check error and collision rate.
300 # Use awk to get floating point accuracy
301 echo $t_colls $t_outpkts $t_inerrs $t_inpkts | awk '$2 != 0 {
302 collision_rate = $1 / $2;
303 printf("\n\ncollision rate ( %g %% )", (collision_rate * 100.0));
304 if ( collision_rate > 0.05 )
305 printf(" too high. Add subnets.\n");
309 error_rate = $3 / $4;
310 printf(" error rate ( %g %% )", (error_rate * 100.0));
311 if (error_rate > 0.00025)
312 printf(" too high. Check cabling.\n");
319 ##################################################
320 # check network - works for SUNOS 4.x
321 ##################################################
323 echo " time inpkts inerrs outpkts outerrs colls"
324 netstat -i -I $interface $interval | (
325 (line ; line ; line) > /dev/null
326 t_inpkts=0 # initialize counter
327 t_inerrs=0 # initialize counter
328 t_outpkts=0 # initialize counter
329 t_outerrs=0 # initialize counter
330 t_colls=0 # initialize counter
332 while test $i -lt $count ; do # for each of the lines
335 set -- `line` # get the line
336 echo " $1 $2 $3 $4 $5"
337 t_inpkts=`expr $1 + $t_inpkts` # accumulate in packets
339 t_inerrs=`expr $1 + $t_inerrs` # accumulate in errors
341 t_outpkts=`expr $1 + $t_outpkts` # accumulate out packets
343 t_outerrs=`expr $1 + $t_outerrs` # accumulate out errors
345 t_colls=`expr $1 + $t_colls` # accumulate collisions
349 echo -n "$t_inpkts $t_inerrs $t_outpkts "
350 echo " $t_outerrs $t_colls"
351 # now check error and collision rate.
352 # Use awk to get floating point accuracy
353 echo $t_colls $t_outpkts $t_inerrs $t_inpkts | awk '$2 != 0 {
354 collision_rate = $1 / $2;
355 printf("\n\ncollision rate ( %g %% )", (collision_rate * 100.0));
356 if ( collision_rate > 0.05 )
357 printf(" too high. Add subnets.\n");
361 error_rate = $3 / $4;
362 printf(" error rate ( %g %% )", (error_rate * 100.0));
363 if (error_rate > 0.00025)
364 printf(" too high. Check cabling.\n");
371 ########################################################
372 # establish file partition -> disk device mapping for solaris
373 # how do I do this for other platforms?
374 ########################################################
378 df -F ufs | cut -f1 -d: | awk '{print $2}' | sed 's/(//' |\
379 sed 's/)//' > /tmp/lll
380 for i in `cat /tmp/lll`
385 cat /etc/path_to_inst
388 ########################################################
389 # calculate the size (in bytes) of all VOB database on this host
390 ########################################################
393 if [ ! -f $ATRIAHOME/bin/cleartool ] ; then
394 echo this is not a ClearCase host
397 # list all vobs on this host and extract the
398 # VOB storage directory.
399 $ATRIAHOME/bin/cleartool lsvob -host $HOST
400 $ATRIAHOME/bin/cleartool lsvob -host $HOST | \
401 awk '$1 == "*" {print $3 } \
402 $1 != "*" {print $2 }' >/tmp/list.$$
404 vobs=`wc -l /tmp/list.$$ | awk '{print $1}'`
405 echo "Number of vobs : $vobs"
406 if [ $vobs = 0 ] ; then
409 # now count all the bytes in the database data and key files
410 for i in `cat /tmp/list.$$`
413 $LSL vob_db.d0? vob_db.k0? | \
416 END {printf "%12d\t", sum}'
418 done | tee -a /tmp/list1.$$
422 END {printf "%12d\tTOTAL", sum}' < /tmp/list1.$$
424 rm /tmp/list.$$ /tmp/list1.$$
427 ########################################################
428 # check the view characteristics
429 ########################################################
432 if [ ! -f $ATRIAHOME/bin/cleartool ] ; then
433 echo this is not a ClearCase host
436 $ATRIAHOME/bin/cleartool lsview -host $HOST | \
437 awk '$1 == "*" {print $3,$2 } \
438 $1 != "*" {print $2,$1 }' >/tmp/list.$$
440 views=`wc -l /tmp/list.$$ | awk '{print $1}'`
441 echo "Number of views : $views"
442 if [ $views = 0 ] ; then
447 while [ $i -le $views ]
450 size=`grep -s cache $1/.view | awk '{print $2}'`
451 if [ a$size = a ]; then
454 echo "$size $2" | awk '{printf "%8s\t%-16s\n", $1, $2}'
461 ########################################################
462 # check the MVFS cache on this system
463 ########################################################
466 /usr/atria/etc/mvfsstat -iclrh 2>&1
469 ########################################################
470 # check clearcase things
471 ########################################################
474 ATRIAHOME=${ATRIAHOME:-/usr/atria}
475 show "VOB sizes" check_vobs
476 show "Views" check_views
477 show "MVFS" check_mvfs
478 show "Cleartool Version" $ATRIAHOME/bin/cleartool -ver
481 ########################################################
482 # obtain mvs parameters
483 ########################################################
487 adb -k /var/adm/atria/vmunix_mvfs /dev/mem <<!
502 adb -k /dev/ksyms /dev/mem <<!
517 adb -k /hp-ux /dev/mem <<!
536 adb -k /stand/vmunix /dev/mem <<!
556 dbx -k /vmunix /dev/mem 2>/dev/null <<!
557 printf "physmem %d", physmem
558 printf "mvfs_mnmax %d", mvfs_mnmax
559 printf "mvfs_vobfreemax %d", mvfs_vobfreemax
560 printf "mvfs_cvpfreemax %d", mvfs_cvpfreemax
561 printf "mvfs_dncdirmax %d", mvfs_dncdirmax
562 printf "mvfs_dncregmax %d", mvfs_dncregmax
563 printf "mvfs_dncnoentmax %d", mvfs_dncnoentmax
564 printf "mvfs_largeinit %d", mvfs_largeinit
570 ############################
571 # ENTRY POINT FOR SCRIPT
572 ############################
574 if [ $# -ne 0 ] ; then
579 if [ ! -w /etc/passwd ] ; then
580 echo "Please run $0 as root."
593 echo system is `uname -a`
594 echo "SCS script version 96/06/21 1.26 run at `date`"
600 lans=`/bin/netstat -i | grep -v none | \
601 awk '{print $1}' | grep -v lo0 | grep -v Name `
602 for interface in $lans
604 show "Network snapshop - $interface" check_network
611 SunOS ) case $OSVER in
612 # SUN SunOS 4.x (Solaris 1.x) operating system
615 lans=`/usr/ucb/netstat -i | grep -v none | \
616 awk '{print $1}' | grep -v lo0 | grep -v Name `
617 for interface in $lans
619 show "Network snapshop - $interface" check_network1
622 show "MVFS parameters" get_mvfs_sun4
623 show "License Host" cat /var/adm/atria/config/license_host
624 show "Registry Host and Region" cat /var/adm/atria/rgy/rgy*.conf
626 # SUN SunOS 5.x (Solaris 2.x) operating system
628 lans=`/bin/netstat -i | grep -v none | \
629 awk '{print $1}' | grep -v lo0 | grep -v Name `
630 for interface in $lans
632 show "Network snapshop - $interface" check_network
634 show "Disk Utilization " do_discs
636 show "MVFS parameters" get_mvfs_sun5
637 show "License Host" cat /var/adm/atria/config/license_host
638 show "Registry Host and Region" cat /var/adm/atria/rgy/rgy*.conf
643 HP-UX) case $OSVER in
644 # HP HP-UX operating system
645 A.09.*) model=`uname -m | cut -d'/' -f 2`
646 if [ `expr $model` -gt 800 ] ; then
648 elif [ `expr $model` -gt 700 ] ; then
653 lans=`/usr/bin/netstat -i | grep -v none | \
654 awk '{print $1}' | grep -v lo0 | grep -v Name `
655 for interface in $lans
657 show "Network snapshop - $interface" check_network
660 show "MVFS parameters" get_mvfs_hp9
661 show "License Host" cat /usr/adm/atria/config/license_host
662 show "Registry Host and Region" cat /usr/adm/atria/rgy/rgy*.conf
665 lans=`/bin/netstat -i | grep -v none | \
666 awk '{print $1}' | grep -v lo0 | grep -v Name `
667 for interface in $lans
669 show "Network snapshop - $interface" check_network
672 show "MVFS parameters" get_mvfs_hp10
673 show "License Host" cat /var/adm/atria/config/license_host
674 show "Registry Host and Region" cat /var/adm/atria/rgy/rgy*.conf
680 # IRIX 5.x operating system
681 # IRIX 5.x operating system
683 lans=`/usr/etc/netstat -i | grep -v none | \
684 awk '{print $1}' | grep -v lo0 | grep -v Name `
685 for interface in $lans
687 show "Network snapshot - $interface" check_network
692 * ) echo "$prog": unknown operating system: $OS $CPUOS
699 lans=`/usr/sbin/netstat -i | grep -v none | \
700 awk '{print $1}' | grep -v lo0 | grep -v Name `
701 for interface in $lans
703 show "Network snapshot - $interface" check_network
706 show "MVFS parameters" get_mvfs_osf1
707 show "License Host" cat /var/adm/atria/config/license_host
708 show "Registry Host and Region" cat /var/adm/atria/rgy/rgy*.conf
713 lans=`/bin/netstat -i | grep -v none | \
714 awk '{print $1}' | grep -v lo0 | grep -v Name `
715 for interface in $lans
717 show "Network snapshop - $interface" check_uw_network
723 * ) echo "$prog": unknown operating system: $OS $CPUOS