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

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:
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?
I'm trying to monitor a set of java applications which expose some metrics via Spring-Actuator endpoint.
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);
}
}
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?
Comment