Created
September 24, 2013 13:30
-
-
Save enriquemanuel/6684699 to your computer and use it in GitHub Desktop.
I created this small GIST about creating 5 thread dumps one after the other waiting for 10 seconds and then gzipping them and sending them using mutt. you can install mutt using yum or your prefer method.
This file contains 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 | |
#creating my folder to store them | |
if [ ! -d /tmp/`hostname` ] | |
then | |
mkdir -p /tmp/`hostname` | |
fi | |
#executing my command | |
/usr/local/blackboard/tools/admin/ServiceController.sh services.appserver.threaddump | |
sleep 10 | |
/usr/local/blackboard/tools/admin/ServiceController.sh services.appserver.threaddump | |
sleep 10 | |
/usr/local/blackboard/tools/admin/ServiceController.sh services.appserver.threaddump | |
sleep 10 | |
/usr/local/blackboard/tools/admin/ServiceController.sh services.appserver.threaddump | |
sleep 10 | |
/usr/local/blackboard/tools/admin/ServiceController.sh services.appserver.threaddump | |
#move all the thread dumps to the temp location | |
mv /usr/local/blackboard/logs/tomcat/thread_dump* /tmp/`hostname`/ | |
#gzip them | |
tar -zcvf `hostname`.gz /tmp/`hostname` | |
#email them | |
SUBJECT='Thread Dumps from '`hostname` | |
mutt -s $SUBJECT mail@mail.com -a /tmp/`hostname`.gz < text.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment