大网数据广告活动
服务器运维问答

Is it possible to assign a default template for every new host in Zabbix?

· 52CE 我爱测

So I have some custom templates on my zabbix that I would like to assign to every new host as soon as it gets added, does anyone know if that's possible? So far, from testing and reading from the zabbix forums, my answer is no bu…

问题原文

原帖链接 · sysfiend · CC BY-SA 3.0

So I have some custom templates on my zabbix that I would like to assign to every new host as soon as it gets added, does anyone know if that's possible?
So far, from testing and reading from the zabbix forums, my answer is no but would like to be sure before getting into work with the API again.

已采纳解答

原帖链接 · Richlv · CC BY-SA 3.0

It depends on how the way hosts are added.

  1. if the hosts are added via the network discovery or active agent auto-registration, the same actions that add the hosts can also link them to templates;
  2. if the hosts are added manually or via the API, you would indeed have to use the host.update API method

Based on your comment, the hosts are imported from XML, and specifying the template in the XML doesn't work. That is a separate problem, though - you should doublecheck that the template technical name (not visible name) matches exactly (it is case sensitive). Also make sure the user importing the XML is superadmin, otherwise permissions can make everything much more tricky.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-06-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。