Hi.
I’ve got 1x master and 1x satellite. A Linux host is reporting service as “unknown” on Icinga Web and I investigated it and I can see the error “Icinga Not connecting to Zone because it’s not in the same zone, a parent or a child zone.” on the debug.log file.
Funny thing is this was working fine until I had to restart Icinga master a couple of days ago.
icinga2 master version = r2.10.3-1
icinga2 satellite version = r2.10.4-1
icinga2 client version = r2.10.2-1
The error only appears for this specific service postgres_replication. Any idea what could I do to fix this? Below you’ll find more information.
host.conf:
// Endpoints & Zones
object Endpoint "db2.datacentre.example.com.au" {
}
object Zone "db2.datacentre.example.com.au" {
endpoints = [ "db2.datacentre.example.com.au" ]
parent = "satellite"
}
// Host Objects
object Host "db2.datacentre.example.com.au" {
import "generic-host"
check_command = "hostalive"
address = "192.168.99.14"
vars.kernel = "centos"
vars.os = "Linux"
vars.postgres = true
vars.postgres_replication = true
host zones.conf:
object Endpoint "icinga2-satellite.datacentre.example.com.au" {
host = "192.168.99.22"
port = "5665"
}
object Zone "satellite" {
endpoints = [ "icinga2-satellite.datacentre.example.com.au" ]
}
object Endpoint "db2.datacentre.example.com.au" {
}
object Zone "db2.datacentre.example.com.au" {
endpoints = [ "db2.datacentre.example.com.au" ]
parent = "satellite"
}
object Zone "global-templates" {
global = true
}
object Zone "director-global" {
global = true
}
icinga master error log:
[2019-07-12 09:45:25 +1200] debug/ApiListener: Not connecting to Zone 'db2.datacentre.example.com.au' because it's not in the same zone, a parent or a child zone.
[2019-07-12 09:45:32 +1200] debug/Checkable: Update checkable 'db2.datacentre.example.com.au!postgres_replication' with check interval '60' from last check time at 2019-07-12 09:45:32 +1200 (1.56288e+09) to next check time at 2019-07-12 09:46:30 +1200(1.56288e+09).
[2019-07-12 09:45:32 +1200] debug/DbEvents: add checkable check history for 'db2.datacentre.example.com.au!postgres_replication'
services.conf:
// check postgres replication
apply Service "postgres_replication" {
import "generic-service"
display_name = "PostgreSQL replication delay status"
vars.notification_delay = 10m
check_command = "check_postgres_replication"
assign where host.vars.postgres == true && host.vars.postgres_replication == true
}
icinga2 object list --type service --name postgres_replication
Object 'db2.datacentre.example.com.au!postgres_replication' of type 'Service':
% declared in '/etc/icinga2/zones.d/global-templates/services.conf', lines 40:1-40:36
* __name = "db2.datacentre.example.com.au!postgres_replication"
* action_url = ""
* check_command = "check_postgres_replication"
% = modified in '/etc/icinga2/zones.d/global-templates/services.conf', lines 44:3-44:46
* check_interval = 60
% = modified in '/etc/icinga2/zones.d/global-templates/templates.conf', lines 29:3-29:21
* check_period = ""
* check_timeout = null
* command_endpoint = ""
* display_name = "PostgreSQL replication delay status"
% = modified in '/etc/icinga2/zones.d/global-templates/services.conf', lines 42:3-42:54
* enable_active_checks = true
* enable_event_handler = true
* enable_flapping = false
* enable_notifications = true
* enable_passive_checks = true
* enable_perfdata = true
* event_command = ""
* flapping_threshold = 0
* flapping_threshold_high = 30
* flapping_threshold_low = 25
* groups = [ ]
* host_name = "db2.datacentre.example.com.au"
% = modified in '/etc/icinga2/zones.d/global-templates/services.conf', lines 40:1-40:36
* icon_image = ""
* icon_image_alt = ""
* max_check_attempts = 3
% = modified in '/etc/icinga2/zones.d/global-templates/templates.conf', lines 28:3-28:24
* name = "postgres_replication"
% = modified in '/etc/icinga2/zones.d/global-templates/services.conf', lines 40:1-40:36
* notes = ""
* notes_url = ""
* package = "_etc"
% = modified in '/etc/icinga2/zones.d/global-templates/services.conf', lines 40:1-40:36
* retry_interval = 30
% = modified in '/etc/icinga2/zones.d/global-templates/templates.conf', lines 30:3-30:22
* source_location
* first_column = 1
* first_line = 40
* last_column = 36
* last_line = 40
* path = "/etc/icinga2/zones.d/global-templates/services.conf"
* templates = [ "postgres_replication", "generic-service" ]
% = modified in '/etc/icinga2/zones.d/global-templates/services.conf', lines 40:1-40:36
% = modified in '/etc/icinga2/zones.d/global-templates/templates.conf', lines 27:1-27:34
* type = "Service"
* vars
* enable_pagerduty = true
% = modified in '/etc/icinga2/zones.d/global-templates/templates.conf', lines 32:3-32:30
* notification_delay = 600
% = modified in '/etc/icinga2/zones.d/global-templates/services.conf', lines 43:3-43:31
* volatile = false
* zone = "satellite"
% = modified in '/etc/icinga2/zones.d/global-templates/services.conf', lines 40:1-40:36