# # This script will gather all of the logs needed to trouble shoot a VA. # To make this script executable run: # chmod 777 getVAlogs # To run this script execute the script name followed by the array ID. # getVAlogs {array ID} # # This script was released on January 11th 2002. # # January 23rd 2002 # Added an armdsp_{array ID} to the output file. # # January 24th 2002 # Added access.dat and PanConfigParams to the files gathered. # Added a vgdisplay -v capture # # January 28th 2002 # Added a syntax statement if the script is run with no parameters. # Added the gathering of 3 different swlist outputs and uname -a. # Added absolute paths to all commands. # # February 1st 2002 # Added a gathering of disk logs for all disks in the array. # # February 13th 2002 # Fixed a local formatting problem with the armperf output. # Started displaying and tracking by script version number. # # April 24th 2002 # Added armperf -c DISK, for gathering disk performance logs # Change the armlog routine to remove the prompt and warnings # Changed script version to 1.02 # # June 27th 2002 # Updated script to run with Command View 1.05 # Added armdiag -W and armlog -e output gathering # Added command to break any software locks # Changed script version to 1.03 # # August 27th 2002 # Added the gathering of port logs and port statistics. # Changed script version to 1.04 # # September 8th 2002 # Added the gathering of the disks port statistics log pages. # Changed script version to 1.05 # # November 11th 2002 # Changed the output file output the date in the name as well. # Added gathering of disk port performance logs from CV 1.06 # Added gathering on logprn software logs from CV 1.06 # Stopped gathering disk port statistics directly from the disks. # Stopped gathering the disk performance logs. # No one uses them and they take too log to gather. # Stopped gathering the disk event logs. They should not be needed # with the addition of the disk ports performance logs. # Changed script version to 1.06 # # script_version=1.06 ARMCMD=/opt/sanmgr/commandview/client/sbin separator="=========================================================" typeset -Z2 year yr mth mn day dy if [ $# -ne 1 ] then echo "getVAlogs script version ""$script_version" echo echo Usage: getVAlogs [array ID] echo echo This script will gather all of the VA logs for the specified array ID. echo These logs will be stored in the current directory. echo Please verify that there is at least 200MB free in the current directory. echo The file output by this script will be named {hostname}_{array ID}.tgz echo exit else arrayId=$1 fi echo /usr/bin/hostname | read host /usr/bin/date +"%y %m %d" | while read year mth day do if (($mth==1)) then dy="$(($day))" mn="12" yr="$(($year-1))" else dy="$(($day))" mn="$(($mth-1))" yr="$(($year))" fi if (($day>28)) then dy="28" fi ts="$mn""$dy""000020""$yr" done echo "getVAlogs script version ""$script_version" echo echo This script will gather all of the VA logs for the specified array ID. echo These logs will be stored in the current directory. echo Please verify that there is at least 200MB free in the current directory. echo The file output by this script will be named {hostname}_{array ID}.tgz echo If you do not wish to continue press [CTRL-C] now. echo echo echo "Gathering logs for array "$1" on host "$host mkdir "$1""$ts" cd "$1""$ts" echo "getVAlogs script version ""$script_version" > getVAlogs.txt printf "Started at: " >> getVAlogs.txt /usr/bin/date >> getVAlogs.txt cp ../getVAlogs . echo "Breaking software locks" $ARMCMD/armmgr -b CreateLun $1 >/dev/null $ARMCMD/armmgr -b FwDownload $1 >/dev/null $ARMCMD/armmgr -b Security $1 >/dev/null $ARMCMD/armmgr -b Select $1 >/dev/null $ARMCMD/armmgr -b PassThru $1 >/dev/null $ARMCMD/armmgr -b HostPort $1 >/dev/null #$ARMCMD/armmgr -b PortParams $1 >/dev/null sleep 5 echo "Gathering array configuration" $ARMCMD/armdsp -i > armdsp_i.txt $ARMCMD/armdsp $1 > armdsp_$1.txt $ARMCMD/armdsp -a $1 > armdsp_a_$1.txt $ARMCMD/armdsp -ps $1 > armdsp_ps_$1.txt sleep 5 echo "Gathering event logs" LC_ALL=en_US.iso88591 $ARMCMD/logprn -t all -v -s "$ts" -a $1 > logprn_$1.txt LC_ALL=en_US.iso88591 $ARMCMD/logprn -t Software -v -s "$ts" -a $1 > logprn_software_$1.txt LC_ALL=en_US.iso88591 $ARMCMD/armlog -e $1 > armlog_e_$1.txt $ARMCMD/armdiag -W $1 >armdiag_W_$1.txt sleep 5 echo "Gathering features and settings" $ARMCMD/armfeature -r $1 > armfeature_$1.txt $ARMCMD/armhost -r -f armhost_$1.txt $1 >/dev/null $ARMCMD/armsecure -r -f armsecure_$1.txt -p AUTORAID $1 >/dev/null echo "Gathering host configuration" $ARMCMD/armtopology $host > armtopology_$host.txt /sbin/ioscan -fnk > ioscan_$host.txt /sbin/vgdisplay -v > vgdisplay_$host.txt cp /var/adm/syslog/syslog.log ./syslog.log_$host.txt cp /var/adm/syslog/OLDsyslog.log ./OLDsyslog.log_$host.txt cp /opt/sanmgr/hostagent/config/access.dat ./access.dat_$host.txt cp /opt/sanmgr/commandview/server/config/PanConfigParams.txt ./PanConfigParams_server_$host.txt /usr/bin/uname -a > uname_$host.txt /usr/sbin/swlist -v > swlist_v_$host.txt /usr/sbin/swlist > swlist_$host.txt /usr/sbin/swlist -l fileset -a patch_state > swlist_patch_state_$host.txt echo "Gathering array performance data" echo " ARRAY" LC_ALL=en_US.iso88591 $ARMCMD/armperf -c ARRAY -x COMMA -s "$ts" $1 > armperf_array_$1.txt sleep 5 echo " OPAQUE" LC_ALL=en_US.iso88591 $ARMCMD/armperf -c OPAQUE -x COMMA -s "$ts" $1 > armperf_opaque_$1.txt sleep 5 echo " LUN" LC_ALL=en_US.iso88591 $ARMCMD/armperf -c LUN -x COMMA -s "$ts" $1 > armperf_lun_$1.txt sleep 5 #echo " DISK" #LC_ALL=en_US.iso88591 $ARMCMD/armperf -c DISK -x COMMA -s "$ts" $1 > armperf_disk_$1.txt #sleep 5 echo " FRONTEND-PORT" LC_ALL=en_US.iso88591 $ARMCMD/armperf -c FRONTEND-PORT -x COMMA -s "$ts" $1 > armperf_frontend-port_$1.txt sleep 5 echo " BACKEND-PORT" LC_ALL=en_US.iso88591 $ARMCMD/armperf -c BACKEND-PORT -x COMMA -s "$ts" $1 > armperf_backend-port_$1.txt sleep 5 echo " DISK-PORTS" LC_ALL=en_US.iso88591 $ARMCMD/armperf -c DISK-PORTS -x COMMA -s "$ts" $1 > armperf_disk-ports_$1.txt sleep 5 #cat armdsp_a_$1.txt|grep 'Disk at ' > TMP0 #outputFile=armlog_d_$1.txt #awk '{ disk=substr($3,0,length($3)-1) # printf "Gathering disk logs for "disk"\n" # system("'"$ARMCMD"'/armlog -d "disk" '"$arrayId"' >>'"$outputFile"'") # system("echo "" >> '"$outputFile"'") # system("echo '"$separator"' >> '"$outputFile"'") # system("echo "" >> '"$outputFile"'") # }' TMP0 #rm TMP0 #cat armdsp_a_$1.txt|grep 'Disk at ' > TMP0 #outputFile=armlog_d_0xd_$1.txt #awk '{ disk=substr($3,0,length($3)-1) # printf "Gathering disk port logs for "disk"\n" # system("'"$ARMCMD"'/armlog -d "disk" -p 0xd '"$arrayId"' >>'"$outputFile"'") # system("echo "" >> '"$outputFile"'") # system("echo '"$separator"' >> '"$outputFile"'") # system("echo "" >> '"$outputFile"'") # }' TMP0 #rm TMP0 printf "Finished at: " >> getVAlogs.txt /usr/bin/date >> getVAlogs.txt /usr/bin/date +"%y %m %d" | while read year mth day do cd .. /usr/bin/tar -cvf - "$1""$ts" | /usr/contrib/bin/gzip -f -9 > "$host"_"$1"_20"$year"."$mth"."$day".tgz rm "$1""$ts"/* rmdir "$1""$ts" echo "" echo "Data gathering complete." echo "" echo "The output is in the file named: ""$host"_"$1"_20"$year"."$mth"."$day"".tgz" done