简体   繁体   English

使用元数据的Zabbix自动注册失败,并显示“无法链接模板”错误消息

[英]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: 我有一台具有特定元数据值(linuxhosts)的Linux主机,该主机已在zabbix_agentd.conf中设置。我还使用以下配置通过自动注册事件源设置了一个Action:

Conditions: Host metadata like linuxhosts 条件:主机元数据,例如linuxhosts

Operations: Add to host groups SystemTestLinux Link to template Linux system test template 操作:添加到主机组SystemTestLinux链接至模板Linux系统测试模板

The issue is that the host is not being linked to "Linux system test" template. 问题是主机未链接到“ Linux系统测试”模板。 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 . 查看zabbix_server.log时,看到以下错误: 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. 模板“ Linux系统测试”未链接到任何其他模板,并且我未启用任何发现规则。 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. 还需要注意的是,我目前有很多可以很好地链接到模板的Windows主机,问题仅出现在Linux主机上。

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. 问题是Zabbix无法处理两个非常相似的元数据字符串,这些字符串将每个代理链接到其适当的组和模板。

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. 例如,如果您有一个代理报告“ productionDev”,而另一个代理报告“ productionDevOps”,那么您可能最终会遇到与我同样的问题。 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. 要变通解决此问题,您将需要为每个自动注册操作具有两个条件:像“ productionDev”而不像“ productionDevOPS”这样,这将确保您的“ productionDev”代理将加入其适当的组和模板。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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