[ZBX-21162] Issue with monitoring multiple kubernetes/openshift clusters Created: 2022 Jun 03  Updated: 2022 Sep 27  Resolved: 2022 Sep 27

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Templates (T)
Affects Version/s: 6.0.5
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Rudolf Kastl Assignee: Elina Kuzyutkina (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

RHEL 8


Issue Links:
Duplicate
duplicates ZBXNEXT-7739 Possibility to add host discovered wi... Open
duplicates ZBX-21172 Add preferably cluster name in host g... Closed

 Description   

Steps to reproduce:

  1. Configure Kubernetes monitoring on multiple OpenShift clusters (openshift 4.6 works great btw)
  2. We enabled the proxies with the helm/monitoring setup because zabbix lives outside of OpenShift
  3. The first cluster will discover its nodes and add them to the respective Kubelet, Worker and Master groups
  4. The second and higher cluster discovers the nodes but does not add them to the kubelet worker and master groups.
  5. Error message: Cannot create group: group with the same name [insert kubelet, worker or master group here] already exists.

Result:

Detected nodes are only getting added to the correct host groups with the first cluster monitored.

Expected:
Ideally we either have a different group used based on cluster name or proxy name or configureable by template macro.

 

Workaround:

The only alternative currently is to create copies of the templates for each individual cluster and adjust the groupnames in the copies of the templates.



 Comments   
Comment by Alexey Pustovalov [ 2022 Jun 03 ]

Dear Rudolf,

Could you show us exact error message you seen?

Comment by Rudolf Kastl [ 2022 Jun 03 ]

Cannot create group: group with the same name "Kubernetes/Nodes/Role: master" already exists.

Cannot create group: group with the same name "Kubernetes/Nodes/Role: worker" already exists.

^^ this is taken from a "red exclamation mark" next to: Node LLD: Cluster node discovery

The host prototype for this rule actually has a group prototype "Kubernetes/Nodes/Role: {#ROLES}". 

Comment by Elina Kuzyutkina (Inactive) [ 2022 Jun 03 ]

Hi,
The LLD rule actually checks that the group was created by the same LLD rule. You can fix the situation by adding in the group name, for example, the name of the cluster {HOST.NAME}: Kubernetes/Nodes/Role: {#ROLES}
I will clarify if there are any blocking reasons to remove the check that the group from the prototype was created by this particular rule. But I assume that it's about deleting objects (when entities associated with this group are no longer discovered by specific rule)

Regards, Elina

Comment by Rudolf Kastl [ 2022 Jun 03 ]

Elina, I like your idea of adding the Cluster Name into the group Name because that makes handling of a larger amount of clusters more easy and it looks more tidy. But this is not working since that variable is not allowed to be used with group prototypes. If i try to save that change i get: 

  • Error in query [DELETE FROM group_prototype WHERE group_prototypeid='130'] [Cannot delete or update a parent row: a foreign key constraint fails (`zabbix`.`group_discovery`, CONSTRAINT `c_group_discovery_2` FOREIGN KEY (`parent_group_prototypeid`) REFERENCES `group_prototype` (`group_prototypeid`))]
  • SQL statement execution has failed "DELETE FROM group_prototype WHERE group_prototypeid='130'"
Comment by Elina Kuzyutkina (Inactive) [ 2022 Jun 03 ]

Please give me some time I'll try to reproduce this

Comment by Elina Kuzyutkina (Inactive) [ 2022 Jun 03 ]

Can you check which host group has id 130? (you can simply find it in the address bar when Host group configuration window is open)

Comment by Rudolf Kastl [ 2022 Jun 03 ]

https://...hostgroups.php?form=update&groupid=130

No permissions to referred object or it does not exist!

Comment by Elina Kuzyutkina (Inactive) [ 2022 Jun 06 ]

Hi,
ZBXNEXT-7739 (Possibility to add host discovered with host prototypes to an existing group via group prototype) You can vote and comment if you are interested in this

I can't reproduce the error with the group. You can now describe the sequence of your actions - this will simplify the task

Comment by Elina Kuzyutkina (Inactive) [ 2022 Jun 06 ]

{HOST.HOST} or {HOST.NAME} really won't work here. I have created ZBX-21172 so that we find the option convenient to automate host group creation in the template.
Now as an option, you can add to the group name or cluster name explicitly or through a User macro (which must be defined on each parent host)

By error of deleting a group, I can’t reproduce it in any way - I at least need that order of actions you have done (adding hosts, linking-unlinking a template, deleting-adding groups, etc).

Comment by Rudolf Kastl [ 2022 Jun 07 ]

The "deletion" is not really a "deletion" in the sense of trying to delete a group. It just happens if i add the {HOST.NAME} to the group prototype and try to save it. Thanks for opening the new bug! Thank you for looking into the problem!

Comment by Elina Kuzyutkina (Inactive) [ 2022 Jun 08 ]

Hi,
yes, I understand that it can be not really deletion - but in any case, there shouldn't be any 'constraint fails'. But i can't catch the same error (I was trying to reproduce in several ways) Creating LLDs that used same group created from the prototype on same host and on different ones. There is no error when i change group name.
Is this error still reproducible on your instance?

Comment by Rudolf Kastl [ 2022 Jun 13 ]

Hi Elina,

Sorry for the late reply, actually i had time to toy a bit with changing the group prototype with the host prototype. For some reason i can not change to anything else even adding some simple "test" string to the actual group name does not work. I was able to change it some point, before i had added the template to the hosts and it discovered nodes. Hope this helps.

Generated at Tue Jul 01 07:39:15 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.