# Command\_endpoint not working

**URL:** <https://community.icinga.com/t/command-endpoint-not-working/13929>\
**Category:** Icinga 2\
**Created:** [July 31, 2024, 7:32am UTC](https://community.icinga.com/t/command-endpoint-not-working/13929 "2024-07-31T07:32:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliware](https://community.icinga.com/letter_avatar_proxy/v4/letter/o/57b2e6/32.png) [@oliware](https://community.icinga.com/u/oliware)\
**Post date:** [July 31, 2024, 7:32am UTC](https://community.icinga.com/t/command-endpoint-not-working/13929/1 "2024-07-31T07:32:45Z")

</div>

version r2.14.2-1  
Typical master/client setup, used the “node wizard” to add my host, keepalive is ok.  
This is an entry in conf.d/hosts/:

```auto

object Host "gbw-s-ssh02.luna.kuleuven.be" {
  import "generic-host"
  address = "10.112.84.78"
  vars.os = "Linux"
  vars.remote_client = name
}

```

This is my section in services.conf:

```auto
apply Service "procs" {
  import "generic-service"

  check_command = "procs"

  command_endpoint = host.vars.remote_client
  assign where host.vars.os == "Linux"
}

```

When I run icinga2 daemon -C, I get:

[2024-07-31 07:31:14 +0000] information/cli: Icinga application loader (version: r2.14.2-1)  
[2024-07-31 07:31:14 +0000] information/cli: Loading configuration file(s).  
[2024-07-31 07:31:14 +0000] information/ConfigItem: Committing config item(s).  
[2024-07-31 07:31:14 +0000] information/ApiListener: My API identity: gbw-s-icinga02.luna.kuleuven.be  
[2024-07-31 07:31:14 +0000] critical/config: Error: Validation failed for object ‘gbw-s-ssh02.luna.kuleuven.be!procs’ of type ‘Service’; **Attribute ‘command\_endpoint’: Object ‘gbw-s-ssh02.luna.kuleuven.be’ of type ‘Endpoint’ does not exist.**  
Location: in /etc/icinga2/conf.d/services.conf: 99:3-99:45  
/etc/icinga2/conf.d/services.conf(97): check\_command = “procs”  
/etc/icinga2/conf.d/services.conf(98):  
/etc/icinga2/conf.d/services.conf(99): command\_endpoint = host.vars.remote\_client  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
/etc/icinga2/conf.d/services.conf(101): assign where host.vars.os == “Linux”  
[2024-07-31 07:31:14 +0000] critical/config: 1 error  
[2024-07-31 07:31:14 +0000] critical/cli: Config validation failed. Re-run with ‘icinga2 daemon -C’ after fixing the config.

Any help or hints?

---

<div class="post-metadata">

**Author:** ![jeanm](https://community.icinga.com/letter_avatar_proxy/v4/letter/j/6a8cbe/32.png) [@jeanm](https://community.icinga.com/u/jeanm)\
**Post date:** [July 31, 2024, 7:48am UTC](https://community.icinga.com/t/command-endpoint-not-working/13929/2 "2024-07-31T07:48:23Z")

</div>

Hi @oliware,

Could it be that your two objects (endpoint and service apply rule) are in different zones that do not see each other?

I usually place all service definitions (and apply rules) in the master zone, visible by all sub-zones.

My two cents,

Jean

---

<div class="post-metadata">

**Author:** ![oliware](https://community.icinga.com/letter_avatar_proxy/v4/letter/o/57b2e6/32.png) [@oliware](https://community.icinga.com/u/oliware)\
**Post date:** [July 31, 2024, 7:54am UTC](https://community.icinga.com/t/command-endpoint-not-working/13929/3 "2024-07-31T07:54:40Z")

</div>

this is my zones.conf:

```auto

object Endpoint "gbw-s-icinga02.luna.kuleuven.be" {
}

object Zone "master" {
	endpoints = ["gbw-s-icinga02.luna.kuleuven.be"]
}

```

This is my entry in zones.d/ :

```auto
object Endpoint "gbw-s-ssh02.luna.kuleuven.be" {
  host = "10.112.84.78"
}

object Zone "gbw-s-ssh02.luna.kuleuven.be" {
  endpoints = ["gbw-s-ssh02.luna.kuleuven.be"]
  parent = "master"
}

```

---

<div class="post-metadata">

**Author:** ![oliware](https://community.icinga.com/letter_avatar_proxy/v4/letter/o/57b2e6/32.png) [@oliware](https://community.icinga.com/u/oliware)\
**Post date:** [July 31, 2024, 8:17am UTC](https://community.icinga.com/t/command-endpoint-not-working/13929/4 "2024-07-31T08:17:03Z")

</div>

I didn’t include the zones.d directory.

Now next error:

[2024-07-31 07:55:49 +0000] information/cli: Icinga application loader (version: r2.14.2-1)  
[2024-07-31 07:55:49 +0000] information/cli: Loading configuration file(s).  
[2024-07-31 07:55:49 +0000] information/ConfigItem: Committing config item(s).  
[2024-07-31 07:55:49 +0000] information/ApiListener: My API identity: gbw-s-icinga02.luna.kuleuven.be  
[2024-07-31 07:55:49 +0000] critical/config: Error: Validation failed for object ‘gbw-s-ssh02.luna.kuleuven.be!procs’ of type ‘Service’; Attribute ‘command\_endpoint’: Checkable with command endpoint requires a zone. Please check the troubleshooting documentation.  
Location: in /etc/icinga2/conf.d/services.conf: 94:1-94:21  
/etc/icinga2/conf.d/services.conf(92): }  
/etc/icinga2/conf.d/services.conf(93):  
/etc/icinga2/conf.d/services.conf(94): apply Service “procs” {  
^^^^^^^^^^^^^^^^^^^^^  
/etc/icinga2/conf.d/services.conf(95): import “generic-service”  
/etc/icinga2/conf.d/services.conf(96):  
[2024-07-31 07:55:49 +0000] critical/config: 1 error  
[2024-07-31 07:55:49 +0000] critical/cli: Config validation failed. Re-run with ‘icinga2 daemon -C’ after fixing the config.

There is something wrong with the zones, but what? It is exactly the same conf files as on my other server icinga01 (version r2.10.5-1 however)

---

<div class="post-metadata">

**Author:** ![MarcusCaepio](https://community.icinga.com/user_avatar/community.icinga.com/marcuscaepio/32/287_2.png) [@MarcusCaepio](https://community.icinga.com/u/MarcusCaepio)\
**Post date:** [July 31, 2024, 8:22pm UTC](https://community.icinga.com/t/command-endpoint-not-working/13929/5 "2024-07-31T20:22:30Z")

</div>

Hi,  
as soon as you are using distributed monitoring setups, you have to use the zones.conf and zones.d/ directory. Normally due to a node wizard setup you are also asked, if you want to disable the conf.d directory.  
So rule of thumb is:

- Icinga single node → conf.d
- Icinga distributed setup → zones.d  
So try to move the stuff from conf.d to zones.d/master
