Multiple services in Host Template

Good day!

I’m newbie in the Icinga world and after trying to understand the documentation i’m here to ask you.

Is it possible to create some kind of “template Host” to import few services?

I’m trying to use this configuration, Icinga2 daemon -C accepts it but nothing happens and I cannot see the services being monitored.

Template.conf
template Host "domain-controller" {
  max_check_attempts = 3
  check_interval = 1m
  retry_interval = 30s

  check_command = "disk-windows"
    vars.disk_win_path = "C:"
    vars.disk_win_show_used = "true"
    vars.disk_win_warn = "80%"
    vars.disk_win_crit = "90%"
  check_command = "load-windows"
    vars.load_win_warn = "80%"
    vars.load_win_crit = "90%"
  check_command = "memory-windows"
    vars.memory_win_warn = "70%"
    vars.memory_win_crit = "80%"
    vars.memory_win_unit = "gb"
    vars.memory_win_show_used = "true"
  check_command = "procs-windows"
    vars.procs.win_user = "true"
  check_command = "service-windows"
    vars.service_win_service = "NTDS"
    vars.service_win_description = "Active Directory Service"
    vars.service_win_crit = "true"
}
Host.conf"
object Host "adc1" {
  import "domain-controller"
  check_command = "hostalive"
  address = "x.x.x.x"
  vars.agent_endpoint = name
  vars.os = "windows"
  vars.notification["mail"] = {
    groups = [ "Administrators" ]
  }
  vars.server_type = "domain controller"
}

object Host "adc2" {
  import "domain-controller"
  check_command = "hostalive"
  address = "x.x.x.x"
  vars.agent_endpoint = name
  vars.os = "windows"
  vars.notification["mail"] = {
    groups = [ "Administrators" ]
  }
  vars.server_type = "domain controller"
}
  • Version used - icinga2 - The Icinga 2 network monitoring daemon (version: r2.13.3-1)
  • Operating System and version - Centos 7.9.2009 (Core)
  • Enabled features - Enabled features: api checker debuglog ido-mysql mainlog
  • Icinga Web 2 version and modules - Icinga Web 2 Version 2.10.1
  • Config validation (icinga2 daemon -C):
icinga2 daemon -C"
[2022-06-14 16:56:04 +0200] information/cli: Icinga application loader (version: r2.13.3-1)
[2022-06-14 16:56:04 +0200] information/cli: Loading configuration file(s).
[2022-06-14 16:56:04 +0200] information/ConfigItem: Committing config item(s).
[2022-06-14 16:56:04 +0200] information/ApiListener: My API identity: pantera
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 1 UserGroup.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 3 TimePeriods.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 1 User.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 10 Services.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 6 Zones.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 2 NotificationCommands.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 14 Notifications.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 4 Hosts.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 4 HostGroups.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 4 Endpoints.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 2 FileLoggers.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 2 ApiUsers.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 244 CheckCommands.
[2022-06-14 16:56:04 +0200] information/ConfigItem: Instantiated 1 ApiListener.
[2022-06-14 16:56:04 +0200] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2022-06-14 16:56:04 +0200] information/cli: Finished validating the configuration file(s).
  • If you run multiple Icinga 2 instances, the zones.conf file (or icinga2 object list --type Endpoint and icinga2 object list --type Zone) from all affected nodes

Here you have the zones.conf file:

Zones.conf
/*Endpoints*/

object Endpoint "master" {
        host = "x.x.x.x"
}

object Endpoint "printer" {
        host = "x.x.x.x"
        log_duration = 0
}
object Endpoint "adc1" {
        host = "x.x.x.x"
}

object Endpoint "adc2" {
        host = "x.x.x.x"
}

/*Zones*/

object Zone "master" {
        endpoints = [ "master" ]
}

object Zone "printer" {
        endpoints = [ "printer" ]
        parent = "master"
}

object Zone "adc1" {
        endpoints = [ "adc1" ]
        parent = "master"
}

object Zone "adc2" {
        endpoints = [ "adc2" ]
        parent = "master"
}

/* Zonas Globales */
object Zone "global-templates" {
        global = true
}

object Zone "director-global" {
        global = true
}

This is my first post, hope no my last and sorry if any information is missing or incorrect.
And Thanks in advance!