Host always in pending status

Hi,

I have a host that’s always in pending status. The host config is similar to the other hosts that I have except that there is no icinga2 agent installed on that PC. I can’t figure out what am I missing. Here are the config files:

**/etc/icinga2/zone.d/host1.domain/hosts.conf**
        object Host "host1.domain" {
    check_command = "hostalive"
    address = "192.168.0.1"
    }
}
**/etc/icinga2/zone.conf**
    object Endpoint "icinga2.domain" {
}

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

object Endpoint "host1.domain" {
        host = "192.168.0.1"
}

object Zone "host1.domain" {
       endpoints = [ "host1.domain" ]
        parent = "master"
}

What’s interesting is that if I move the “/etc/icinga2/zone.d/host1.domain” directory to “/etc/icinga2/zone.d/master/” directory, the host comes up but then I have another problem that the cluster check always reports the host as down.

Any idea?

Hi,

It seems that it has something to do with the fact that the icinga2 client isn’t installed on the monitored PC. Does “hostalive” only work when the client is installed?

Thanks

No - at least - not on the machine being monitored. It obviously needs to be
installed on the machine doing the monitoring.

https://icinga.com/docs/icinga2/latest/doc/10-icinga-template-library/
#plugin-check-command-hostalive

Hostalive simply uses ping checks to see if a machine is contactable, that’s
all.

Antony.

Hello and welcome :slight_smile:
If the agent is not installed you don’t need to (or better must not) define an endpoint and a zone.
This is only necessary for hosts where Icinga 2 is installed, so that the instances can communicate directly.

So simply remove the endpoint and zone for the non-agent host, move it to the zones.d/master folder and delete the check for that hosts cluster-zone.

OR
Install the agent on the host and connect it to the master.
If you do that you need to install the check plugins, because then the checks are executed on the agent.

PS: In future posts please use markdown formatting to get a better readability when posting config snippets. A HowTo can be found here
Thanks :slight_smile: