Dear Community,
I tried to configure a Master with Agents following this documentation:
https://icinga.com/docs/icinga-2/latest/doc/06-distributed-monitoring/#master-with-agents
But I do not really know, why it is not working. Maybe it is really really stupid mistake. Could someone have a look over it? The problem is: In icinga-web the client wshb-000-002 is not shown, only the MasterNode “icinga”. Maybe the problem is, that /etc/icinga2/zones.d/master/ is not included via include_recursive in icinga2.conf? But I found nothing regarding to this in the documentation.
I enabled the debug logging and found in the debug log, that the configuration is transfered correctly to the Client:
[2022-03-23 13:44:49 +0100] information/ApiListener: Finished syncing runtime objects to endpoint ‘wshb-000-002.domain.tld’.
[2022-03-23 13:44:49 +0100] information/ApiListener: Finished syncing endpoint ‘wshb-000-002.domain.tld’ in zone ‘wshb-000-002.domain.tld’.
And additional entries regarding this host:
[2022-03-23 13:53:49 +0100] notice/JsonRpcConnection: Received ‘event::Heartbeat’ message from identity ‘wshb-000-002.domain.tld’.
[2022-03-23 13:53:58 +0100] debug/ApiListener: Not connecting to Endpoint ‘wshb-000-002.domain.tld’ because we’re already connected to it.
[2022-03-23 13:53:58 +0100] notice/ApiListener: Connected endpoints: wshb-000-002.domain.tld (1)
But whatever I do, the client wshb-000-002 is not visible in Icinga Web2. What I am doing wrong?
What I configured:
** /etc/icinga2/zones.conf **
object Endpoint NodeName {
host = NodeName
}
object Zone ZoneName {
endpoints = [ NodeName ]
}
object Zone "global-templates" {
global = true
}
object Zone "director-global" {
global = true
}
object Endpoint "wshb-000-002.domain.tld" {
host = "wshb-000-002.domain.tld"
}
object Zone "wshb-000-002.domain.tld" {
parent = "av-icinga.domain.tld"
endpoints = [ "wshb-000-002.domain.tld" ]
}
** /etc/icinga2/zones.d/master/hosts.conf **
object Host "wshb-000-002.domain.tld" {
check_command = "hostalive"
address = "172.18.0.2"
vars.agent_endpoint = name //follows the convention that host name == endpoint name
}
** /etc/icinga2/zones.d/master/services.conf **
apply Service "disk-windows" {
import "generic-service"
check_command = "disk-windows"
display_name = "Disk Windows"
// Execute the check on the remote command endpoint
command_endpoint = host.vars.agent_endpoint
assign where host.vars.os == "Windows" && host.vars.agent_endpoint
}
** icinga2 object list --type Endpoint **
Object 'av-icinga.domain.tld' of type 'Endpoint':
% declared in '/etc/icinga2/zones.conf', lines 7:1-7:24
* __name = "av-icinga.domain.tld"
* host = "av-icinga.domain.tld"
% = modified in '/etc/icinga2/zones.conf', lines 8:3-8:17
* log_duration = 86400
* name = "av-icinga.domain.tld"
* package = "_etc"
* port = "5665"
* source_location
* first_column = 1
* first_line = 7
* last_column = 24
* last_line = 7
* path = "/etc/icinga2/zones.conf"
* templates = [ "av-icinga.domain.tld" ]
% = modified in '/etc/icinga2/zones.conf', lines 7:1-7:24
* type = "Endpoint"
* zone = ""
Object 'wshb-000-002.domain.tld' of type 'Endpoint':
% declared in '/etc/icinga2/zones.conf', lines 64:1-64:44
* __name = "wshb-000-002.domain.tld"
* host = "wshb-000-002.domain.tld"
% = modified in '/etc/icinga2/zones.conf', lines 65:3-65:37
* log_duration = 86400
* name = "wshb-000-002.domain.tld"
* package = "_etc"
* port = "5665"
* source_location
* first_column = 1
* first_line = 64
* last_column = 44
* last_line = 64
* path = "/etc/icinga2/zones.conf"
* templates = [ "wshb-000-002.domain.tld" ]
% = modified in '/etc/icinga2/zones.conf', lines 64:1-64:44
* type = "Endpoint"
* zone = ""
** icinga2 object list --type Zone **
Object 'wshb-000-002.domain.tld' of type 'Zone':
% declared in '/etc/icinga2/zones.conf', lines 68:1-68:40
* __name = "wshb-000-002.domain.tld"
* endpoints = [ "wshb-000-002.domain.tld" ]
% = modified in '/etc/icinga2/zones.conf', lines 70:3-70:46
* global = false
* name = "wshb-000-002.domain.tld"
* package = "_etc"
* parent = "av-icinga.domain.tld"
% = modified in '/etc/icinga2/zones.conf', lines 69:3-69:36
* source_location
* first_column = 1
* first_line = 68
* last_column = 40
* last_line = 68
* path = "/etc/icinga2/zones.conf"
* templates = [ "wshb-000-002.domain.tld" ]
% = modified in '/etc/icinga2/zones.conf', lines 68:1-68:40
* type = "Zone"
* zone = ""
Object 'global-templates' of type 'Zone':
% declared in '/etc/icinga2/zones.conf', lines 24:1-24:30
* __name = "global-templates"
* endpoints = null
* global = true
% = modified in '/etc/icinga2/zones.conf', lines 25:3-25:15
* name = "global-templates"
* package = "_etc"
* parent = ""
* source_location
* first_column = 1
* first_line = 24
* last_column = 30
* last_line = 24
* path = "/etc/icinga2/zones.conf"
* templates = [ "global-templates" ]
% = modified in '/etc/icinga2/zones.conf', lines 24:1-24:30
* type = "Zone"
* zone = ""
Object 'director-global' of type 'Zone':
% declared in '/etc/icinga2/zones.conf', lines 36:1-36:29
* __name = "director-global"
* endpoints = null
* global = true
% = modified in '/etc/icinga2/zones.conf', lines 37:3-37:15
* name = "director-global"
* package = "_etc"
* parent = ""
* source_location
* first_column = 1
* first_line = 36
* last_column = 29
* last_line = 36
* path = "/etc/icinga2/zones.conf"
* templates = [ "director-global" ]
% = modified in '/etc/icinga2/zones.conf', lines 36:1-36:29
* type = "Zone"
* zone = ""
Object 'av-icinga.domain.tld' of type 'Zone':
% declared in '/etc/icinga2/zones.conf', lines 11:1-11:20
* __name = "av-icinga.domain.tld"
* endpoints = [ "av-icinga.domain.tld" ]
% = modified in '/etc/icinga2/zones.conf', lines 12:3-12:26
* global = false
* name = "av-icinga.domain.tld"
* package = "_etc"
* parent = ""
* source_location
* first_column = 1
* first_line = 11
* last_column = 20
* last_line = 11
* path = "/etc/icinga2/zones.conf"
* templates = [ "av-icinga.domain.tld" ]
% = modified in '/etc/icinga2/zones.conf', lines 11:1-11:20
* type = "Zone"
* zone = ""
** icinga2 daemon -C **
[2022-03-23 13:51:37 +0100] information/cli: Icinga application loader (version: r2.13.2-1)
[2022-03-23 13:51:37 +0100] information/cli: Loading configuration file(s).
[2022-03-23 13:51:37 +0100] warning/config: Ignoring directory '/etc/icinga2/zones.d/master' for unknown zone 'master'.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Committing config item(s).
[2022-03-23 13:51:37 +0100] information/ApiListener: My API identity: av-icinga.domain.tld
[2022-03-23 13:51:37 +0100] warning/ApplyRule: Apply rule 'ping4' (in /etc/icinga2/conf.d/services.conf: 26:1-26:21) for type 'Service' does not match anywhere!
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 12 Notifications.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 1 IcingaApplication.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 2 HostGroups.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 2 NotificationCommands.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 1 Host.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 1 Downtime.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 2 FileLoggers.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 1 CheckerComponent.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 1 ApiListener.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 4 Zones.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 2 Endpoints.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 2 ApiUsers.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 244 CheckCommands.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 1 NotificationComponent.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 1 UserGroup.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 1 User.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 3 TimePeriods.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 3 ServiceGroups.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 1 ScheduledDowntime.
[2022-03-23 13:51:37 +0100] information/ConfigItem: Instantiated 11 Services.
[2022-03-23 13:51:37 +0100] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2022-03-23 13:51:37 +0100] information/cli: Finished validating the configuration file(s).