[ZBX-13682] jmx discovery appear error "Cannot create item: item with the same key ..." Created: 2018 Apr 02  Updated: 2018 Apr 03  Resolved: 2018 Apr 03

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Java gateway (J)
Affects Version/s: 3.4.7
Fix Version/s: None

Type: Incident report Priority: Major
Reporter: majun Assignee: Unassigned
Resolution: Workaround proposed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File zabbix_server.log     PNG File zbx_error1.png     PNG File zbx_error2.png     PNG File zbx_error3.png    

 Description   

jmx discovery appear error "Cannot create item: item with the same key ..."

i think discovery do not need this error



 Comments   
Comment by Andrei Gushchin (Inactive) [ 2018 Apr 02 ]

Key should be unique by a host. So it seems item prototype is not correct and creates duplicates what is forbidden.
Please review the prototype.
Not I'm closing this as WON'T FIX.

Comment by richlv [ 2018 Apr 02 ]

majun, are you attempting to discover multiple JVMs on the same host by any chance ?

Comment by majun [ 2018 Apr 02 ]

I not attempting to discover multiple JVMs on the same host.
i just want to discovery this jvm different ThreadPool name,
so i create a jvm lld. jmx.discovery[attributes,"*:type=ThreadPool,name=*"]
and create two Item prototypes jmx[{#JMXOBJ},currentThreadCount] and jmx[{#JMXOBJ},maxThreads].
there is no other items in this host.

two Item prototypes data is normal. just jmx discovery appear error "Cannot create item: item with the same key ..."
I can't find out where the problem is.

Comment by majun [ 2018 Apr 02 ]

I not attempting to discover multiple JVMs on the same host.
i just want to discovery this jvm different ThreadPool name,
so i create a jvm lld. jmx.discovery[attributes,"*:type=ThreadPool,name=*"]
and create two Item prototypes jmx[

{#JMXOBJ},currentThreadCount] and jmx[{#JMXOBJ}

,maxThreads].
there is no other items in this host.

two Item prototypes data is normal. just jmx discovery appear error "Cannot create item: item with the same key ..."
I can't find out where the problem is.

Comment by Andrei Gushchin (Inactive) [ 2018 Apr 02 ]

Please increase log level for java pollers and grab from the output the JSON which is used for jmx.discovery[attributes,"*:type=ThreadPool,name=*"]. I think there are some duplicates.

Comment by majun [ 2018 Apr 02 ]

if we can use zabbix_get to check it , and What is the format of the command。

Comment by Andrei Gushchin (Inactive) [ 2018 Apr 02 ]

No zabbix_get not help here. Only parse debug log.

Comment by majun [ 2018 Apr 02 ]

my zabbix_java and zabbix_server is in a host and i not found Increase the log level configuration option in settings.sh.

if edit increase log level for java pollers in zabbix_server.conf files?

Comment by Alexander Vladishev [ 2018 Apr 03 ]

majun, you should increase log level of the zabbix_server.

To increase log level in run time mode you can use zabbix_server option -R. For example: zabbix_server -R log_level_increase=java\ poller

Comment by majun [ 2018 Apr 03 ]

thank you. but i not found error in log.
i will attach my log, please check it.

Comment by Andrei Gushchin (Inactive) [ 2018 Apr 03 ]

This not fit to initial problem.

 59117:20180403:102003.886 JSON before sending [{"request":"java gateway jmx","jmx_endpoint":"service:jmx:rmi:///jndi/rmi://11.8.44.146:8449/jmxrmi","keys":["jmx.discovery[Catalina,\"*:type=ThreadPool,name=*\"]"]}]
59117:20180403:102003.898 JSON back [{"response":"success","data":[{"error":"invalid discovery mode: Catalina"}]}]

Which error do you have for this rule?

Comment by Glebs Ivanovskis (Inactive) [ 2018 Apr 03 ]

Based on example outputs of jmx.discovery from the documentation I can make a conclusion that {#JMXOBJ} is not necessarily unique. Therefore your discovery rule tries to create multiple items with same keys. I think you should have a single item prototype jmx[{#JMXOBJ},{#JMXATTR}] and leave only {#JMXATTR} equal to currentThreadCount or maxThreads using LLD filters.

Comment by majun [ 2018 Apr 03 ]

ok i will try it.
we can close this case.

Comment by Glebs Ivanovskis (Inactive) [ 2018 Apr 03 ]

Changing resolution to Workaround proposed.

Generated at Fri Apr 04 18:46:16 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.