[ZBX-23948] JMX - problem with tabular data Created: 2024 Jan 17  Updated: 2025 Feb 27  Resolved: 2024 Apr 05

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 6.0.24
Fix Version/s: 6.0.29rc1, 6.4.14rc1, 7.0.0beta3, 7.0 (plan)

Type: Problem report Priority: Trivial
Reporter: Jacek Assignee: dimir
Resolution: Fixed Votes: 9
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File GarbColAttrs_JMXterm.txt     File GarbColAttrs_Zabbix.json    
Issue Links:
Duplicate
Team: Team A
Sprint: S24-W8/9, S24-W10/11, S24-W12/13, S24-W14/15
Story Points: 4

 Description   

Problem:
I'm trying to retrieve data from composite attribute LastGcInfo (domain: java.lang, bean: java.lang:name=G1 Young Generation,type=GarbageCollector), but it seems like not all data from this attribute is properly discovered or accessible by Zabbix.  

There is no problem getting values for top-level composite data, such as LastGcInfo.GcThreadCount or LastGcInfo.id, but when it comes to more complex tabular data, Zabbix either doesn't detect it at all or (when asked explicitly) returns errors.

File GarbColAttrs_Zabbix lists all attributes detected by Zabbix, for comparison file GarbColAttrs_JMXterm lists all parameters for the LastGcInfo attribute seen in JMXterm tool. Only simple parameters (i.e. starttime, endtime, duration, id, GcThreadCount) overlap, more complex data is not existant from Zabbix perspective.

I've tried various combinations of paths in Zabbix item key, but in each case, depending on the length of the path, I've received different errors.

Eg.:

Key Error
  • jmx["java.lang:type=GarbageCollector,name=G1 Young Generation","LastGcInfo.memoryUsageBeforeGc.Metaspace.value.used"]
  • jmx["java.lang:type=GarbageCollector,name=G1 Young Generation","LastGcInfo.memoryUsageBeforeGc.Metaspace.value"]
  • jmx["java.lang:type=GarbageCollector,name=G1 Young Generation","LastGcInfo.memoryUsageBeforeGc.Metaspace"]
  • jmx["java.lang:type=GarbageCollector,name=G1 Young Generation","LastGcInfo.memoryUsageBeforeGc.Metaspace.['value']"]
unsupported data object type along the path: class javax.management.openmbean.TabularDataSupport
  • jmx["java.lang:type=GarbageCollector,name=G1 Young Generation","LastGcInfo.memoryUsageBeforeGc"]
  • jmx["java.lang:type=GarbageCollector,name=G1 Young Generation","LastGcInfo"]
Data object type cannot be converted to string.
jmx["java.lang:type=GarbageCollector,name=G1 Young Generation","LastGcInfo.*"] Argument key="*" is not an existing item name for this CompositeData instance.

Referring to ZBXNEXT-2727 support for tabular data should be possible from version 5.0.0, but it looks like this support is not complete.

How to correctly retrieve data from nested parameters?
If inability to pass through nested tables is not a bug (or is już not possible), would it be possible to return whole table in such cases?  In that case, it wolud be possible to extract the neccesary data via preprocessing in Zabbix.

Steps to reproduce:

  • Install Tomcat and enable its default sample application
  • Communicate it with Zabbix Server via Zabbix Java Gateway
  • Try to discover attributes for Garbage Collector

      JMX agent, key: jmx.discovery[attributes,"*:type=GarbageCollector,name=*"]       

  • Try to get data from specific attribute

       JMX agent, e.g. key: jmx["java.lang:type=GarbageCollector,name=G1 Young Generation","LastGcInfo.memoryUsageBeforeGc.Metaspace.value.used"]

Thanks in advance for help.



 Comments   
Comment by dimir [ 2024 Jan 18 ]

Indeed looks like the change in ZBXNEXT-2727 wasn't complete. We should probably go until primitive data recursively.

Comment by Jacek [ 2024 Jan 18 ]

Thanks Dimir for response. If any additional information or testing is needed, I would be happy to help if possible.

Comment by dimir [ 2024 Feb 22 ]

This one is correct:

jmx["java.lang:type=GarbageCollector,name=G1 Young Generation","LastGcInfo.memoryUsageBeforeGc.Metaspace.value.used"]

and will be supported.

Comment by dimir [ 2024 Feb 22 ]

Fixed in development branch for 6.0: feature/ZBX-23948-6.0

Feel free to try it out jacek kupski, let me know if you have questions.

Comment by dimir [ 2024 Apr 04 ]

Overview

Before this fix TabularData data was only supported in the beginning of the MBean object.

After this fix TabularData data is supported in any place of the MBean object.

Fixed in

Generated at Wed Jul 23 10:54:39 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.