Unexpected certificate common name while connecting to endpoint 'Hostname': got 'icinga2-agent1.localdomain'

Good day everyone,

I have a problem that I can not understand at all, I have installed icinga2 on ubuntu and now I want to monitor the services of a Windows VM like CPU and RAM etc. I have also set up director and also have this icinga2 node wizard configured.

zones.conf :
/*

  • Generated by Icinga 2 node setup commands
  • on 2020-04-01 13:27:09 +0200
    */

object Endpoint “icinga2-agent1.localdomain” {

}

object Zone “master” {
endpoints = [ “icinga2-agent1.localdomain” ]

}

object Endpoint “icinga2-master1.localdomain” {

}

object Zone “icinga2-master1.localdomain” {
endpoints = [ “icinga2-master1.localdomain” ]

}

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

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

constants.conf:
/**

  • This file defines global constants which can be used in
  • the other configuration files.
    */

/* The directory which contains the plugins from the Monitoring Plugins project. */
const PluginDir = “/usr/lib/nagios/plugins”

/* The directory which contains the Manubulon plugins.

  • Check the documentation, chapter “SNMP Manubulon Plugin Check Commands”, for details.
    */
    const ManubulonPluginDir = “/usr/lib/nagios/plugins”

/* The directory which you use to store additional plugins which ITL provides user contributed command definitions for.

  • Check the documentation, chapter “Plugins Contribution”, for details.
    */
    const PluginContribDir = “/usr/lib/nagios/plugins”

/* Our local instance name. By default this is the server’s hostname as returned by hostname --fqdn.

  • This should be the common name from the API certificate.
    */

const NodeName = “icinga2-master1.localdomain”

/* Our local zone name. */
const ZoneName = “icinga2-master1.localdomain”

/* Secret key for remote node tickets */

const TicketSalt = “*******”

const NscpPath = “C:\Program Files\NSClient++”

api.conf (features.enabled):

/**

  • The API listener is used for distributed monitoring setups.
    */
    object ApiListener “api” {
    accept_config = true
    accept_commands = true
    }

I also installed and configured agent for Windows 2012 R2 with nsclient ++.

then i added the host in director:

zones.d/icinga2-master1.localdomain/hosts.conf

object Host “Hostname” {
import “generic-host”

display_name = "Hostname"
address = "10.0.0.1"
groups = [ "Windows" ]

}

zones.d/icinga2-master1.localdomain/agent_endpoints.conf

object Endpoint “Hostname” {
host = “10.0.0.1”
log_duration = 0s
}

zones.d/icinga2-master1.localdomain/agent_zones.conf

object Zone “Hostname” {
parent = “icinga2-master1.localdomain”
endpoints = [ “Hostname” ]
}

zones.d/director-global/service_templates.conf

template Service “memory-windows” {
check_command = “win-mem”
max_check_attempts = “3”
check_interval = 5m
retry_interval = 1m
enable_notifications = true
enable_active_checks = true
enable_passive_checks = true
enable_event_handler = true
enable_flapping = true
enable_perfdata = true
command_endpoint = host_name
}

zones.d/master/service_templates.conf

template Service “nscp-local-cpu” {
check_command = “nscp-local-cpu”
max_check_attempts = “2”
check_interval = 1m
retry_interval = 2m
enable_notifications = true
enable_active_checks = true
enable_passive_checks = true
enable_event_handler = true
enable_flapping = true
enable_perfdata = true
}

zones.d/master/service_apply.conf

apply Service “check_cpu” {
import “nscp-local-cpu”

assign where "Windows" in host.groups
zone = "master"

import DirectorOverrideTemplate

}

zones.d/director-global/service_apply.conf

apply Service “mem” {
import “memory-windows”

assign where "Windows" in host.groups

import DirectorOverrideTemplate

}

zones.d/master/commands.conf

object CheckCommand “CPU” {
import “nscp-local-cpu”

}

zones.d/director-global/commands.conf

object CheckCommand “win-mem” {
import “cluster-check-command”
import “memory-windows”

}

so now i have the problem that i cannot monitor these services (no idea why)
in icingaweb2:

unknown
service mem:
Plugin-Ausgabe
Remote Icinga instance ‘Hostname’ is not connected to ‘icinga2-master1.localdomain’

unknown
service check_cpu:
Plugin-Ausgabe
execvpe(C:\Program Files\NSClient++
scp.exe) failed: No such file or directory

icinga2.log :
[2020-04-01 14:39:51 +0200] information/JsonRpcConnection: No messages for identity ‘icinga2-agent1.localdomain’ have been received in the last 60 seconds.
[2020-04-01 14:39:51 +0200] warning/JsonRpcConnection: API client disconnected for identity ‘icinga2-agent1.localdomain’
[2020-04-01 14:39:58 +0200] information/ApiListener: Reconnecting to endpoint ‘Hostname’ via host ‘10.0.0.1’ and port ‘5665’
[2020-04-01 14:39:58 +0200] warning/ApiListener: Unexpected certificate common name while connecting to endpoint 'Hostname: got ‘icinga2-agent1.localdomain’
[2020-04-01 14:39:58 +0200] information/ApiListener: Finished reconnecting to endpoint ‘Hostname’ via host ‘10.0.0.1’ and port ‘5665’
[2020-04-01 14:40:01 +0200] information/ApiListener: New client connection for identity ‘icinga2-agent1.localdomain’ from [10.0.0.1]:54079 (certificate validation failed: code 18: self signed certificate)
[2020-04-01 14:40:01 +0200] information/JsonRpcConnection: No messages for identity ‘icinga2-agent1.localdomain’ have been received in the last 60 seconds.
[2020-04-01 14:40:01 +0200] warning/JsonRpcConnection: API client disconnected for identity ‘icinga2-agent1.localdomain’
[2020-04-01 14:40:08 +0200] information/ApiListener: Reconnecting to endpoint ‘Hostname’ via host ‘10.0.0.1’ and port ‘5665’
[2020-04-01 14:40:08 +0200] warning/ApiListener: Unexpected certificate common name while connecting to endpoint ‘Hostname’: got ‘icinga2-agent1.localdomain’
[2020-04-01 14:40:08 +0200] information/ApiListener: Finished reconnecting to endpoint ‘Hostname’ via host ‘10.0.0.1’ and port ‘5665’
[2020-04-01 14:40:11 +0200] information/ApiListener: New client connection for identity ‘icinga2-agent1.localdomain’ from [10.0.0.1]:54109 (certificate validation failed: code 18: self signed certificate)
[2020-04-01 14:40:18 +0200] information/ApiListener: Reconnecting to endpoint ‘Hostname’ via host ‘10.0.0.1’ and port ‘5665’

I honestly don’t know what to do, because I have no experience with icinga2 because it’s new to me
I will be very happy for your help
thank you in advance!

can nobody help me?
?