How to monitor J2EE applications
I found a cool JMX plugin that is does just that.
In the example I am doing for Glassfish but I believe it can be done
for Weblogic or Tomcat as well.
I found quite usefull to have JConsole open so I can find out what parameters.
How to install JConsole,
1. download and install NetBeans
2. download and install Java JDK
Open the NetBeans>Tools>Plugins JConsole
The trick is to know the JMX url when glassfish is started it shows exactly that.
It should look something like:
The plugins needed are available here
To install it
# wget
# unzip
# cd nagios-jmx-plugin-1.2.0/
# cp check* /usr/local/nagios/libexec/
# chmod +x /usr/local/nagios/libexec/check_j*
Remember you will also need to have Java JRE on the nagios server or run the plugin remotely.
To install run:
# yum install java-1.6.0-openjdk
Doing it remotely I noticed that it was not outputing the perfdata information needed to graph the output.
So i Had to install Java on my nagios server.
To monitor via JMX:
“Heap Memory Use”
./check_jmx -U service:jmx:rmi:///jndi/rmi:// -O java.lang:type=Memory -A HeapMemoryUsage -K used –username admin –password <PASS> -w 180000000 -c 250000000
“Live Threads”
./check_jmx -U service:jmx:rmi:///jndi/rmi:// -O java.lang:type=Threading -A ThreadCount -K value –username admin –password <PASS> -w 190 -c 250
I also monitor de wdsl webservices if they are responding correctly by doing a check_http.

Tags: , , , , ,

3 thoughts on “How to monitor J2EE applications

  1. Hi Felipe,
    Many thanks for your attention.
    I can monitor GlassFish with check_jmx4perl on OMD. Is it possible to use check_jmx4perl on Centreon? I’ve tried to do this carefully but got null in status information. Your suggestion is eagerly awaited and much appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *