[CentOS] Tomcat Monitoring

Tue Jan 20 22:09:14 UTC 2009
nate <centos at linuxpowered.net>

Sean Carolan wrote:
>> > You can use snmp and cacti to monitor some of the tomcat information.
>> > You simply need to add a few configuration modifications.
>> >
>> > See http://java.sun.com/j2se/1.5.0/docs/guide/management/SNMP.html\
>
> Thank you all for the replies.  We already use Nagios so I'm hoping
> for a nagios-friendly solution.  Unfortunately the check_jmx plugin
> listed on the Nagios exchange doesn't seem to work properly, being
> unable to monitor Heap Memory Usage over 2Gb.

Monitoring heap is somewhat black magic in my experience, filled with
false alarms.

You can use this jsp to poll the heap if you want:

<% Runtime runtime = Runtime.getRuntime(); %>
<%=runtime.freeMemory()%> memory free of <%=runtime.totalMemory()%> total
memory

I don't monitor heap in nagios, only in cacti. At my last company I
had simple crons to monitor when the JVMs spit out of memory errors
and restarted them automatically.

A couple companies ago I polled heap for weblogic and stored the
values in RRDtool then wrote scripts to get the averages over
a period of time to detect low heap levels and alert, took a lot
of work to get right and even after all the work there was still
some false alarms.

> Does anyone else have a dependable nagios plugin for keeping tabs on
> Nagios?  If not we will write our own.

Good luck..a big problem with some JMX client implementations is
that they spin up a JVM each time they want a stat. Last time I
talked to the people at Groundwork they said they had some sort
of JMX tie-in, and their stuff is nagios based you may find
something there.

nate