Okay I removed the entire thing and did it from scratch again, here’s what I did:
Setup Icinga on Windows:
- Downloaded and installed Icinga2 on Windows client
- Started the Icinga2 Wizard, added the “master” zone as parent
- Activated “Listen for connections” on Port 5665
- Actived the two checks “Accept commands from master” and “Accept config updated from master”
- Deleted the “checker.conf” in c://programdata/icinga2/etc/icinga2/features-enabled (I’ve been told to do so as it’s not working otherwise)
- Checked Firewall rules, so communication to host is possible (I activated the “File-and Print Sharing” in Windows Firewall)
- On the Icinga-Host I signed the new fingerprint
Setup the new client:
- Created a little template for future Windows systems (see below #1)
- I created a new config file for Windows systems, called “Win_new.conf” and configured the host (see below #2)
- I edited the zones.conf and entered a new endpoint for new client and added the endpoint to the zone “Visable” that already existed and contains all monitored hosts (see below #3)
Setup the new service-check:
- Finally I created a new config file “Win_new_services.conf” (see below #4)
- I entered the new service check as you advised.
I did everything, you told me, set up the endpoint only in zones.conf and changed the line host.vars.client_endpoint to command_endpoint = host.name. Still I’m getting the same error, the service exists, but somehow data can’t be accessed and the service is shown as “Unkown”
This is how it looks:
#1 Template (icinga2/conf.d/templates):
#########################################################
# Template Windows Host NEW
#########################################################
template Host "windows-host-new" {
vars.os = "windows-new"
vars.group = "windows-servers"
vars.ping = "yes"
vars.disk = "no"
vars.notification["mail_host"] = {
groups = [ "winadmins", "webadmins" ]
}
vars.notification["sms_host_workhours"] = {
groups = [ "winadmins" ]
}
vars.notification["mail_service"] = {
groups = [ "winadmins" ]
}
vars.disks_windows["disk C:"] = {
disk_win_path = "C:",
disk_win_warn = "5%"
disk_win_crit = "3%"
}
vars.load_wload1 = "86"
vars.load_cload1 = "96"
vars.memutil_warn = "15%" //different threshold than the default
vars.memutil_crit = "5%" //different threshold than the default
}
#2 Client Setup (icinga2/zones.d/master/Hosts/Win_new)
object Host "ms2019p-xpertdb.domain.de" {
import "generic-host"
import "windows-host-new"
display_name = "ms2019p-xpertdb"
address = "X.X.X.X"
check_command = "hostalive"
notes = "Xpert DB-Server"
vars.client_endpoint = name
vars.servicecheck = "smartflow"
vars.disks_windows["disk D:"] = {
disk_win_path = "D:"
disk_win_warn = "5%"
disk_win_crit = "3%"
}
}
#3 zones.conf (icinga2/zones.conf)
object Endpoint NodeName {
host = NodeName
}
object Zone "master" {
endpoints = [ NodeName ]
}
object Zone "global-templates" {
global = true
}
object Zone "director-global" {
global = true
}
object Endpoint "ms2019p-xpertdb.domain.de" {
host = "ms2019p-xpertdb.domain.de"
}
object Zone "Visable" {
parent = "master"
endpoints = ["ms2019p-xpertdb.domain.de"]
}
#4 (icinga2/zones.d/Services/Win_new_services.conf)
apply Service "service-smartflow" {
check_command = "procs"
command_endpoint = host.name
vars.procs_command = "smartflow-server"
vars.procs_critical = "0:2"
vars.procs_warning = "1:1"
assign where host.vars.servicecheck == "smartflow"
}
Note: the list of endpoints and endpoints in Visable-zone is longer, for better overview I just extracted the current problem ms2019p-xpertdb server
Is there any ideas on where the mistake is located or what I can do to figure it out. I’d be very grateful if someone can help me out.
Thank you and kind regards
Kevin