[CentOS] Apache jserv monitoring?

nate centos at linuxpowered.net
Tue Jun 10 22:16:59 UTC 2008

Sean Carolan wrote:

> Are any of you aware of tools for monitoring apache jserv, either from
> localhost or by connecting to port 8008 over the network?  I really
> want to find out if there is a way to detect a "sick" JVM other than
> getting a bunch of down URL alerts on my phone.

How about setting up a cron to monitor it and auto restart if it's not

wget -q --timeout=30 http://localhost:8008/ -O /dev/null || (command to
restart jserv)

I'm not familiar with jserv but it looks like it serves a purpose similar
to tomcat, just a much older code base.

I've used similar scripts for tomcat in the past, such as this cron
*/5 * * * * /bin/grep -q \"java.lang.OutOfMemoryError: Java heap space\"
/logs/tomcat/web/1/run.latest.log  1>/dev/null 2>&1 && export
MYHOST=`hostname -s` && echo \"Restarting Tomcat on $MYHOST -
OutOfMemoryError\" | mail -s \"[$MYHOST] Restarting Tomcat due to
OutOfMemoryError\" my at email.address &&  /etc/init.d/appname restart
1>/dev/null 2>&1

When the app had a memory leak it helped me sleep better at night, as
the apps were restarting about 10x a day until the developers found the
source of the leak. Fortunately the app restarted reliably 99.9% of the
time. Another place I worked at before that had an app that was so poor
that you had to babysit it all the time, the number of things that could
go wrong was really too much work for us to automate it in a reasonable
amount of time.

Ideally the "load balancer" should be performing "health checks" against
the back end nodes and stop sending traffic to them if they are no
longer healthy. I'm not familiar with the load balancing method your
using, only with bigger load balancers like F5 BigIP.


More information about the CentOS mailing list