Glassfish Monitoring with VisualVM

For monitoring Glassfish performance i use VisualVM. I have visual installed on my laptop and the connects using jmx to my glassfish servers to get server stats.

This is only to get the current data and to se how mutch memory my apps are using and so on.

 

1. Download and start VisualVM

Go here and download VisualVM http://visualvm.java.net/
Install visual on you local computer.

 

2. Set up Glassfish for reciving JMX connections from external ip

On your glassfish you need to add som jvm values so in your server-config –> jvm-settings –> JVM options add the following.

 

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8686
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=192.168.0.1 <--- IP of you server

Now restart you glassfish.
And enabel secure-admin and set admin password.
Se my post on installing Glassfish for how

 

3. Setup VisualVm to get data from Glassfish

Add a new remote host, then add new JMX connection and add the ip and port(8686) to the settings and connect.

Now you should see monitroing data from you glassfish.