Icinga2: Master, Satellite and Clients: Endpoints definition

This forum was archived to /woltlab and is now in read-only mode.
  • Trying to have an installation with a satellite, and 3 clients of the satellite (and 60+ clients of the master, no issue there).


    Get this on the master if I DO NOT define the endpoints there:


    critical/config: Error: Validation failed for object 'satellite.example.com' of type 'Zone'; Attribute 'endpoints': Object 'satellite.example.com' of type 'Endpoint' does not exist.
    Location: in /etc/icinga2/zones.conf.d/satellite.example.com.conf: 2:2-2:37
    /etc/icinga2/zones.conf.d/satellite.example.com.conf(1): object Zone "satellite.example.com" {
    /etc/icinga2/zones.conf.d/satellite.example.com.conf(2): endpoints = [ "satellite.example.com" ]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    /etc/icinga2/zones.conf.d/satellite.example.com.conf(3): parent = "master.example.com"
    /etc/icinga2/zones.conf.d/satellite.example.com.conf(4): }



    critical/config: Error: Validation failed for object 'client1.example.com' of type 'Zone'; Attribute 'endpoints': Object 'client1.example.com' of type 'Endpoint' does not exist.
    Location: in /etc/icinga2/zones.conf.d/client1.example.com.conf: 2:2-2:49
    /etc/icinga2/zones.conf.d/client1.example.com.conf(1): object Zone "client1.example.com" {
    /etc/icinga2/zones.conf.d/client1.example.com.conf(2): endpoints = [ "client1.example.com" ]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    /etc/icinga2/zones.conf.d/client1.example.com.conf(3): parent = "satellite.example.com"
    /etc/icinga2/zones.conf.d/client1.example.com.conf(4): }



    critical/config: Error: Validation failed for object 'client2.example.com' of type 'Zone'; Attribute 'endpoints': Object 'client2.example.com' of type 'Endpoint' does not exist.
    Location: in /etc/icinga2/zones.conf.d/client2.example.com.conf: 2:2-2:49
    /etc/icinga2/zones.conf.d/client2.example.com.conf(1): object Zone "client2.example.com" {
    /etc/icinga2/zones.conf.d/client2.example.com.conf(2): endpoints = [ "client2.example.com" ]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    /etc/icinga2/zones.conf.d/client2.example.com.conf(3): parent = "satellite.example.com"
    /etc/icinga2/zones.conf.d/client2.example.com.conf(4): }



    critical/config: Error: Validation failed for object 'client3.example.com' of type 'Zone'; Attribute 'endpoints': Object 'client3.example.com' of type 'Endpoint' does not exist.
    Location: in /etc/icinga2/zones.conf.d/client3.example.com.conf: 2:2-2:49
    /etc/icinga2/zones.conf.d/client3.example.com.conf(1): object Zone "client3.example.com" {
    /etc/icinga2/zones.conf.d/client3.example.com.conf(2): endpoints = [ "client3.example.com" ]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    /etc/icinga2/zones.conf.d/client3.example.com.conf(3): parent = "satellite.example.com"
    /etc/icinga2/zones.conf.d/client3.example.com.conf(4): }


    And get this on the satellite if I DO define the (satellite) endpoint in the master, when restarting client:


    information/cli: Icinga application loader (version: r2.5.4-1
    information/cli: Loading configuration file(s).
    critical/config: Error: Object 'satellite.example.com' of type 'Endpoint' re-defined: in /var/lib/icinga2/api/zones/satellite.example.com/_etc/endpoints/satellite.example.com.conf: 1:0-1:35; previous definition: in /etc/icinga2/zones.conf: 16:1-16:24
    Location: in /var/lib/icinga2/api/zones/satellite.example.com/_etc/endpoints/satellite.example.com.conf: 1:0-1:35
    /var/lib/icinga2/api/zones/satellite.example.com/_etc/endpoints/satellite.example.com.conf(1): object Endpoint "satellite.example.com" {
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    /var/lib/icinga2/api/zones/satellite.example.com/_etc/endpoints/satellite.example.com.conf(2): }
    /var/lib/icinga2/api/zones/satellite.example.com/_etc/endpoints/satellite.example.com.conf(3):



    How can this be fixed?


    Thanks,
    Gerardo

  • some simple questions first.
    what icinga2 version are you using?
    how do you add your config, by hand, via director?

    Linux is dead, long live Linux


    Remember to NEVER EVER use git repositories in a productive environment if you CAN NOT control them

  • Version is 2.5.4 everywhere.


    Configuration is added by hand to zones.d.


    Can go by deleting /var/lib/icinga2/api/zones/* in satellite before restarting, don't think that is correct though.


    In that case, the hosts/services in the satellite zone (and children) are forever pending.


    Thanks,
    Gerardo

  • Can you post the config file where you define the Endpoint and Zone for satellite and client?


    Have a look at icinga docs, this is a similar example to yours: https://docs.icinga.com/icinga…s-master-satellite-client


    First, you need to define an endpoint and a zone for a satellite in /etc/icinga2/zones.conf on master and define clients endpoint and zone (with satellite parent) on you client


    Then you need to define the zone and endpoint of your client in /etc/icinga2/zones.d/satellite


    After that, you can make client host and services definition for you client in /etc/icinga2/zones.d/satellite


    Do not define satellite zone and endpoint in /etc/icinga2/zones.d/satellite folder.


    I would recommend you to delete the files from /var/lib/icinga2/api/zones/ because icinga2 has some troubles updating those files, specially if you delete a folder from /etc/icinga2/zones.d/.


    Regards, Anton.

  • Aha! Had the Endpoints defined in their own file.


    So, added a zones.conf.d directory (not to modify the zones.conf file), modified the icinga2.conf file to include it.
    Two files there, satellite.example.com.conf and global-templates.conf.


    Code
    1. object Endpoint "satellite.example.com" {
    2. }
    3. object Zone "satellite.example.com" {
    4. endpoints = [ "satellite.example.com" ]
    5. parent = "master.example.com"
    6. }




    In zones.d/satellite.example.com, there is hosts.conf:

    Code
    1. object Host "satellite.example.com" {
    2. import "satellite-host"
    3. check_command = "cluster-zone"
    4. address = name
    5. }

    and zones directory with files: client[1-3].example.com.conf

    Code
    1. object Endpoint "client1.example.com" {
    2. }
    3. object Zone "client1.example.com" {
    4. endpoints = [ "client1.example.com" ]
    5. parent = "satellite.example.com"
    6. }

    and with the subdirectories: client[1-3].example.com, each with its own hosts.conf:

    Client[23] have the same configuration. global-templates have apt.conf, satellite.conf, services.conf and templates.conf lifted from conf.d, which is disabled everywhere.


    This mostly works, including the services in satellite and client[1-3] (and many other clients living in the master zone).


    Thank you very much,
    Gerardo


    P.S. There is a problem still. I think it is unrelated, so will open a different thread