Well I try distributed setup from docs
master - on raspberrypi
satellite - LXD host
agents - LXC containers on LXD host
Problem is agents IPs are not visible to master so all agents services are pending.
I put all agents in master zone config with parent set as satellite
I also created in master’s zone.d folders agent1 agent2 etc. with agent hosts.conf definition on them
/etc/icinga2/zones.d/master/hosts.conf
object Host "raspberrypi" {
/* Import the default host template defined in `templates.conf`. */
import "generic-host"
/* Specify the address attributes for checks e.g. `ssh` or `http`. */
address = "127.0.0.1"
address6 = "::1"
}
/etc/icinga2/zones.d/satellite/hosts.conf
object Host "satellite" {
check_command = "hostalive"
address = "192.168.0.130"
zone = "master" //optional trick: sync the required host object to the satellite, but enforce the "master" zone to execute the check
}
/etc/icinga2/zones.d/agent/hosts.conf
object Host "agent" {
check_command = "hostalive"
}
Your agents don’t need to communicate with your master, hence, that is not the reason why services are pending. Pending services are usually caused by certificate errors or mistakes in zones. More dateils can be found in icinga2.log.
Zone and endpoint object for your agent is missing in your satellite`s zones.conf. You have the global zone director-global which indicates you are using the director. If so, you don’t need both objects manually be defined in satellite`s zones.conf as this is done by the director. And you need to remove zone and endpoint object form your master`s zones.conf due to the same reason.
Satellite`s host object need to be in /etc/icinga2/zones.d/master/ and agent`s host object needs to be in /etc/icinga2/zones.d/satellite/.
Finally it’s best practice to have cluster and/or cluster-zone checks defined to keep an eye on these connections.