Issues with Agent check on remote linux machine

Hello, Iv´e gotten agent checks on windows machine to work without any issues but i am getting problems with linux. In director the check doesn´t execute at all. Lets start from the beginning

I downloaded a basic systemd service check. Placed it under usr/lib/nagios/plugins on both machines which seems to be default.

I ran the node wizard on the client machine
I created a Zone folder in zones.d with the master name
inside the folder i created a .conf file with the following settings

object Endpoint “client name” {
}

object Zone “client name” {
endpoints = [ “client name” ]
parent = “master name”
}

It works using the daemon check, seems to be included cause I tested scenarios where it wouldn´t be included

What happens when I choose Agent on the check in the service is that the check will not execute. The counter just elapses with time. If I remove the setting run on agent the check will say that the service isn´t available (which it isn´t on the master server)

image

Zone and endpoint object needs to placed in “main” zones.conf only.

1 Like

Thanks Roland, i have changed it, config passed verificatiion although i cannot press the check now on the service and it automatically passes its scheduled time (6 minutes)

image

Common issue here could be zone is not connected, you could verify this using cluster_zone check. If not connected check certificate and logs might help.

1 Like

Hello Roland, Are there any ways to manually run the cluster_zone check like for example nagios checks? I have checked the certificate, that should be correct. Could you point me in the right direction for the right logs? Thanks

cluster_zone is an internal check and I don’t have any clue how to run it manually. The logs are usually in /var/log/icinga2. For more detailed logs you can enable debuglog via

icinga2 feature enable debuglog

I’am using the cluster check as hostalive replacement for any agent based host. So you will see directly if there is a problem with the host. Alternatively you can use it as a service. There is also a “summary” check where all connection are checked at once. Read this for more details.

Hello, I´ve been sick a couple of days. Thanks for the responses

So I changed the hostalive check to the cluster zone check and indeed it reports a Fault

The log reads:

No data received on new API connection from [x.x.x.x]:39890 for identity ‘client-name’. Ensure that the remote endpoints are properly configured in a cluster setup

They reside in the same Vlan as for now. Any ideas what could be wrong with the cluster zone config, to my knowledge it´s configured according to the docu right now and as you pointed out in the zones.conf

root@x.x.x.x:/etc/icinga2# more zones.conf
/*

  • Generated by Icinga 2 node setup commands
  • on 2019-10-21 06:37:40 +0000
    */

object Endpoint NodeName {
}

object Zone ZoneName {
endpoints = [ NodeName ]
}

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

object Zone “director-global” {
global = true
}
// Endpoints & Zones
object Endpoint “client-name” {
}

object Zone “client-name” {
endpoints = [ “client-name” ]
parent = “master-name”
}

Here is the client zones.conf

The only thing i could think of is that I am using fqdn in here where the config is short name on master
However the client node wizard found the certificate etc of the master server and asked me to accept it.

etc/icinga2# more zones.conf
/*

  • Generated by Icinga 2 node setup commands
  • on 2019-11-07 07:23:02 +0000
    */

object Endpoint “master-name” {
host = “master-name”
port = “5665”
}

object Zone “master” {
endpoints = [ “master-name” ]
}

object Endpoint “client-name” {
}

object Zone “client-name” {
endpoints = [ “client-name” ]
parent = “master”
}

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

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

The endpoint objects and the certificate cn has to be identical, recommend is fqdn.

1 Like

GREAT! Thanks alot for the help. That was the problem!

Now the cluster-zone check works

Appriciate the help Roland and Rafael