Agent Based Monitoring with Director

Hi,

I am trying to monitor a client via the Icinga Agent.
I have configured the server with the director module, but can’t get any checks to run on the client.
I think there is something wrong with the zones/endpoint configuration.
Here is my server configuration, NodeName is set to icingaserver.domain:

object Endpoint NodeName {
host = NodeName
}

object Zone ZoneName {
endpoints = [ NodeName ]
}

object Zone “global-templates” {
global = true
}

object Zone “director-global” {
global = true
}

Here is my agent configuration:

object Endpoint “icingaserver.domain” {
}

object Zone “icingaserver.domain” {
endpoints = [ “icingaserver.domain” ]
}

object Endpoint “icingaagent.domain” {
}

object Zone “icingaagent.domain” {
endpoints = [ “icingaagent.domain” ]
parent = “icingaserver.domain”
}

object Zone “global-templates” {
global = true
}

object Zone “director-global” {
global = true
}

Here is the host config:

zones.d/icingaserver.domain/hosts.conf

object Host “icingaagent.domain” {
import “generic-host”

display_name = "xxxx"
address = "192.168.xx.xx"
vars.os = "other"

}

zones.d/icingaserver.domain/agent_endpoints.conf

object Endpoint “icingaagent.domain” {
host = “192.168.65.33”
log_duration = 0s
}

zones.d/icingaserver.domain/agent_zones.conf

object Zone “icingaagent.domain” {
parent = “icingaserver.domain”
endpoints = [ “icingaagent.domain” ]
}

And this is the check command which I have set up in the director-global zone (for syncing between the endpoints):

object CheckCommand “agent-test-command” {
import “plugin-check-command”
command = [ PluginDir + “/check_disk”, “-w”, “20%”, “-c”, “10%” ]
}

Can someone have a look on the config and give me a hint?

Thanks and regard
Karim

Using director no conf files for zones and endpoint are needed as they are done by the director.

Yes I know, but the configuration I posted is displayed like this in the directors GUI.

Then you don’t need to take care about zones and endpoint as the director is doing a reliable job.

I’d then suspect an issue with your certificates. As a result then agent zone would not be connected, hence, no check would be executed resp. no check result would be processed. I’d recommend to implement a check based on cluster_zone anyway to keep an eye on your zones.

1 Like

[2020-01-10 07:12:18 +0100] information/ApiListener: Reconnecting to endpoint ‘icingaagent.domain’ via host ‘192.168.65.33’ and port ‘5665’
[2020-01-10 07:12:18 +0100] information/ApiListener: New client connection for identity ‘icingaagent.domain’ to [192.168.65.33]:5665
[2020-01-10 07:12:18 +0100] information/ApiListener: Sending config updates for endpoint ‘icingaagent.domain’ in zone ‘icingaagent.domain’.
[2020-01-10 07:12:18 +0100] information/ApiListener: Syncing configuration files for global zone ‘director-global’ to endpoint ‘icingaagent.domain’.
[2020-01-10 07:12:18 +0100] information/ApiListener: Finished sending config file updates for endpoint ‘icingaagent.domain’ in zone ‘icingaagent.domain’.
[2020-01-10 07:12:18 +0100] information/ApiListener: Syncing runtime objects to endpoint ‘icingaagent.domain’.
[2020-01-10 07:12:18 +0100] information/ApiListener: Finished syncing runtime objects to endpoint ‘icingaagent.domain’.

Thank you for your replies. But the connection between the server and the agent is working. It’s just that the command is exucuted on the Icinga server rather than on the client.
Maybe I have to modify the CheckCommand?

You need to define command_endpoint for your service definition means set Run on Agent to true.

Yes this seems to be the problem. But where is the command_endpoint defined?
If I create a service template with the “Run on Agent” option enabled command_endpoint is set to “command_endpoint = host_name”
And if I try to create a host which uses this template I get this error:

Error: Validation failed for object ‘xxxxxxxxxxxxxxx!agent-test-service’ of type ‘Service’; Attribute ‘command_endpoint’: Object ‘xxxxxxxxxxxx’ of type ‘Endpoint’ does not exist.

This is a common error if the host object in the director has no zone configured. Please check.

1 Like