Ad Widget

Collapse

Extracting composite data from JMX

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • drgr33n
    Junior Member
    • Dec 2015
    • 13

    #1

    Extracting composite data from JMX

    Hey All,

    I'm writing some LLD templates for a Tomcat application and I've run into a little trouble. So I'm trying to extract "java.lang:type=GarbageCollector,name=G1 Young Generation",LastGcInfo.*". For the most part, everything works as expected and I can get top-level composite data like "GcThreadCount" etc. There are lower levels though like memoryUsageAfterGc. memoryUsageAfterGc and memoryUsageBeforeGc uses a map to store data. My question is how do I access the data map?

    Here's an example, so I have the bean java.lang:type=GarbageCollector,name=G1 Young Generation",LastGcInfo.memoryUsageBeforeGc, nested within that bean there is a map with the key "Code Cache" with information about the memory state before the last garbage collection was triggered. Instinct tells me to use this format but it doesn't work java.lang:type=GarbageCollector,name=G1 Young Generation",LastGcInfo.memoryUsageBeforeGc['commited']

    Thank you for any information provided.

    EDIT:

    To elaborate, here's the output from jmxterm:

    $>get LastGcInfo.memoryUsageAfterGc
    #mbean = java.lang:name=G1 Young Generation,type=GarbageCollector:
    LastGcInfo.memoryUsageAfterGc = {
    ( G1 Old Gen ) = {
    key = G1 Old Gen;
    value = {
    committed = 877658112;
    init = 1017118720;
    max = 3221225472;
    used = 529530880;
    };
    };
    ( G1 Perm Gen ) = {
    key = G1 Perm Gen;
    value = {
    committed = 98566144;
    init = 20971520;
    max = 536870912;
    used = 97586816;
    };
    };
    ( Code Cache ) = {
    key = Code Cache;
    value = {
    committed = 11599872;
    init = 2555904;
    max = 50331648;
    used = 11391936;
    };
    };
    ( G1 Eden Space ) = {
    key = G1 Eden Space;
    value = {
    committed = 175112192;
    init = 56623104;
    max = -1;
    used = 0;
    };
    };
    ( G1 Survivor Space ) = {
    key = G1 Survivor Space;
    value = {
    committed = 20971520;
    init = 0;
    max = -1;
    used = 20971520;
    };
    };
    };

    $>bean
    java.lang:name=G1 Young Generation,type=GarbageCollector


    How do I access: G1 Old Gen.committed
    Last edited by drgr33n; 15-05-2019, 11:50.
  • drgr33n
    Junior Member
    • Dec 2015
    • 13

    #2
    Thought I'd update this post. After a little more research and speaking to a couple of guys over on the IRC channel @freenode, it turns out Zabbix doesn't support this as of today. There is a patch lurking on the internet to enable support. Here's a link to the patch over on dpaste.

    dpaste.com is a pastebin site for easily sharing and storing code snippets. Syntax highlighting, clean interface, markup preview, quick sharing options.


    Because I'm using CentOS for this install, I'm just going to add the patch to the SPEC and build a custom rpm. I'll update this post with my results.

    Comment

    • Eyas
      Junior Member
      • Jun 2022
      • 1

      #3
      Hi drgr33n
      can you reshare your patch as the link is not working

      Comment

      • dimir
        Zabbix developer
        • Apr 2011
        • 1080

        #4
        This will be fixed in https://support.zabbix.com/browse/ZBX-23948 (planned for 7.0)

        Comment

        Working...