Created
May 23, 2013 10:42
-
-
Save miglen/5635214 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Bash Script for Thread dump | |
# On WAS Application Server | |
# | |
if [ "$#" -ne 2 ] | |
then | |
echo "Usage: `dirname $0`/$0 <WAS Directory> <ServerName>" | |
exit 1 | |
fi | |
PIDFILE=`find $1 -iname $2.pid 2>/dev/null` | |
if [ -s $PIDFILE ] | |
then | |
echo "$1 pid file found : $PIDFILE!" | |
PROCC1=`cat $PIDFILE` | |
PROCCE=`ps -fe | grep $PROCC1 | grep -v grep | wc -l` | |
if [ $PROCCE -eq 1 ] | |
then | |
echo "Generating thread dump of pid: $PROCC1" | |
kill -3 $PROCC1 | |
else | |
echo "Proccess with pid $PROCC1 not found! Are you sure your server is up and running?" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment