思考2​​:变量在display_name?

Icinga 2: variable in display_name?

是否可以在 Icinga2 配置中将变量传递给 display_name,例如对于服务:

apply Service for (disk_name => config in host.vars.disks) to Host {
  import "generic-service"
  vars = vars + config
  display_name = "disk" //TODO: pass hdd name?
  check_command = "disk"
}

是的。

apply Service for (disk_name => config in host.vars.disks) to Host {
  import "generic-service"
  vars = vars + config
  display_name = disk_name
  check_command = "disk"
}