tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <>
Subject Re: Tomcat monitoring using JMX
Date Thu, 06 Jan 2011 15:03:16 GMT
On 1/6/11 12:44 PM, Ziggy wrote:
> Hi,
> I am using JMX to connect to a Tomcat instance and looking at attributes for
> a jdbc datasource as shown below.
> MBeanServerConnection conn = jmxc.getMBeanServerConnection();
> ObjectName on = new
> ObjectName("Catalina:type=DataSource,path=/appdb,host=localhost,class=javax.sql.DataSource,name=\"jdbc/appdb\"");
> mbsc.getAttribute(on, "numIdle")
> Is there an Mbean provided by Tomcat that can provide me the following
> information
> - Whether Tomcat is running

Well you won't be able to connect to it to get the Bean if it's isn't.

> - Whether a specific web app running under a specific context is runnin

Catalina:type=WebModule,... etc

> - The health of the environment in general (tomcat, OS etc)

Define "health".

> - Whether a JNDI datasource is available and if possible how many active
> database connections there are and how many free.

You've already got the DataSource above, why not connect JConsole to
Tomcat and explore the other attributes?

> I have been google'ing around but the majority of the examples talk about
> writing your own Mbean and including it as part of the application. I am
> trying to write an external client utility that will monitor the application
> away from Tomcat.

JConsole?  VisualVM?


> Thanks

View raw message