On a host, there is two Java app runing, exposing JMX data (App 1 : JBoss Wildfly. App2 : Apache Tomcat)
I set up two JMX interfaces in the Host config on the Zabbix server. Now, I want to create some items that will get the JVM data? e.g :
jmx["java.lang:type=ClassLoading",LoadedClassCount]
I can't create two items with the same key. How can I by-pass this contol ?
Short answer: there is no solution for this.
Long answer:
Due to a bug https://support.zabbix.com/browse/ZBXNEXT-4677 , Zabbix does not handle multiple interfaces of the same type properly. If one of the interfaces is unavailable (like a JVM being slow or down), Zabbix stops monitoring other interfaces of the same type.
You can manually edit items to make keys different - for example, adding a space after that comma would make the key different, but it would work the same way still. Of course, that completely defeats templating and is not sustainable beyond a couple of items.
You can hack Java gateway to ignore the third parameter. This way LLD can place port as the third parameter (and also in the JMX URL), making the keys unique.
https://support.zabbix.com/browse/ZBXNEXT-4510 asked for the change to be included in the gateway, but was rejected.
These feature requests might solve your need, but the best you can do is vote on them.