[ZBX-9006] java gateway does not support ipv6 Created: 2014 Nov 07  Updated: 2017 May 30  Resolved: 2014 Dec 08

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Java gateway (J)
Affects Version/s: 2.2.7
Fix Version/s: 2.5.0

Type: Incident report Priority: Minor
Reporter: Tom Seeley Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: ipv6
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

the java gateway gives up when presented with a ipv6 address:

com.zabbix.gateway.SocketProcessor - error processing request
com.zabbix.gateway.ZabbixException: java.lang.NumberFormatException: For input string: "62c:1540:3::1:10:2099"


 Comments   
Comment by Aleksandrs Saveljevs [ 2014 Nov 07 ]

A quick patch would be:

$ svn di
Index: src/com/zabbix/gateway/JMXItemChecker.java
===================================================================
--- src/com/zabbix/gateway/JMXItemChecker.java  (revision 50472)
+++ src/com/zabbix/gateway/JMXItemChecker.java  (working copy)
@@ -57,7 +57,7 @@
                        String conn = request.getString(JSON_TAG_CONN);
                        int port = request.getInt(JSON_TAG_PORT);
 
-                       url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + conn + ":" + port + "/jmxrmi");
+                       url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://[" + conn + "]:" + port + "/jmxrmi");
                        jmxc = null;
                        mbsc = null;
 
Comment by Aleksandrs Saveljevs [ 2014 Nov 07 ]

Available in development branch svn://svn.zabbix.com/branches/dev/ZBX-9006 . Chosen solution is the same as the patch above.

Comment by Aleksandrs Saveljevs [ 2014 Nov 07 ]

That patch also works for IPv4, although http://docs.oracle.com/javase/7/docs/api/javax/management/remote/JMXServiceURL.html only mentions square brackets in regard to IPv6.

Comment by Aleksandrs Saveljevs [ 2014 Dec 08 ]

Available in pre-2.5.0 (trunk) r51064.

Comment by Aleksandrs Saveljevs [ 2014 Dec 08 ]

(1) Documented in "What's new": https://www.zabbix.com/documentation/3.0/manual/introduction/whatsnew300#support_for_ipv6_addresses_in_java_gateway .

sasha CLOSED

Generated at Thu Apr 25 04:23:25 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.