Beruflich Dokumente
Kultur Dokumente
/bin/ksh
###############################################################################
#
# This script is used to collect data for
# 'MustGather: Performance, Hang or High CPU Issues on AIX'
#
# ./aixperf.sh [PID(s)_of_the_problematic_JVM(s)_separated_by_spaces]
#
SCRIPT_VERSION=2017.11.22
#
###############################################################################
# #
# Variables #
# #
##########################
SCRIPT_SPAN=240 # How long the whole script should take. Default=240
JAVACORE_INTERVAL=120 # How often javacores should be taken. Default=120
VMSTAT_INTERVAL=5 # How often vmstat data should be taken. Default=5
TPROF_SPAN=60 # How long tprof should collect data. Default=60
###############################################################################
# * All values are in seconds.
# * All the 'INTERVAL' values should divide into the 'SCRIPT_SPAN' by a whole
# integer to obtain expected results.
# * Setting any 'INTERVAL' too low (especially JAVACORE) can result in data
# that may not be useful towards resolving the issue. This becomes a problem
# when the process of collecting data obscures the real issue.
# added errpt to review for any hardware issues
# 11/2017 - added check for wpar name and parms
################################################################################
if [ $# -eq 0 ]
then
echo "$0 : Unable to find required PID argument. Please rerun the script as
follows:"
echo "$0 : ./aixperf.sh [PID(s)_of_the_problematic_JVM(s)_separated_by_spaces]"
exit 1
fi
##########################
# Create output files #
# #
##########################
# Create the screen.out and put the current date in it.
echo > screen.out
date >> screen.out
# Starting up
wparname=`uname -W`
wparspec=""
if ((wparname != 0))
then wparspec="-@ $wparname"
fi
print $(date) "MustGather>> aixperf.sh script starting..." | tee -a screen.out
print $(date) "MustGather>> Script version: $SCRIPT_VERSION." | tee -a screen.out
# Collect the first netstat: date at the top, data, and then a blank line
print $(date) "MustGather>> Collecting the first netstat snapshot..." | tee -a
screen.out
date >> netstat.out
netstat -an >> netstat.out 2>&1
echo >> netstat.out
print $(date) "MustGather>> First netstat snapshot complete." | tee -a screen.out
# Collect the first ps: date at the top, data, and then a blank line
print $(date) "MustGather>> Collecting the first ps snapshot..." | tee -a
screen.out
date >> ps.out
ps $wparspec avwwwg >> ps.out 2>&1
echo >> ps.out
print $(date) "MustGather>> First ps snapshot complete." | tee -a screen.out
done
print $(date) "MustGather>> Continuing to collect data for $JAVACORE_INTERVAL
seconds..." | tee -a screen.out
sleep $JAVACORE_INTERVAL
n=`expr $n + 1`
done