Icinga2:将服务应用于主机组中的每个主机的虚拟主机

Icinga2:将服务应用于主机组中的每个主机的虚拟主机

我有一系列 Web 服务器 (WS1、WS2 和 WS3),它们属于 HostGroup“my-web-servers”。

每个 Web 服务器都有几个虚拟主机:

  • WS1 有 example1.org 和 example2.org。
  • WS2 有 example3.org、example4.org 和 example5.org。
  • WS3 有 example6.org。

我想向主机组中每个主机的所有虚拟主机应用一项服务(check_http,它将检查 SSL 证书是否过期)。

我该如何写这份assign where声明?

我目前拥有的:

apply Serivce "SSL Certificate" for (host => value in hostgroup.hosts) {
  import "active-service-HARD-1day"
  check_command "check_ssl_cert"

  assign where host.var.vhosts
}

相关内容