Reputation: 15876
Im looking for ideas on how to best monitor an application running in Tomcat. I am not refering to Tomcat Monitoring but rather checking that the "web application" is active/live.
I know that there are several tools for monitoring Tomcat (lamdbaprobe, Nagios etc) but i want to monitor the actual application that is running within Tomcat. The reason for this is that there are several situations where Tomcat could be running but the application could not be available
One solution that i am thinking about is writing a tool that would try and access the application. For example write a java tool to send and HTTP request and monitor the response.
What is the best approach for this? I have heard of JMX mentioned a lot but i dont know much about it. Can it be used to do the above? Do you know of any other existing tool that would do this or do you know of a better approach ?
Upvotes: 2
Views: 2682
Reputation: 1
I've just open a new application performace monitoring tool
https://github.com/scouter-project/scouter/
Service monitoring is really different then Tomcat monitoring. SCOUTER is a web application service monitoring tool. You can check the performance(also profole/sqls) of every single transaction(service request) on the response scatter chart(XLOG chart)
Upvotes: 0
Reputation: 4877
I had once worked with AppDynamics Lite, and it was really helpful in monitoring performance of applications deployed on Tomcat. There's an advanced version, but i don't think it's for free. the lite version is free to use.
Upvotes: 1
Reputation: 4740
JMX is what you should choose.
In its simplest form it is not more than writing an interface, the respective class for accessing the information, and then deploy this instance in the MBeanServer. It's a breeze - with a little google you should come up with a solution in an hour.
Using this appraoch you have seamless integration with for example Tomcat itself. Tomcat also publishes its information using JMX.
Communication is based on a standard, there are lot of tools around that speak "JMX over RMI", for example the jconsole or jvisualVM. Most monitoring software have JMX plugins (Nagios and others - we use Hyperic).
EDIT
Well, lets look at it the other way round. Write a class that gathers the information you want to publish. For sure the information mut be public somewhere...
class MyInfo {
public int getCurrentValue() {
// lookup this value wherever yoy want
return 42;
}
}
Write an interface
interface MyInfoMBean {
public int getCurrentValue();
}
Write a ContextListener that registers this MBEan at web app start.
So, if you need to change your application in any way depends if the information you want to publish is easily available.
Upvotes: 1
Reputation: 5195
Have you tried using JVisualVM? It comes with the Oracle SDK and may give you what you need.
Upvotes: 1