views:

1751

answers:

5

Hello, I have a Java app running on Tomcat, and I would like to monitor counters using Windows Performance Monitor. Is this possible using a JMX adapter for the Java MBeans or by some other means?

A: 

This seems to be exactly what you're looking for, but it's not free: http://www.adventnet.com/products/snmpadaptor/faqs/general.html

Michael Borgwardt
This adapter makes the MBeans accessible via SNMP. I am looking through the site, but I don't see a way to have them viewed directly in the Windows Performance Monitor.Thanks!Jon
+1  A: 

Since you tagged this with JMX and MBeans, I assume your counters are accessible from a Java MBean. If so you could use jconsole, provided with the Java SDK, to monitor the counters. Once you find your MBean in the MBeans tab, double click on the value and it will draw a nice line graph for easy monitoring.

See JConsole Guide for more info.

John in MD
Yes, the counters are accessible from the MBean. I am hoping to be able to view the counters in Performance Monitor since that is what our NOC already uses to monitor other counters and is familiar with. Adding in a new console for monitoring an app would be a large undertaking.Thanks,Jon
A: 

The following tutorial might be of use: http://www.developer.com/java/data/article.php/3087741

It shows how a Java application defines a custom counter that can be monitored in Perfmon. It basically boils down to using an extension DLL to the performance monitor and communicating with that via a memory mapped file. You could then hook your JMX counters into a similar mechanism so that they can be monitored from Perfmon.

BenM
A: 

If you want to do this programatically, you can create a JMXConnection to the machine, then accessing the MBeans from there. We did this ourselves for a function test that involved keeping track of the number of threads in the application, which there's a counter for that you can access through JMX. If you want nice graphs and things like that I suggest using JConsole, as mentioned above. There's also a program called JProfiler that works like JConsole on steroids, basically. There's a free trial so you can try it out.

Stefan Thyberg
A: 

This article outlines how to access Windows PerfMon stats from Java and expose them as MBean attributes through JMX.

Nicholas