Come join our live training webinar every other Wednesday at 11am PST and hear LogicMonitor experts explain best practices and answer common questions. We understand these are uncertain times, and we are here to help!
LogicMonitor uses JMX for monitoring Java applications. For information about Tomcat monitoring, see here.
JMX is enabled by passing parameters to the Java JVM during startup. For full instructions on enabling JMX monitoring within your Java applications, see Monitoring and Management Using JMX.
To enable JMX monitoring of a java process with user name/password access:
You then need to pass these parameters to Java when you start your process:
com.sun.management.jmxremote.access.file=location of jmxremote.access file
com.sun.management.jmxremote.password.file=location of jmxremote.password file
In LogicMonitor, you would set the properties jmx.user, jmx.pass and jmx.ports to the appropriate username, password and port(s) required for jmx access. (You could set these properties at the global, group or device level. See Defining authentication credentials.
Note: jmx.ports can be a comma separated list of ports to check for JMX access on, if you run multiple JMX apps on different ports.
Note that during establishment of the JMX connection, the host being queried will reply back with the address for the RMI connection – this requires that that the /etc/hosts file on the Java system is correctly set up, such that the /etc/hosts file contain that hostname and resolves it to the same address that the querying host resolves it to.
e.g. a system with this for /etc/hosts:
would have all JMX connections to demo1.logicmonitor.com fail (as it will send a response indicating that the dynamic RMI connection should be made to 127.0.0.1), whereas if the /etc/hosts contained this:
it would succeed (assuming 10.4.4.4 was its actual IP address.)
An alternative to avoiding name resolution issues is to explicitly identify the hostname to use for RMI connections when starting the Java application, by the -Djava.rmi.server.hostname= parameter.
We recommend using Jconsole to ensure you have JMX access set up correctly.
Note: by default, JMX access opens a dynamic port for RMI, above 1024. You may need to change firewall rules to allow the collector to make this connection to the Java server on non-privileged ports above 1024. You can also control the port used for the RMI access by explicitly setting it with the flag:
It works to set the RMI port to the same port that JMX is using – so this means you only need to open up one port through a firewall.
In This Article