简体   繁体   中英

Zabbix auto registration using metadata fails with a “cannot link template(s)” error message

I have a Linux host with a specific metadata value (linuxhosts) which I have set in the zabbix_agentd.conf I also set an Action with an auto registration event source with the following configuration:

Conditions: Host metadata like linuxhosts

Operations: Add to host groups SystemTestLinux Link to template Linux system test template

The issue is that the host is not being linked to "Linux system test" template. Looking at zabbix_server.log, I see the following error: cannot link template(s) "Linux system test" to host "xxxxx": conflicting item key "net.if.discovery" found . The template "Linux system test" is not linked to any other template and I do not have any discovery rule enabled. It is also important to note that I currently have a lot of Windows hosts that are linking fine to templates, the problem only occurs with Linux hosts.

The problem was solved with a workaround. The issue is that Zabbix was unable to handle two very similar metadata strings that linked each agent to its appropriate group and template.

For example, if you have one agent reporting "productionDev" and another agent reporting "productionDevOps" you might end up having the same issue that I have. To work around the issue, you will need to have two conditions for each auto registration action: like "productionDev" notlike "productionDevOPS" This will make sure that your "productionDev" agents will join their appropriate groups and templates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM