[2020-07-27 15:07:43 +0000] critical/config: Error: Validation failed for object ‘agent-02.local’ of type ‘Host’; Attribute ‘zone’: Object ‘master’ of type ‘Zone’ does not exist.
If you want your configuration to compile, you either need to explicitely declare a zone named “master” in your zones.conf file or remove the zone = “master” from the Host definition.
Hi “Someone”, thanks for your reply.
I didn’t explain myself exhaustively enough.
I’m referring to the trick mentioned in Distributed Monitoring - Icinga 2
which says exactly:
Add the host and service objects you want to monitor. There is no limitation for files and directories – best practice is to sort things by type. By convention a master/satellite/agent host object should use the same name as the endpoint object. You can also add multiple hosts which execute checks against remote services/agents via command endpoint checks.
[root@icinga2-master1.localdomain /]# cd /etc/icinga2/zones.d/satellite [root@icinga2-master1.localdomain /etc/icinga2/zones.d/satellite]# vim hosts.conf
object Host “icinga2-satellite1.localdomain” {
check_command = “hostalive”
address = “192.168.56.112”
zone = “master” //optional trick: sync the required host object to the satellite, but enforce the “master” zone to execute the check
}
In newer versions of Icinga you need to specify the zone in zones.conf. It will not work, if you declare the zone somewhere else in the configuration, like the director will do for example. Maybe your agent/Satellite does not have the masterzone in the zones.conf defined