[ZBXNEXT-4582] CLONE - Java Gateway not generates valid lld macro names during bean discovery Created: 2018 Jun 01  Updated: 2019 Nov 29  Resolved: 2018 Jun 01

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Java gateway (J)
Affects Version/s: None
Fix Version/s: None

Type: Change Request Priority: Minor
Reporter: Tomáš Heřmánek Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: jmx, lld, macros, patch, templates
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Centos 7 64bit, zabbix 3.4.9, Template: https://share.zabbix.com/official-templates/wildfly-eap-jboss-discovery


Attachments: Java Source File JMXItemChecker.java     File zabbix-java-gateway-3.4.9-1.el7.x86_64.rpm    

 Description   

The same problem is in this (CLOSED) issue https://support.zabbix.com/browse/ZBX-12705. But we need name of datasource for better readable in item. We found another problems with this “-“ pattern in other JMX path, this little change solved everything. If your team need some help I'm ready.
 
Symptoms:
 
V3.4.0-V3.4.4 Java Gateway
[ root @ tst-monit-001 ~ ] # ./zabbix_get_jmx.sh 'jmx.discovery[beans,"jboss.as:subsystem=datasources,data-source=*,statistics=pool"]' | jq '.data[0].value | fromjson | .data'
[
  {
    "{#JMXDOMAIN}": "jboss.as",
    "{#JMXDATA-SOURCE}": "NAV_DS",
    "{#JMXSUBSYSTEM}": "datasources",
    "{#JMXSTATISTICS}": "pool",
    "{#JMXOBJ}": "jboss.as:subsystem=datasources,data-source=NAV_DS,statistics=pool"
  },
 
This is exactly the same problem like in the issue.
 
V3.4.5+ Java Gateway
[ root @ tst-monit-001 ~ ] # ./zabbix_get_jmx.sh 'jmx.discovery[beans,"jboss.as:subsystem=datasources,data-source=*,statistics=pool"]' | jq '.data[0].value | fromjson | .data'
[
  {
    "{#JMXDOMAIN}": “jboss.as",
    "{#JMXSUBSYSTEM}": "datasources",
    "{#JMXSTATISTICS}": "pool",
    "{#JMXOBJ}": "jboss.as:subsystem=datasources,data-source=NAV_DS,statistics=pool"
  },
 
As you can see there is no possibility to read name of Datasource. I can only use {#JMXOBJ} to name it.
 
My version is (recompiled 3.4.9)
Here is RPM https://tomashermanek.cz/download/zabbix-java-gateway-3.4.9-1.el7.x86_64.rpm 
What I change in this file is: /root/rpmbuild/SOURCES/zabbix-3.4.9/src/zabbix_java/src/com/zabbix/gateway/JMXItemChecker.java
 
We started change on the line 274:
274                                 // This is changed for replace special characters
275                                 //String key = property.getKey().toUpperCase();
276                                 String key = property.getKey().toUpperCase().replace('-', '_’);
 
Result:
[ root @ tst-monit-001 ~ ] # ./zabbix_get_jmx.sh 'jmx.discovery[beans,"jboss.as:subsystem=datasources,data-source=*,statistics=pool"]' | jq '.data[0].value | fromjson | .data'
[
  {
    "{#JMXDOMAIN}": "jboss.as",
    "{#JMXDATA_SOURCE}": "NAV_DS",
    "{#JMXSUBSYSTEM}": "datasources",
    "{#JMXSTATISTICS}": "pool",
    "{#JMXOBJ}": "jboss.as:subsystem=datasources,data-source=NAV_DS,statistics=pool"
  },
 
I attached screenshoots from zabbix. There is a difference between name of datasource as you can see .
 
Tom



 Comments   
Comment by Tomas Hermanek [ 2018 Jun 01 ]

Please delete this issue.

Generated at Sat Apr 20 12:34:15 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.