[ZBX-6815] improve doc regarding using JMX and firewalls Created: 2013 Jul 23 Updated: 2024 Apr 10 Resolved: 2017 Oct 31 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Documentation (D) |
Affects Version/s: | 2.0.6, 2.1.1 |
Fix Version/s: | 4.0 (plan) |
Type: | Documentation task | Priority: | Minor |
Reporter: | Oleksii Zagorskyi | Assignee: | Martins Valkovskis |
Resolution: | Fixed | Votes: | 1 |
Labels: | java, javagateway, jmx, timeout | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
||||||||||||
Team: | Team A | ||||||||||||
Sprint: | Sprint 17, Sprint 18, Sprint 19 | ||||||||||||
Story Points: | 0.25 |
Description |
Communication between java proxy and monitored JMX application should not be firewalled, proofs: https://github.com/gehel/jmx-rmi-agent <- just read description Also, if on a server hosted a java app are several network interfaces, there is some requirement to specify "java.rmi.server.hostname" (see olegz.wordpress.com article) Our doc should be improved (by adding one note) because users have troubles with this. |
Comments |
Comment by Filipp Sudanov (Inactive) [ 2015 Mar 12 ] |
Or should we add to the docs recommendation to use com.sun.management.jmxremote.rmi.port as described in this comment: |
Comment by Oleksii Zagorskyi [ 2015 Aug 18 ] |
Not sure it's a good place to leave it, but it still better to finally leave it somewhere than keep it indefinitely in internal notes When java app is stopped: latest value: zabbix_server.log: 30214:20140516:140408.729 JMX agent item "jmx["java.lang:type=Memory","HeapMemoryUsage.used"]" on host "it0" failed: first network error, wait for 15 seconds 30192:20140516:140423.809 JMX agent item "jmx["java.lang:type=Memory","HeapMemoryUsage.used"]" on host "it0" failed: another network error, wait for 15 seconds 30192:20140516:140438.818 JMX agent item "jmx["java.lang:type=Memory","HeapMemoryUsage.used"]" on host "it0" failed: another network error, wait for 15 seconds 30192:20140516:140453.828 temporarily disabling JMX agent checks on host "it0": host unavailable jmx-interface error tool-tip: "java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.Co note that the tool-tip it's a truncated part of zabbix_java.log (here two lines only): 2014-05-16 14:04:08.715 [pool-1-thread-3] WARN com.zabbix.gateway.SocketProcessor - error processing request com.zabbix.gateway.ZabbixException: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: When java-gateway is stopped: latest value: zabbix_server.log: 30214:20140516:141308.808 JMX agent item "jmx["java.lang:type=Memory","HeapMemoryUsage.used"]" on host "it0" failed: first network error, wait for 15 seconds 30192:20140516:141323.986 JMX agent item "jmx["java.lang:type=Memory","HeapMemoryUsage.used"]" on host "it0" failed: another network error, wait for 15 seconds 30192:20140516:141338.998 JMX agent item "jmx["java.lang:type=Memory","HeapMemoryUsage.used"]" on host "it0" failed: another network error, wait for 15 seconds 30192:20140516:141354.011 temporarily disabling JMX agent checks on host "it0": host unavailable jmx-interface error tool-tip: cannot connect to [[localhost]:10052]: [111] Connection refused Conclusions: |
Comment by Oleksii Zagorskyi [ 2015 Nov 03 ] |
A bit more details. 2015-11-03 00:29:25.205 [pool-1-thread-1] DEBUG com.zabbix.gateway.SocketProcessor - starting to process incoming connection 2015-11-03 00:29:25.208 [pool-1-thread-1] DEBUG c.z.gateway.BinaryProtocolSpeaker - reading Zabbix protocol header 2015-11-03 00:29:25.208 [pool-1-thread-1] DEBUG c.z.gateway.BinaryProtocolSpeaker - reading 8 bytes of data length 2015-11-03 00:29:25.208 [pool-1-thread-1] DEBUG c.z.gateway.BinaryProtocolSpeaker - reading 130 bytes of request data 2015-11-03 00:29:25.209 [pool-1-thread-1] DEBUG c.z.gateway.BinaryProtocolSpeaker - received the following data in request: {"request":"java gateway jmx","conn":"123.123.123.123","port":12345,"keys":["jmx[\"java.lang:type=Memory\",HeapMemoryUsage.max]"]} 2015-11-03 00:29:25.219 [pool-1-thread-1] DEBUG com.zabbix.gateway.SocketProcessor - dispatched request to class com.zabbix.gateway.JMXItemChecker 2015-11-03 00:29:25.223 [pool-1-thread-1] DEBUG c.z.g.ZabbixJMXConnectorFactory - connecting to JMX agent at 'service:jmx:rmi:///jndi/rmi://123.123.123.123:12345/jmxrmi' 2015-11-03 00:29:28.233 [pool-1-thread-1] WARN com.zabbix.gateway.SocketProcessor - error processing request com.zabbix.gateway.ZabbixException: java.net.SocketTimeoutException: connection timed out: service:jmx:rmi:///jndi/rmi://123.123.123.123:12345/jmxrmi at com.zabbix.gateway.JMXItemChecker.getValues(JMXItemChecker.java:97) ~[zabbix-java-gateway.jar:na] at com.zabbix.gateway.SocketProcessor.run(SocketProcessor.java:63) ~[zabbix-java-gateway.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_79] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_79] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79] Caused by: java.net.SocketTimeoutException: connection timed out: service:jmx:rmi:///jndi/rmi://123.123.123.123:12345/jmxrmi at com.zabbix.gateway.ZabbixJMXConnectorFactory.connect(ZabbixJMXConnectorFactory.java:123) ~[zabbix-java-gateway.jar:na] at com.zabbix.gateway.JMXItemChecker.getValues(JMXItemChecker.java:89) ~[zabbix-java-gateway.jar:na] ... 4 common frames omitted 2015-11-03 00:29:28.237 [pool-1-thread-1] DEBUG c.z.gateway.BinaryProtocolSpeaker - sending the following data in response: {"response":"failed","error":"java.net.SocketTimeoutException: connection timed out: service:jmx:rmi:\/\/\/jndi\/rmi:\/\/123.123.123.123:12345\/jmxrmi"} 2015-11-03 00:29:28.238 [pool-1-thread-1] DEBUG com.zabbix.gateway.SocketProcessor - finished processing incoming connection If server's timeout is 3 seconds, interface error: ZBX_TCP_READ() failed: [4] Interrupted system call if server's timeout is 4 seconds, interface error is different:
java.net.SocketTimeoutException: connection timed out: service:jmx:rmi:///jndi/rmi://123.123.123.123:12345/jmxrmi
So in zabbix 3.0 it's nice that default timeout is 4 seconds https://www.zabbix.com/documentation/3.0/manual/introduction/whatsnew300#default_configuration_file_improvements |
Comment by Sandeep Singhal [ 2017 Sep 06 ] |
We have already increased the timeout from 3 to 4 but still its giving the same error as per below logs. ] Please suggest. Regards |
Comment by Oleksii Zagorskyi [ 2018 May 11 ] |
Collecting links... additional nice reading about JMX and ports http://blog.zabbix.com/new-monitoring-possibilities-for-java-applications-in-zabbix-3-4/5972/ Let me quote an interesting part here:
|