Monitoring Java Web applications – is JMX the right choice?
We have a Java Web application. We want to set up some basic monitoring in order to expand this monitoring in the future Our plan is as follows:
(1) Collect general information (such as memory and threads) about the virtual machine running the web container of the application
(2) Monitor the status of the application This is rather vague, but at least we want to see if the web application still exists and can respond to requests
(3) In the future, we will collect more information related to our application Again, this is rather vague, but you can assume that we may want to collect some statistics internally through the application to support personnel
Typically, web applications will be deployed in Tomcat 5.5 or 6 environments A quick search on the network shows that JMX can be enabled for tomcat, and then jconsole can be used to connect to the server This gives us a lot of basic information about the solution points (1) In addition, some information is provided in the MBean section of "Catalina", which can at least be studied in depth. For example, you can see the number of requests received by a specific servlet This is not the point we want (2), but at least give us some information There seems to be a lot of information here, but it is quite difficult to explain it with jconsole There may be a better tool to explain MBeans exposed by Tomcat
For point (3), at first glance, we can write our own MBeans and provide them to jconsole Personally, this will involve me learning JMX. I'm happy to do it, but I have a problem Looking around, I noticed that most textbooks on this issue have not been updated for a few years, and open source tools seem to be getting worse without the latest updates So my main question is a simple one What do you think of JMX? Does it have a future or is it replaced by something else? Since we already have our web application, but we start from scratch for the management console, should we choose JMX or provide something more suitable in a better future?
I ask this question, no one's axe grinding, I'm just interested in hearing your opinions and experience I believe there is no correct answer, but I think an informed discussion will be useful
Thank you in advance,
Adam
Solution
JMX is certainly a good solution I don't have to worry about its pain I have been using (or have plans to use) JMX recently. Before choosing anything else in the Java world, I must hear a very convincing argument It's easy to write a client (monitoring solution) for it, and you can easily return complex data Most third - party components support monitoring through JMX
Please note that you may need to consider integration with any existing management solutions (such as Nagios, BNC patrol, HP OpenView, etc.) They may not be so Java aware, but prefer testing, such as simple HTTP connection, to test whether the website is enabled (easy to use Nagios) or integrated with SNMP (OpenView itself)