Agent zones and host checks from Master zone

(Mark Reynolds) #1

Hi,

I am trying to set up a master zone ( with 2 icinga masters ) and multiple agents ( in their own zones ). It’s mostly working fine but it would appear that the host check command for an agent is running on the agent not from the master. So if the agent instance stops the check stays in an ok state and never gets updated. Is it possible to have the host check command run from the master and not from the agent itself? I was using a custom host check for check_tcp port 5665 as ping isn’t available.

As an example ( I’ve redacted host details and some entries ) -

object Zone “agent1” {
endpoints = “[ agent1.mydomain.com ]”
parent = “master”
}

object Host “agent1.mydomain.com” {
import “linux-host”
address = “192.168.2.1”
display_name = “agent1”
zone = “agent1”
vars.cluster_zone=“agent1”
vars.os = “Linux”
}

and in global-templates I have

object CheckCommand “icinga2-service” {
command = [ PluginDir + “/check_tcp” ]
arguments = {
“-H” = “$address$”
“-p” = “5665”
}
}

template Host “generic-host” {
max_check_attempts = 10
check_interval = 1m
retry_interval = 1m

check_command = “icinga2-service”
}

I can understand the problem, the check is running from the wrong place, but I dont know how to change that for a host check as its not a normal service definition. I’ve removed the master zone config as the forum is treating hostnames as links and wont let me post more than 2.

Any guidance greatly appreciated.

Mark

#2

Check the command_endpoint argument for the host and service objects.

(Mark Reynolds) #3

Thank you, I’ll have a look at setting the command endpoint for the host check though can a command endpoint include 2 hosts or a zone? ( i.e. I want either of the master hosts to be able to monitor the agents. I’ll try adding one for now and see that happens.

Thanks again,

Mark