Tutorial :monitoring & alerts for a j2se application


I am designing a J2SE application, and looking for a solution for monitoring and alerts. The requirements are:

  1. Objects can report their status and issue alerts when they have problems.
  2. Calling some pre-defined methods on specific objects (e.g. to dump their state).
  3. Monitoring JVM health, especially memory usage.
  4. Preferably access all of the above from a remote computer.

What would be the best solution for that? Anything involving JMX?


Yes, you're describing pretty much JMX and MBeans.


If you use Java 6u10 or later, also see VisualVM (jvisualvm.exe in the JDK) which can do all kinds of interesting things, including (with a plugin) the same things jconsole can.

It is really great for inspecting.


See JConsole, which is packaged with the Java install. This allows you to inspect JMX-available statistics, whether on local or remote machines. You need to start up your monitored VM with the appropriate options (detailed in the linked article) and then simply start JConsole and point to the required VM (you can secure via authentication if you require).

JConsole can inspect all the standard JMX beans, plus any that you create/register. The GUI will allow you to call exposed methods, and chart statistics etc.


You can use smartinspect to can log whatever you want in your app: objects, pictures, etc. You can also have access to it from remote computers.


If you want to throw alerts into the mix too, have a look at Jopr (http://www.jboss.org/jopr/)


If you want to inspect JMX-data try the Management Console that comes with JRockit Mission Control. It's JConsole/VisualVM on steroids. It's very easy to inspect arrays, maps, Collections, compositeData etc., and add the monitored attributes to a graph or a dial. It's also possible to create trigger alerts.

You can download it here for free.

alt text http://www.oracle.com/technology/products/jrockit/missioncontrol/new_and_noteworthy/3.1.0/images/console/mbean_drilling.png


If you need a continues monitoring solution, consider Evident ClearStone for Java. With this you can monitor any custom mbeans and also set it up to send you alerts when thresholds are breached.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »