Posted By: Anonymous
Interested to know how people usually check to see if Tomcat is running on a Unix environment.
I either check that the process is running using
ps -ef | grep java ps -ef | grep logging
or i check that the port number is active
netstat -a | grep 8080
is there a better way of checking that Tomcat is running? The above seem to be to be a ‘hacky’ way of checking that Tomcat is running.
grep ps, when the pid has been written to the
I have a
cron‘d checker script which sends out an email when tomcat is down:
kill -0 `cat $CATALINA_PID` > /dev/null 2>&1 if [ $? -gt 0 ] then echo "Check tomcat" | mailx -s "Tomcat not running" [email protected] fi
I guess you could also use
wget to check the health of your tomcat. If you have a diagnostics page with user load etc, you could fetch it periodically and parse it to determine if anything is going wrong.