COPYRIGHT RESERVED 2009 BY MAX TSAI



Visit Max Tsai at Facebook | Twitter | atom

Sunday, February 22, 2009

Blackboard: a script to check on Tomcat instance

From time to time it happens that Apache is up and running, but Tomcat crashed. The
loadbalancer does not therefore detects the problem and continues to forward clients. Here is a
script that I did to monitor mod_jk.log:

#!/bin/sh

BBMODJKLOG=/usr/local/blackboard/logs/httpd/mod_jk.log
SIG="`uname -n`: `date` "
if [ -e $BBMODJKLOG ]; then
if grep "(errno=104)" $BBMODJKLOG > /dev/null; then
echo "$SIG: Error Jk_Mod"
fi
else
echo "$SIG: $BBMODJKLOG not found"
fi

echo "$SIG: MOD_JK Ok"
This script is still being tested; so, there is no automatic fail over to restart the tomcat instance.
p.s. After the successful restarting tomcat instance, the log should be rotated. -- a note to myself.

No comments:

Post a Comment