Background
Zenoss 4.x provides JMX monitoring support. You can access the following webpage to learn more:
Http://wiki.zenoss.org/ZenPack:Java_2_Platform_Standard_Edition_%28J2E%29
Problem
However, according to the configuration in the document, the following exception occurs when you try to monitor Tomcat in windows:
Error Connecting to Server ; Failed to connect to service:jmx:rmi:///jndi/rmi://XX.XX.XX.XX 12345/jmxrmi [Nested Exception: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: /XX.XX.XX.XX; nested exception is: java.net.ConnectException: Connection refused]]
Solution
Add the configuration in startup. bat
set JAVA_OPTS=%JAVA_OPTS%-Dcom.sun.management.jmxremote.port="12345" set JAVA_OPTS=%JAVA_OPTS%-Dcom.sun.management.jmxremote.authenticate="false"set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.ssl="false"
Extended:
set JAVA_OPTS=%JAVA_OPTS%-Djava.rmi.server.hostname=XX.XX.XX.XXset JAVA_OPTS=%JAVA_OPTS%-Dcom.sun.management.jmxremote.port="12345" set JAVA_OPTS=%JAVA_OPTS%-Dcom.sun.management.jmxremote.authenticate="false"set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.ssl="false"