ziggy
ziggy

Reputation: 15876

Which Tomcat Mbean can be used to access web app information

I am trying to write a client tool which monitors an application running in Tomcat 5.5. I know there are quite a few already available but the majority of them are web based and dont provide a lot of support for automating the monitoring process.

The tool i am writing now is very simple. Its a client java process that connects to the Tomcat instance remotely. I have managed to connect to it but now i am stuck as to how to use the MBeans that are already available in Tomcat.

My question really is which Mbeans within Tomcat do i query to find out the following information

Are there any MBeans that provide this info? if so how do i access it?

it would be very usefull to see a full list of all mbeans available in Tomcat and how to access them. I have seen this list http://tomcat.apache.org/tomcat-5.5-doc/catalina/funcspecs/mbean-names.html but it is quite confusing.

Thanks

Upvotes: 2

Views: 3677

Answers (2)

Roland Huß
Roland Huß

Reputation: 2525

You could use the check_jmx4perl configuration with pre-defined Tomcat checks as a starting point. It references the names of quite some MBeans which can be found on a standard Tomcat installation.

I.e. the following metrics are pre-defined:

  • Nr. of servlet requests for a certain servlet
  • Processing CPU time for a webmodule
  • Check whether a webmodule is active
  • Active sessions
  • Max. number of active sessions
  • Number of rejected sessions
  • Average lifetime of a session
  • Max. lifetime of the longest session
  • Data received rate for a connector
  • Data sent rate for a connector
  • Processing time for a connector
  • Number of active datasource connections

You can find this sample tomcat.cfg configuration here: https://github.com/rhuss/jmx4perl/blob/master/config/tomcat.cfg

Upvotes: 0

Nikunj
Nikunj

Reputation: 3128

You can use jConsole utility of Java to see the MBeans available in remote Tomcat server. It will connect to remote server with jmx port. All the MBeans available are listed in MBean tab. This can help you finding the MBeans you wants and exact name of the MBean attribute.

Thanks.

Upvotes: 4

Related Questions