I would like to know what could be behind my current problem.
Successfully installed Icinga2 even with web gui to one VM inside vDC behind NAT.
Checks locally works OK but its not working for satellite which I installed to the second VM inside second vDC behind NAT.
port forward for 5665 is OK and working on both sides.
I followed documentation but with no luck figure it out.
By to logs connections are OK, sync of config is OK. Check on master zone works great but on satellite no
Because of the NAT its unable to make check commands by remote so I decided for second option: Top Down Config Sync
Can you please point me what is the problem?
Master
zones.conf
object Endpoint "control_machine" {
}
object Zone "master" {
endpoints = [ "control_machine" ]
}
object Endpoint "vm_1" {
host = "SATELLITE-IP"
port = "5665"
}
object Zone "vDC_1" {
parent = "master"
endpoints = [ "vm_1" ]
}
object Zone "global-templates" {
global = true
}
zones.d/vDC_1
hosts.conf
object Host "vm_1" {
check_command = "hostalive"
address = "192.168.29.101"
zone = "vDC_1" //optional trick: sync the required host object to the client, but enforce the "master" zone to execute the check
}
object Endpoint "control_machine" {
host = "MASTER-IP"
port = "5665"
}
object Zone "master" {
endpoints = [ "control_machine" ]
}
object Endpoint "vm_1" {
}
object Zone "vDC_1" {
endpoints = [ "vm_1" ]
parent = "master"
}
object Zone "global-templates" {
global = true
}
Is it OK that files on satellity are only in cache? And commands “icinga2 object list --type Host” & “icinga2 object list --type Service”
return nothing on Satellite? While on Master it shows output
MASTER-IP and SATELLITE-IP was replaced for security reasons
The goal is to have one Master node with multiple Satellites which have local access to the rest of VM inside of vDC.
My topic is similar to this one
But I have nothing wrong in configs in my opinion.
You’re mixing things here. The connection direction is important - either up-down or down-up. Once the connection is established, the upper layers may run commands or sync configuration.
Reading your configuration makes me thing that the master should sync the satellite zone vDC_1 to the satellite endpoint with objects located in /etc/icinga2/zones.d/vDC_1.
Right now, the host/service objects inside the configuration should be synced to the satellite. You can verify that inside its logs - it should tell you about the zones it received configuration for, and also trigger a reload. Can you share them?
Result of “icinga2 daemon -C -x notice | grep vDC_1”:
[2019-07-31 09:39:07 +0200] notice/config: Ignoring non local config include for zone 'vDC_1': We already have an authoritative copy included.
[2019-07-31 09:39:07 +0200] information/ApiListener: My API identity: vDC_1
Also icinga2.log after manual restart of the service:
[2019-07-31 09:46:24 +0200] information/Application: Received request to shut down.
[2019-07-31 09:46:25 +0200] information/Application: Shutting down...
[2019-07-31 09:46:25 +0200] information/ApiListener: 'api' stopped.
[2019-07-31 09:46:25 +0200] information/CheckerComponent: 'checker' stopped.
[2019-07-31 09:46:25 +0200] information/FileLogger: 'main-log' started.
[2019-07-31 09:46:25 +0200] information/FileLogger: 'debug-file' started.
[2019-07-31 09:46:25 +0200] information/ApiListener: 'api' started.
[2019-07-31 09:46:25 +0200] information/ApiListener: Started new listener on '[0.0.0.0]:5665'
[2019-07-31 09:46:25 +0200] information/CheckerComponent: 'checker' started.
[2019-07-31 09:46:25 +0200] information/ConfigItem: Activated all objects.
[2019-07-31 09:46:25 +0200] information/cli: Closing console log.
[2019-07-31 09:46:25 +0200] information/ApiListener: Reconnecting to endpoint 'control_machine' via host 'MASTER-IP' and port '5665'
[2019-07-31 09:46:25 +0200] information/ApiListener: New client connection for identity 'control_machine' to [MASTER-IP]:5665
[2019-07-31 09:46:25 +0200] information/ApiListener: Finished reconnecting to endpoint 'control_machine' via host 'MASTER-IP' and port '5665'
[2019-07-31 09:46:25 +0200] information/ApiListener: Requesting new certificate for this Icinga instance from endpoint 'control_machine'.
[2019-07-31 09:46:25 +0200] information/ApiListener: Sending config updates for endpoint 'control_machine' in zone 'master'.
[2019-07-31 09:46:25 +0200] information/ApiListener: Finished sending config file updates for endpoint 'control_machine' in zone 'master'.
[2019-07-31 09:46:25 +0200] information/ApiListener: Syncing runtime objects to endpoint 'control_machine'.
[2019-07-31 09:46:25 +0200] information/ApiListener: Finished syncing runtime objects to endpoint 'control_machine'.
[2019-07-31 09:46:25 +0200] information/ApiListener: Finished sending runtime config updates for endpoint 'control_machine' in zone 'master'.
[2019-07-31 09:46:25 +0200] information/ApiListener: Sending replay log for endpoint 'control_machine' in zone 'master'.
[2019-07-31 09:46:25 +0200] information/ApiListener: Applying config update from endpoint 'control_machine' of zone 'master'.
[2019-07-31 09:46:25 +0200] information/ApiListener: Finished sending replay log for endpoint 'control_machine' in zone 'master'.
[2019-07-31 09:46:25 +0200] information/ApiListener: Finished syncing endpoint 'control_machine' in zone 'master'.
[2019-07-31 09:46:35 +0200] information/WorkQueue: #5 (ApiListener, RelayQueue) items: 0, rate: 0/s (0/min 0/5min 0/15min);
[2019-07-31 09:46:35 +0200] information/WorkQueue: #6 (ApiListener, SyncQueue) items: 0, rate: 0.0166667/s (1/min 1/5min 1/15min);
[2019-07-31 09:46:35 +0200] information/WorkQueue: #9 (JsonRpcConnection, #0) items: 0, rate: 0.0666667/s (4/min 4/5min 4/15min);
[2019-07-31 09:46:35 +0200] information/WorkQueue: #10 (JsonRpcConnection, #1) items: 0, rate: 0/s (0/min 0/5min 0/15min);
It looks like its not syncing config from master for zone vDC_1
But on satellite the actual hosts ans services are present in files under
/var/lib/icinga2/api/zones/vDC_1
Should satellite after sucessful sync return the same like master with commands
icinga2 object list --type Host
icinga2 object list --type Service