How to find the JMX port in a server?

user244333 picture user244333 · Sep 23, 2011 · Viewed 81.3k times · Source

I am sure I can figure it out if I can see the JAVA OPTS parameters. I want to monitor a hornetq server using Jconsole, so I need the port number.

I remember using some command like java grep etc when I connected to it a while back.

Answer

matt b picture matt b · Sep 23, 2011

If you know the process number you can use netstat to find what ports the program is listening on with something like

$ netstat -apn | grep <proc num>

The conventional port for JMX listeners is 1099.