Ad Widget

Collapse

Zabbix and Actuator

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tr3pek
    Junior Member
    • Jul 2020
    • 2

    #1

    Zabbix and Actuator

    Hi,

    I'm trying to monitor a set of java applications which expose some metrics via Spring-Actuator endpoint.

    Click image for larger version

Name:	1.png
Views:	3072
Size:	32.6 KB
ID:	404424

    I couldn't find a proper way to handle LinkedHashMap structure in Zabbix, I created a simple JavaScript Preprocessor to get desired value from incoming data:

    Code:
    var msg = value;
    msg=msg.replace("{", "");
    msg=msg.replace("}", "");
    
    var array=msg.split(", ");
    var arrayLength = array.length;
    for (var i = 0; i < arrayLength; i++) {
        var element = array[i];
        var label = element.substring(0, element.indexOf("="));
        if(label=="hikari.datasource.threadsAwaiting") {
            return element.substring(element.indexOf("=")+1);
        }
    }
    That way I could extract only one value (in this case hikari.datasource.threadsAwaiting).
    But when I tried to create another Item for retrieving another value from this endpoint (by writing another Preprocessor) I got error saying that JMX Key I used (jmx["org.springframework.boot:type=Endpoint,name=metri csEndpoint","Data"]) is already used.
    The same when I tried to create completely new template with such Item. It apperas as if Key has to be globally unique.

    My question is:

    Is there a way to better handle LinkedHashMap? Or at least some way to create multiple Items with same Key but different Preprocessor to handle different elements?

  • kmaslowski
    Junior Member
    • Sep 2013
    • 4

    #2
    Hi.
    Can you provide example item key for springboot? I'm trying to monitor it through Zorka without success. I always get ZBX_UNSUPPORTED:

    Code:
    zabbix_get -s 127.0.0.1 -p 19256 -k zorka.jmx["java","org.springframework.boot:type=Endpoint,name=metricsEndpoint","Data"]
    ZBX_NOTSUPPORTED
    zabbix_get -s 127.0.0.1 -p 19256 -k zorka.jmx["java","org.springframework.boot:type=Endpoint,name=Metrics","tomcat.sessions.rejected"]
    ZBX_NOTSUPPORTED
    Last edited by kmaslowski; 06-09-2021, 13:04.

    Comment

    • kmaslowski
      Junior Member
      • Sep 2013
      • 4

      #3
      Originally posted by cyber
      kmaslowski zabbix_get is for agent items. jmx stuff is not agent item. It requires Java GW which performs all those queries. And it is server/proxy which turns to JGW, not agent...
      cyber I use Zorka (https://zorka.io/) for monitoring java based application servers. Zorka acts as zabbix-agent. It works with zabbix_get, for example:
      Code:
      zabbix_get -s 127.0.0.1 -p 19256 -k 'zorka.jmx["java","java.lang:type=Memory","NonHeapMemoryUsage ","committed"]'
      152174592
      I can't get data for Springboot Actuator only.
      Last edited by kmaslowski; 06-09-2021, 13:03.

      Comment

      Working...