IcingaHost: fix parent zone for agent zone in a...

...satellite zone
This commit is contained in:
Thomas Gelf 2016-05-26 01:36:20 +02:00
parent cb825b5b94
commit 7dfadf1951

View File

@ -186,11 +186,17 @@ class IcingaHost extends IcingaObject
$props['zone_id'] = $this->getResolvedProperty('zone_id');
$endpoint = IcingaEndpoint::create($props);
$zone = IcingaZone::create(array(
'object_name' => $name,
'parent' => $this->connection->getMasterZoneName()
), $this->connection)->setEndpointList(array($name));
if ($props['zone_id']) {
$zone->parent_id = $props['zone_id'];
} else {
$zone->parent = $this->connection->getMasterZoneName();
}
$pre = 'zones.d/' . $this->getRenderingZone($config) . '/';
$config->configFile($pre . 'agent_endpoints')->addObject($endpoint);
$config->configFile($pre . 'agent_zones')->addObject($zone);