On 1/6/11 12:44 PM, Ziggy wrote:
> Hi,
>=20
> I am using JMX to connect to a Tomcat instance and looking at attribute=
s for
> a jdbc datasource as shown below.
>=20
> MBeanServerConnection conn =3D jmxc.getMBeanServerConnection();
> ObjectName on =3D new
> ObjectName("Catalina:type=3DDataSource,path=3D/appdb,host=3Dlocalhost,c=
lass=3Djavax.sql.DataSource,name=3D\"jdbc/appdb\"");
> mbsc.getAttribute(on, "numIdle")
>=20
> Is there an Mbean provided by Tomcat that can provide me the following
> information
>=20
> - 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=3DWebModule,... etc
> - The health of the environment in general (tomcat, OS etc)
Define "health".
> - Whether a JNDI datasource is available and if possible how many activ=
e
> 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 abo=
ut
> writing your own Mbean and including it as part of the application. I a=
m
> trying to write an external client utility that will monitor the applic=
ation
> away from Tomcat.
JConsole? VisualVM?
p
> Thanks
>=20
|