Attribute 'zone': Object * of type 'Zone' does not exist

Hi all,
for my education to IT-Specialist, for my final project i choose to set up Network Monitoring, using Icinga2 in a small Company Network.
I just aim to have one master checking about 10 different Windows Server and Switches.
I’m having a hard time realising this.

My current issue is the following error

[2020-10-22 11:22:54 +0200] information/cli: Icinga application loader (version: r2.12.0-1)
[2020-10-22 11:22:54 +0200] information/cli: Loading configuration file(s).
[2020-10-22 11:22:54 +0200] information/ConfigItem: Committing config item(s).
[2020-10-22 11:22:54 +0200] critical/config: Error: Validation failed for object 'DC01' of type 'Zone'; Attribute 'zone': Object 'icinga2' of type 'Zone' does not exist.
Location: in [stage]/zones.d/icinga2/agent_zones.conf: 1:0-1:17
[stage]/zones.d/icinga2/agent_zones.conf(1): object Zone "DC01" {
                                             ^^^^^^^^^^^^^^^^^^
[stage]/zones.d/icinga2/agent_zones.conf(2):     parent = "icinga2"
[stage]/zones.d/icinga2/agent_zones.conf(3):     endpoints = [ "DC01" ]

[2020-10-22 11:22:54 +0200] critical/config: 1 error
[2020-10-22 11:22:54 +0200] critical/cli: Config validation failed. Re-run with 'icinga2 daemon -C' after fixing the config.

icinga2 ist the Hostname of my Master… i dont think i ever said icinga2 should be a zone…

the agent_zones.conf file says

zones.d/icinga2/agent_zones.conf
object Zone "DC01" {
    parent = "icinga2"
    endpoints = [ "DC01" ]
}

i think parent should be “master”, right?
i tried to write in the file manually, but after deploy parent is icinga2 again

this error also occures when i try to add users

I’m using director 1.7.2

What am i doing wrong?

peace…
Ronny

Hi and welcome,

in this case it would be interesting to see your zones.conf from the nodes.

Zones and endpoint object are only allowed to be defined in zones.conf since V2.11.

Hi Stevie,
thanks for your reply.

at the mment im testing with just one windows node.

zones.conf there says

/*
 * Generated by Icinga 2 node setup commands
 * on 2020-10-21 13:44:43 +0200
 */

object Endpoint "icinga2" {
	host = "192.168.2.113"
	port = "5665"
}

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

object Endpoint "Client01" {
}

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

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

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

That after i installed and connected the Icinga2-v2.12.0-x86_64 agent on the node… maybe i konfigured smtn wrong in that process?

Hi Roland,
thanks for your reply too…

zones.conf on the master or at the agent?
at the master it says

/*
 * Generated by Icinga 2 node setup commands
 * on 2020-10-22 11:17:53 +0200
 */

object Endpoint "icinga2" {
}

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

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

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

something wrong here?

I think it’s the hint from @rsx! the filename is zones.conf!

Yes, your client is missing.

Here I miss this from your entry post

zones.d/icinga2/agent_zones.conf
object Zone "DC01" {
    parent = "icinga2"
    endpoints = [ "DC01" ]
}

BTW: I never tested it, but if you change the filename, be sure you include the correct filename in icinga2.conf!

These is a small cutout from our icinga2.conf where this is defined:

/**
  • Icinga 2 configuration file
    • this is where you define settings for the Icinga application including
  • which hosts/services to check.
  • For an overview of all available configuration options please refer
  • to the documentation that is distributed as part of Icinga 2.
    */

/**

  • The constants.conf defines global constants.
    */
    include “constants.conf”

/**

  • The zones.conf defines zones for a cluster setup.
  • Not required for single instance setups.
    */
    include "zones.conf"

/**

  • The Icinga Template Library (ITL) provides a number of useful templates
  • and command definitions.
  • Common monitoring plugin command definitions are included separately.
    */
    include
    include
    include
    include

oks… i tried to add the Client01 (agent side) into /etc/icinga2/zones.conf on the master
in any way i could think of, with the result of various error messages :woozy_face:
how would the /etc/icinga2/zones.conf look exactly with the added Client01? :blush:

what makes me wonder, is that i have another icinga2 master, which doesnt produce the “Object ‘icinga2’ of type ‘Zone’ does not exist.” error.

there the agent_zones.conf file says

zones.d/master/agent_zones.conf
object Zone "Client01" {
    parent = "master"
    endpoints = [ "Client01" ]
}

intead of

zones.d/icinga2/agent_zones.conf
object Zone "Client01" {
    parent = "icinga2"
    endpoints = [ "Client01" ]
}

as it does on the error-master

/etc/icinga2/zones.conf looks exactly the same on them both

   object Endpoint "icinga2" {
}

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

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

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

I also never wrote smtn manually in any config file at the working master

the only difference i see is parent = “master” on the working Icinga vs parent = “icinga2”
why are they behaving different… the only ting i can think of, there must be another file containing an error, no?

im sorry… i know its a mess and im not really know what im doin here… but i really need to make it work and your help is very appreciated

Here I miss this from your entry post

zones.d/icinga2/agent_zones.conf
object Zone “DC01” {
parent = “icinga2”
endpoints = [ “DC01” ]
}

there i mixed up my clients… it should be Client01, not DC01

Are you using the director? Then you don’t need to manually add zone and endpoint objects to zones.conf.

You have one misconfiguration: Your client looks for icinga2 as its parent but your zones.confat your master shows master as zone name.

Thanks Roland, yes i use director
i changed

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

to

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

works for now…

still wondering why the same agent is looking for master on the one, but for icinga2 on the other master… i have a feeling, i should rather change this behavior, than writing in /etc/icinga2/zones.conf
…dunno how/where

After changing zones.conf you need to run kickstart wizard in director.

i found something
i load an older snapshot to test this

director shows zone icinga2 but in zones.conf is…

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


after kickstart, director also shows zone named master now instead of icinga2… now the agent_zones.conf file also has

zones.d/master/agent_zones.conf
object Zone "Client01" {
    parent = "master"
    endpoints = [ "Client01" ]
}

and adding host works…
so in my case either changing zones.conf to match director or execute kickstart wizard to make director match zones.conf was the solution

Thank you all, especially Roland :+1: