How to monitor c3p0 connections

You can monitor your connection pool(s) via JMX. From the documentation:

Configuring and Managing c3p0 via JMX

If JMX libraries and a JMX
MBeanServer are available in your
environment (they are include in JDK
1.5 and above), you can inspect and configure your c3p0 datasources via a
JMX administration tool (such as
jconsole, bundled with jdk 1.5). You
will find that c3p0 registers MBeans
under com.mchange.v2.c3p0, one with
statistics about the library as a
whole (called C3P0Registry), and an
MBean for each PooledDataSource you
deploy. You can view and modify your
DataSource’s configuration properties,
track the activity of Connection,
Statement, and Thread pools, and reset
pools and DataSources via the
PooledDataSource MBean. (You may
wish to view the API docs of
PooledDataSource for
documentation of the available
operations.)

By the way, there seem to be JMX plugins for Nagios, you’re not forced to use a JSP.

Leave a Comment