Initial add of defaria.com
[clearscm.git] / defaria.com / Computers / code / adm / bin / SCS
1 #!/bin/sh
2 #############################################
3 # @(#)scs       1.45
4 # system characterization script
5 # "scs" collects data from Atria
6 # customer sites for analysis by
7 # engineering.
8 ######################################
9
10 #########################
11 # For Solaris 5.x systems
12 #########################
13 nddit()
14 {
15 for i in tcp udp ip hme
16 do
17   /usr/sbin/ndd /dev/$i \? | /bin/awk '{print $1}' | \
18              /bin/egrep -v '\?|directed|respond|status|hash' > /tmp/$$
19   for j in `/bin/cat /tmp/$$`
20   do
21     /bin/printf "%-30s  %s\n" $j  `/usr/sbin/ndd /dev/$i $j `
22   done
23   /bin/rm /tmp/$$
24   echo "--------"
25 done
26 }
27
28 solaris()
29 {
30 show "Uptime" /bin/uptime
31 show "System Device Configuration" /usr/sbin/prtconf -vP
32 show "System Configuration" /usr/sbin/sysdef -i
33 show "System Customization" '/bin/cat /etc/system | \
34             /bin/grep -v "^\*" | /bin/grep -v "^$"'
35 show "Network Configuration" nddit
36 show "System Messages" /bin/dmesg
37 show "Patches" /bin/showrev -p
38 # /usr/kvm/prtconf check and use
39 #show "fpversion" /opt/SUNWspro/bin/fpversion
40
41 show "Processes" '/usr/ucb/ps auxww | /bin/fold -80'
42 show "Network Configuration" /usr/sbin/ifconfig -a
43 show "Network Utilization Summary" /bin/netstat -i
44 show "Network Protocol Statistics" /bin/netstat -s
45 show "Network Mbuf Statistics" /bin/netstat -m
46 show "VM Statistics" /bin/vmstat -s
47 show "Cache Flush Statistics" /bin/vmstat -c
48 show "Interrupts" /bin/vmstat -i
49 show "NFS Statistics" /bin/nfsstat
50 show "NFS Responses" /bin/nfsstat -m
51
52 show "CPU Utilization" /bin/sar -u 1 10
53 show "Buffer Activity" /bin/sar -b 1 10
54 show "Block Device Activity" /bin/sar -d 1 10
55 show "Disk  Device Activity" iostat -x 1 10
56 show "Paging In Activity" /bin/sar -p 1 5
57 show "Paging Out Activity" /bin/sar -g 1 5
58 show "Free Memory" /bin/sar -r 1 5
59 show "vmstat snapshot" /bin/vmstat 2 10
60 show "Kernel Memory Allocation Activity" /bin/sar -k 1 5
61 show "KMA statistics" 'echo kmastat | /usr/sbin/crash'
62 echo ""
63 show "Swap space" /usr/sbin/swap -s
64 echo ""
65 }
66
67 #######################
68 # For SUNOS 4.x systems
69 #######################
70 sunos()
71 {
72
73 show "Memory " '/etc/dmesg | grep mem'
74 show "System Messages" /etc/dmesg
75 show "Processes" '/bin/ps auxww | /usr/ucb/fold -80'
76 show "Network Utilization Summary" /usr/ucb/netstat -i
77 show "Network Protocol Statistics" /usr/ucb/netstat -s
78 show "Network Mbuf Statistics" /usr/ucb/netstat -m
79 show "VM Statistics" /usr/ucb/vmstat -s
80 show "Cache Flush Statistics" /usr/ucb/vmstat -c
81 show "Interrupts" /usr/ucb/vmstat -i
82 show "NFS Statistics" /usr/etc/nfsstat
83
84 show "Disk Device Activity" /bin/iostat -D 1 10
85 show "CPU  Activity" /usr/ucb/vmstat  1 10
86 show "Tables" /etc/pstat  -T
87 show "vmstat snapshot" /usr/ucb/vmstat 2 10
88
89 }
90
91
92 #######################
93 # For AIX
94 #######################
95 aix()
96 {
97
98 show "Processes" '/usr/bin/ps -elf '
99 show "Network Utilization Summary" /bin/netstat -i
100 show "Network Protocol Statistics" /bin/netstat -s
101 show "Network Mbuf Statistics" /bin/netstat -m
102 show "Network Configurables" /usr/sbin/no -a
103 show "NFS Statistics" /usr/sbin/nfsstat
104
105 show "System Attributes" /usr/sbin/lsattr -E -l sys0 
106 show "CPU Utilization" sar -u 1 10
107 show "Buffer Activity" sar -b 1 10
108 show "Disk Activity" /bin/iostat 1 10
109 show "Paging Stats" sar -r 1 5
110 show "Network Monitor for 30s" '/bin/netpmon -v -o /tmp/$$; sleep 30; trcstop'
111 echo ""
112 }
113
114 #######################
115 # For OSF1
116 #######################
117 osf1()
118 {
119 show "Boot Messages"  'echo "";echo ""; echo "";uerf -r 300 | tail -100'
120 show "Processes" '/usr/bin/ps glww | fold -80'
121 show "Network Utilization Summary" /usr/sbin/netstat -i
122 show "Network Protocol Statistics" /usr/sbin/netstat -s
123 show "Network Mbuf Statistics" /usr/sbin/netstat -m
124 show "NFS Statistics" /usr/bin/nfsstat 
125 show "Kernel memory usage" /usr/bin/vmstat -M
126 show "vmstat snapshopt" /usr/bin/vmstat  2 10
127 show "Disk Device snapshot" /bin/iostat  2 10 
128
129 }
130
131 #######################
132 # For IRIX  6.x
133 #######################
134 irix6()
135 {
136 show "Uptime" /usr/bsd/uptime
137 show "System Device Configuration" /usr/sbin/sysconf 
138 show "System Hardware Configuration" /usr/bin/hinv
139 show "System Software Configuration" /etc/chkconfig
140 show "Patches" '/usr/sbin/versions | grep Patch' 
141 show "Disk Usage" /usr/sbin/df -l -k
142 show "System Customization" '/bin/cat /var/sysgen/stune | \
143             /bin/grep -v "^\*" | /bin/grep -v "^$"'
144
145 show "Processes" '/usr/bin/ps -elf | /bin/fold -80'
146 show "Network Utilization Summary" /usr/etc/netstat -i
147 show "Network Protocol Statistics" /usr/etc/netstat -s
148 show "Network Mbuf Statistics" /usr/etc/netstat -m
149 show "NFS Statistics" /usr/etc/nfsstat
150
151 show "CPU Utilization" sar -u 1 10
152 show "Buffer Activity" sar -b 1 10
153 show "Block Device Activity" sar -d 1 10
154 show "Paging In Activity" sar -p 1 5
155 show "Paging Out Activity" sar -g 1 5
156 show "Free Memory" sar -r 1 5
157 echo ""
158 }
159
160
161 #######################
162 # For IRIX  5.x
163 #######################
164 irix()
165 {
166 show "Uptime" /usr/bsd/uptime
167 show "System Device Configuration" /usr/sbin/sysconf 
168 show "System Hardware Configuration" /usr/bin/hinv
169 show "System Software Configuration" /etc/chkconfig
170 show "Disk Usage" /usr/sbin/df -l -k
171 show "System Customization" '/bin/cat /var/sysgen/stune | \
172             /bin/grep -v "^\*" | /bin/grep -v "^$"'
173
174 show "Processes" '/usr/bin/ps -elf | /bin/fold -80'
175 show "Network Utilization Summary" /usr/etc/netstat -i
176 show "Network Protocol Statistics" /usr/etc/netstat -s
177 show "Network Mbuf Statistics" /usr/etc/netstat -m
178 show "NFS Statistics" /usr/etc/nfsstat
179
180 show "CPU Utilization" sar -u 1 10
181 show "Buffer Activity" sar -b 1 10
182 show "Block Device Activity" sar -d 1 10
183 show "Paging In Activity" sar -p 1 5
184 show "Paging Out Activity" sar -g 1 5
185 show "Free Memory" sar -r 1 5
186 echo ""
187 }
188
189
190 #####################
191 # For HP-UX 9/800 systems
192 #####################
193 hpux98()
194 {
195 show "Memory " grep "mem =" /usr/adm/*syslog
196 #first the shared info 
197 hpux
198 # now the system specific 
199 show "System definition" /etc/sysdef
200 show "CPU Utilization" /usr/bin/sar -u 1 10
201 show "Buffer Activity" /usr/bin/sar -b 1 10
202 show "Block Device Activity" /usr/bin/sar -d 1 10
203 }
204 #####################
205 # For HP-UX 9/700 systems
206 #####################
207 hpux97()
208 {
209 show "Memory " grep Physical /usr/adm/messages
210 # just the shared info 
211 hpux
212 }
213 #####################
214 # For All HP-UX 9  systems
215 #####################
216 hpux()
217 {
218 show "Uptime" /usr/bin/uptime
219 show "System Messages" /etc/dmesg
220 show "Swap Space" /etc/swapinfo
221 show "Patches" ls -ld /system/PH*
222 show "IO devices" /etc/ioscan -f
223
224 show "Processes" '/bin/ps -elf | /usr/bin/fold -80'
225 show "Network Utilization Summary" /usr/bin/netstat -i
226 show "Network Protocol Statistics" /usr/bin/netstat -s
227 show "Network Mbuf Statistics" /usr/bin/netstat -m
228 show "VM Statistics" /usr/bin/vmstat -s
229 show "NFS Statistics" /usr/etc/nfsstat
230 show "Network errors" /etc/netfmt -t 30 -f /usr/adm/nettl.LOG00
231
232 show "Disk Utilization" /usr/bin/bdf -l
233 show "vmstat snapshot" /usr/bin/vmstat 2 10
234 }
235
236 #####################
237 # For HP-UX 10 systems
238 #####################
239 hpux10()
240 {
241
242 show "Memory " grep Physical /var/adm/syslog/syslog.log
243 show "System DMessages" /usr/sbin/dmesg
244 show "System definition" /usr/sbin/sysdef
245 show "Messages" "tail -100 /usr/adm/syslog/syslog.log"
246 show "IO status" /etc/ioscan -f
247 show "Patches" '/usr/sbin/swlist -l product | grep PH'
248
249 show "Processes" '/usr/bin/ps -elf | /usr/bin/fold -80'
250 show "Network Utilization Summary" /usr/bin/netstat -i
251 show "Network Protocol Statistics" /usr/bin/netstat -s
252 show "Network Mbuf Statistics" /usr/bin/netstat -m
253 show "VM Statistics" /usr/bin/vmstat -s
254 show "NFS Statistics" /usr/bin/nfsstat
255
256 show "CPU Utilization" /usr/bin/sar -u 1 10
257 show "Buffer Activity" /usr/bin/sar -b 1 10
258 show "Block Device Activity" /usr/bin/sar -d 1 10
259 show "vmstat snapshot" /usr/bin/vmstat 2 10
260 }
261 #####################
262 # For Unixware systems
263 #####################
264 unixware()
265 {
266 show "Memory size" /sbin/memsize
267 show "Message log" cat /usr/adm/log/osmlog
268 show "System Configuration" /usr/sbin/sysdef 
269 show "Processes" '/usr/bin/ps -elf '
270 show "Network Utilization Summary" /bin/netstat -i
271 show "Network Protocol Statistics" /bin/netstat -s
272 show "NFS Statistics" /usr/sbin/nfsstat
273
274 show "CPU Utilization" /sbin/sar -u 1 10
275 show "Buffer Activity" /sbin/sar -b 1 10
276 show "Block Device Activity" /sbin/sar -d 1 10
277 show "Paging In Activity" /sbin/sar -p 1 5
278 show "Paging Out Activity" /sbin/sar -g 1 5
279 show "Free Memory" /sbin/sar -r 1 5
280 show "Historical sar data" /sbin/sar -A
281 echo ""
282 }
283
284
285 ####################################
286 # display informationin a uniform way
287 ####################################
288 show() {
289         echo "----------------------------------------------------"
290         echo $1
291         echo "----------------------------------------------------"
292         shift
293         eval "$@"
294         echo ""
295 }
296 ##################################################
297 # check uw network - works for  Unixware
298 ##################################################
299 check_uw_network() {
300
301 netstat -i $interface
302 sleep 10
303 netstat -i $interface
304 }
305
306 ##################################################
307 # check network - works for HP-UX and SUNOS 5.x
308 ##################################################
309 check_network() {
310    printf "%8s %8s %8s %8s %8s %8s \n" time inpkts inerrs \
311       outpkts outerrs colls 
312     netstat -i -I $interface $interval | (
313     (line ; line ; line) > /dev/null
314     t_inpkts=0                          # initialize counter
315     t_inerrs=0                          # initialize counter
316     t_outpkts=0                         # initialize counter
317     t_outerrs=0                         # initialize counter
318     t_colls=0                           # initialize counter
319     i=0
320     while test $i -lt $count  ; do      # for each of the lines
321       time=`date +%T`
322       /bin/echo $time  \\c
323       set -- `line`                     # get the line
324       printf "%8s %8s %8s %8s %8s\n" $1 $2 $3 $4 $5
325       t_inpkts=`expr $1 + $t_inpkts`    # accumulate in packets
326       shift
327       t_inerrs=`expr $1 + $t_inerrs`    # accumulate in errors
328       shift
329       t_outpkts=`expr $1 + $t_outpkts`  # accumulate out packets
330       shift
331       t_outerrs=`expr $1 + $t_outerrs`  # accumulate out errors
332       shift
333       t_colls=`expr $1 + $t_colls`      # accumulate collisions
334       i=`expr $i + 1 `
335     done
336     printf "\n%8s %8s %8s %8s %8s %8s \n" \
337       total $t_inpkts $t_inerrs $t_outpkts $t_outerrs $t_colls
338 # now check error and collision rate. 
339 # Use awk to get floating point accuracy
340     echo  $t_colls $t_outpkts $t_inerrs $t_inpkts | awk '$2 != 0 { 
341     collision_rate = $1 / $2;
342     printf("\n\ncollision rate ( %g %% )", (collision_rate * 100.0));
343     if ( collision_rate > 0.05 ) 
344       printf("  too high. Add subnets.\n");
345     else
346       printf("\n")}
347     $4 != 0 {
348     error_rate = $3 / $4;
349     printf("    error rate ( %g %% )", (error_rate * 100.0));
350     if (error_rate > 0.00025)
351       printf("  too high.  Check cabling.\n");
352     else
353       printf("\n")}'
354
355   )
356 }
357
358 ##################################################
359 # check fddi - for sun
360 ##################################################
361 check_fddi_sol() {
362 /opt/*conn/*nf/utilities/nf_stat $interface 3 5
363 /opt/*conn/*nf/utilities/nf_stat -m 3 5
364 /opt/*fddi/fddistat -l
365 }
366
367 ##################################################
368 # check fddi - for HPs
369 ##################################################
370 check_fddi_hp() {
371 /usr/bin/fddistat /dev/$interface
372 }
373
374 ##################################################
375 # check network - works for SUNOS 4.x
376 ##################################################
377 check_network1() {
378    echo " time     inpkts   inerrs   outpkts   outerrs  colls"
379   netstat -i -I $interface $interval | (
380     (line ; line ; line) > /dev/null
381     t_inpkts=0                          # initialize counter
382     t_inerrs=0                          # initialize counter
383     t_outpkts=0                         # initialize counter
384     t_outerrs=0                         # initialize counter
385     t_colls=0                           # initialize counter
386     i=0
387     while test $i -lt $count  ; do      # for each of the lines
388       time=`date +%T`
389       /bin/echo -n $time  
390       set -- `line`                     # get the line
391       echo "     $1       $2         $3        $4        $5"
392       t_inpkts=`expr $1 + $t_inpkts`    # accumulate in packets
393       shift
394       t_inerrs=`expr $1 + $t_inerrs`    # accumulate in errors
395       shift
396       t_outpkts=`expr $1 + $t_outpkts`  # accumulate out packets
397       shift
398       t_outerrs=`expr $1 + $t_outerrs`  # accumulate out errors
399       shift
400       t_colls=`expr $1 + $t_colls`      # accumulate collisions
401       i=`expr $i + 1 `
402     done
403     echo -n "total       " 
404     echo -n "$t_inpkts       $t_inerrs        $t_outpkts       "
405     echo " $t_outerrs       $t_colls"
406 # now check error and collision rate. 
407 # Use awk to get floating point accuracy
408     echo  $t_colls $t_outpkts $t_inerrs $t_inpkts | awk '$2 != 0 { 
409     collision_rate = $1 / $2;
410     printf("\n\ncollision rate ( %g %% )", (collision_rate * 100.0));
411     if ( collision_rate > 0.05 ) 
412       printf("  -  too many collisions. \n");
413     else
414       printf("\n")}
415     $4 != 0 {
416     error_rate = $3 / $4;
417     printf("    error rate ( %g %% )", (error_rate * 100.0));
418     if (error_rate > 0.00025)
419       printf("  -  too many errors. \n");
420     else
421       printf("\n")}'
422
423   )
424 }
425
426 ########################################################
427 #  get disk layout and performance data
428 ########################################################
429 do_ssaadm()
430 {
431 #need to add logic here to select a configured controller
432 #and only do an ssaadm if relevant. We'll live with the errors
433 # for now....
434 for i in `(cd /dev/rdsk; ls | cut -d't' -f 1 | uniq)`
435 do
436      ssaadm display $i 2>/dev/null
437      ssaadm display -p $i 2>/dev/null
438 done
439 }
440
441 ########################################################
442 # attempt to get Sparc Storage Array configuration
443 ########################################################
444 do_arrays()
445 {
446 SSAS=`/usr/sbin/prtconf -vP | grep soc | grep instance | wc -l`
447 show "SSAs" echo "$SSAS SparcStorage Arrays attached"
448
449 if [  $SSAS = 0 ] ; then
450   return
451 fi
452
453 #else lets print out information
454
455 show "SSA Disks and Performance" do_ssaadm
456 show "State and Configuration of Array Disks" /usr/sbin/vxprint -ht
457 show "Disk utilization" /usr/sbin/vxstat -i 2 -c 5 
458 show "Disk utilization" /usr/sbin/vxstat -i 2 -c 5 -s
459
460 }
461
462 ########################################################
463 # establish file partition -> disk device mapping for solaris
464 # how do I do this for other platforms?
465 ########################################################
466 do_discs()
467 {
468 df -F ufs -k
469 show "Disk Device Mapping"  echo ' '
470 df -F ufs | cut -f1 -d: | awk '{print $2}' | sed 's/(//' |\
471             sed 's/)//' > /tmp/lll
472 for i in `cat /tmp/lll` 
473 do
474   ls -l $i
475 done
476 rm /tmp/lll
477
478 show "path_to_inst file" cat /etc/path_to_inst
479 }
480
481 ########################################################
482 # calculate the size (in bytes) of all VOB database on this host
483 ########################################################
484 check_vobs()
485 {
486 if [  ! -f $ATRIAHOME/bin/cleartool ] ; then
487   echo this is not a ClearCase host
488   exit
489 fi
490 # list  all vobs on this host and extract the
491 # VOB storage directory. 
492 $ATRIAHOME/bin/cleartool lsvob -host $HOST 
493 $ATRIAHOME/bin/cleartool lsvob -host $HOST | \
494 awk '$1 == "*" {print $3  } \
495      $1 != "*" {print $2  }' >/tmp/list.$$
496 # count the vobs
497 vobs=`wc -l /tmp/list.$$ | awk '{print $1}'`
498 echo "Number of vobs    : $vobs"
499 if [ $vobs = 0 ] ; then
500   return
501 fi
502 # now count all the bytes in the database data and key files
503 for i in `cat /tmp/list.$$`
504 do
505   if [  ! -d $i/db ] ; then
506      echo no db subdirectory for $i
507      continue
508   fi
509   cd $i/db
510   $LSL vob_db.d0? vob_db.k0? | \
511   awk 'BEGIN {sum=0} \
512   {sum = sum + $5/(1024.0*1024.0)} \
513   END {printf " %8.3f Mb\t", sum}'  
514   echo `basename $i` 
515 done | tee -a  /tmp/list1.$$
516
517 awk 'BEGIN {sum=0} \
518 {sum = sum + $1} \
519 END {printf "%9.3f Mb\tTOTAL", sum}'  < /tmp/list1.$$
520
521 rm /tmp/list.$$ /tmp/list1.$$
522 }
523
524 ########################################################
525 # check the view characteristics
526 ########################################################
527 check_views()
528 {
529 if [  ! -f $ATRIAHOME/bin/cleartool ] ; then
530   echo this is not a ClearCase host
531   exit
532 fi
533 $ATRIAHOME/bin/cleartool lsview -host $HOST | \
534 awk '$1 == "*" {print $3,$2  } \
535      $1 != "*" {print $2,$1  }' >/tmp/list.$$
536 # count the views
537 views=`wc -l /tmp/list.$$ | awk '{print $1}'`
538 echo "Number of views    : $views"
539 if [ $views = 0 ] ; then
540   return
541 fi
542 cat /tmp/list.$$ | (
543 i=1
544 while [ $i -le  $views ]
545 do
546    set -- `line`;
547    size=`grep -s cache $1/.view | awk '{print $2}'`
548    if [ a$size = a ]; then
549       size=default
550    fi
551    echo "$size $2" | awk '{printf "%8s\t%-16s\n", $1, $2}'
552    i=`expr $i + 1`
553 done
554 )
555 rm /tmp/list.$$
556 }
557
558 ########################################################
559 # check the MVFS cache on this system
560 ########################################################
561 check_mvfs()
562 {
563 /usr/atria/etc/mvfsstat -iclrh 2>&1
564 }
565
566 ########################################################
567 # obtain lockmgr parameters
568 ########################################################
569 get_lockmgr()
570 {
571 if [ -f $ATRIAHOME/etc/init.d/atria ] ; then
572          grep lockmgr $ATRIAHOME/etc/init.d/atria | egrep '\-u' | \
573          sed 's/.*}//' | sed 's/>>.*//'
574 elif  [ -f $ATRIAHOME/etc/rc.atria ] ; then
575          grep lockmgr $ATRIAHOME/etc/rc.atria | egrep '\-u' | \
576          sed 's/.*}//' | sed 's/>>.*//'
577 #for V3
578 elif  [ -f $ATRIAHOME/etc/atria_start ] ; then
579          grep lockmgr $ATRIAHOME/etc/atria_start | egrep '\-u' | \
580          sed 's/.*}//' | sed 's/>>.*//'
581 fi
582 }
583
584 ########################################################
585 # obtain lockmgr parameters
586 ########################################################
587 get_vob_counts()
588 {
589 VSL=$VAR/adm/atria/log/vob_scrubber_log
590 if [  ! -f $VSL ] ; then
591   echo no data available
592 else
593   egrep 'Started|element|branch|version|derived|hyperlink' $VSL
594 fi
595
596 }
597
598 ########################################################
599 # check clearcase things
600 ########################################################
601 check_cc()
602 {
603 ATRIAHOME=${ATRIAHOME:-/usr/atria}
604   show "VOB sizes" check_vobs
605   show "Views" check_views
606   show "MVFS" check_mvfs
607   show "Cleartool Version" $ATRIAHOME/bin/cleartool -ver
608   show "Lock Manager Configuration" get_lockmgr
609   show "VOB Characteristics" get_vob_counts
610   show "License Host" cat $VAR/adm/atria/config/license_host
611   show "Registry Host and Region" cat $VAR/adm/atria/rgy/rgy*.conf
612 }
613
614 ########################################################
615 # obtain mvs parameters
616 ########################################################
617
618 get_mvfs_sun4()
619 {
620 adb -k /var/adm/atria/vmunix_mvfs /dev/mem <<!
621 =n"MVFS parameters"
622 physmem/D
623 mvfs_mnmax/D
624 mvfs_vobfreemax/D
625 mvfs_cvpfreemax/D
626 mvfs_dncdirmax/D
627 mvfs_dncregmax/D
628 mvfs_dncnoentmax/D
629 mvfs_largeinit/D
630 !
631 }
632
633 get_mvfs_sun5()
634 {
635 adb -k /dev/ksyms /dev/mem <<!
636 =n"MVFS parameters"
637 physmem/D
638 mvfs_mnmax/D
639 mvfs_vobfreemax/D
640 mvfs_cvpfreemax/D
641 mvfs_dncdirmax/D
642 mvfs_dncregmax/D
643 mvfs_dncnoentmax/D
644 mvfs_largeinit/D
645 !
646 }
647
648 get_mvfs_hp9()
649 {
650 adb -k /hp-ux /dev/mem <<!
651 =n"MVFS parameters"
652 physmem/D
653 mvfs_mnmax/D
654 mvfs_vobfreemax/D
655 mvfs_cvpfreemax/D
656 mvfs_dncdirmax/D
657 mvfs_dncregmax/D
658 mvfs_dncnoentmax/D
659 mvfs_largeinit/D
660 bufpages/D
661 nbuf/D
662 ninode/D
663 fs_async/D
664 !
665 }
666
667 get_mvfs_hp10()
668 {
669 adb -k /stand/vmunix /dev/mem <<!
670 =n"MVFS parameters"
671 physmem/D
672 mvfs_mnmax/D
673 mvfs_vobfreemax/D
674 mvfs_cvpfreemax/D
675 mvfs_dncdirmax/D
676 mvfs_dncregmax/D
677 mvfs_dncnoentmax/D
678 mvfs_largeinit/D
679 bufpages/D
680 nbuf/D
681 ninode/D
682 fs_async/D
683 !
684 }
685
686 get_mvfs_osf1()
687 {
688 dbx -k /vmunix /dev/mem  2>/dev/null <<!
689 printf "physmem %d", physmem
690 printf "mvfs_mnmax %d", mvfs_mnmax
691 printf "mvfs_vobfreemax %d", mvfs_vobfreemax
692 printf "mvfs_cvpfreemax %d", mvfs_cvpfreemax
693 printf "mvfs_dncdirmax %d", mvfs_dncdirmax
694 printf "mvfs_dncregmax %d", mvfs_dncregmax
695 printf "mvfs_dncnoentmax %d", mvfs_dncnoentmax
696 printf "mvfs_largeinit %d", mvfs_largeinit
697 quit
698 !
699 }
700
701 get_mvfs_sgi6()
702 {
703 dbx -k /unix /dev/kmem  2>/dev/null <<!
704 printf "physmem %d\n", physmem
705 printf "mvfs_mnmax %d\n", mvfs_mnmax
706 printf "mvfs_vobfreemax %d\n", mvfs_vobfreemax
707 printf "mvfs_cvpfreemax %d\n", mvfs_cvpfreemax
708 printf "mvfs_dncdirmax %d\n", mvfs_dncdirmax
709 printf "mvfs_dncregmax %d\n", mvfs_dncregmax
710 printf "mvfs_dncnoentmax %d\n", mvfs_dncnoentmax
711 printf "mvfs_largeinit %d\n", mvfs_largeinit
712 quit
713 !
714 }
715
716
717 ############################
718 # ENTRY POINT FOR SCRIPT
719 ############################
720
721 if [ $# -ne 0 ] ; then
722    echo "usage: scs"
723    exit
724 fi
725
726 if [ ! -w /etc/passwd ] ; then
727         echo "Please run $0 as root."
728         exit 1
729 fi
730
731 interval=1
732 count=20
733
734 SYS=`uname -m`
735 OS=`uname -s`
736 OSVER=`uname -r`
737 HOST=`uname -n`
738 LSL="/bin/ls -l"
739 VAR="/var"
740
741 echo system is `uname -a`
742 echo "SCS script version 98/06/22 1.45 run at `date`"
743
744 case $OS in
745
746 #AIX
747 AIX   )  aix
748          lans=`/bin/netstat -i | grep -v none | \
749             awk '{print $1}' | grep -v lo0 | grep -v Name `
750          for interface in $lans 
751          do
752             show "Network snapshop - $interface" check_network
753          done 
754          check_cc
755          ;;
756
757
758 #Sun 
759 SunOS )  case $OSVER in
760          # SUN SunOS 4.x (Solaris 1.x) operating system
761         4.1*  ) sunos
762                 LSL="ls -lg"
763                 lans=`/usr/ucb/netstat -i | grep -v none | \
764                   awk '{print $1}' | grep -v lo0 | grep -v Name `
765                 for interface in $lans 
766                 do
767                    show "Network snapshop - $interface" check_network1
768                 done 
769                 check_cc
770                 show "MVFS parameters" get_mvfs_sun4
771                 ;;
772         # SUN SunOS 5.x (Solaris 2.x) operating system
773         5.*   ) solaris
774                 lans=`/bin/netstat -i | grep -v none | \
775                   awk '{print $1}' | grep -v lo0 | grep -v Name `
776                 for interface in $lans 
777                 do
778                    show "Network snapshop - $interface" check_network
779                    show "FDDI  status - $interface" check_fddi_sol
780                 done 
781                 show "Disk Utilization " do_discs
782                 do_arrays
783                 check_cc
784                 show "MVFS parameters" get_mvfs_sun5
785                 ;;
786         esac
787         ;;
788 #HP
789 HP-UX)  case $OSVER in 
790         # HP HP-UX operating system
791         A.09.*) model=`uname -m | cut -d'/' -f 2`
792                 VAR="/usr"
793                 if [ `expr $model` -gt 800 ] ; then
794                     hpux98
795                 elif [ `expr $model` -gt 700 ] ; then
796                     hpux97
797                 else
798                     hpux
799                 fi
800                 lans=`/usr/bin/netstat -i | grep -v none | \
801                   awk '{print $1}' | grep -v lo0 | grep -v Name `
802                 for interface in $lans 
803                 do
804                    show "Network snapshop - $interface" check_network
805                 done 
806                 check_cc
807                 show "MVFS parameters" get_mvfs_hp9
808                 ;;
809         *.10.*) hpux10
810                 lans=`/bin/netstat -i | grep -v none | \
811                   awk '{print $1}' | grep -v lo0 | grep -v Name `
812                 for interface in $lans 
813                 do
814                    show "Network snapshop - $interface" check_network
815                    show "FDDI status - $interface" check_fddi_hp
816                 done 
817                 check_cc
818                 show "MVFS parameters" get_mvfs_hp10
819                 ;;
820         esac
821         ;;
822 #SGI
823 IRIX*)  case $OSVER in
824         # IRIX 5.x operating system
825         5.*   ) irix
826                 lans=`/usr/etc/netstat -i | grep -v none | \
827                   awk '{print $1}' | grep -v lo0 | grep -v Name `
828                 for interface in $lans 
829                 do
830                    show "Network snapshot - $interface" check_network
831                 done 
832                 check_cc
833                 ;;
834         # IRIX 6.x operating system
835         6.*)    irix6
836                 lans=`/usr/etc/netstat -i | grep -v none | \
837                   awk '{print $1}' | grep -v lo0 | grep -v Name `
838                 for interface in $lans 
839                 do
840                    show "Network snapshot - $interface" check_network
841                 done 
842                 check_cc
843                 show "MVFS parameters" get_mvfs_sgi6
844                 ;;
845         #other
846         * ) echo "$prog": unknown operating system: $OS $CPUOS
847             exit ;;
848         esac
849         ;;
850
851 #Digital Unix
852 OSF1)      osf1
853            lans=`/usr/sbin/netstat -i | grep -v none | \
854               awk '{print $1}' | grep -v lo0 | grep -v Name `
855             for interface in $lans 
856             do
857                show "Network snapshot - $interface" check_network
858             done 
859            check_cc
860            show "MVFS parameters" get_mvfs_osf1
861            ;;
862
863 #Unixware
864 UNIX_SV)   unixware
865            lans=`/bin/netstat -i | grep -v none | \
866              awk '{print $1}' | grep -v lo0 | grep -v Name `
867            for interface in $lans 
868            do
869               show "Network snapshop - $interface" check_uw_network
870            done 
871            check_cc
872            ;;
873
874 #other
875 * ) echo "$prog": unknown operating system: $OS $CPUOS
876     exit ;;
877 esac
878