mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 17:24:18 +02:00
IcingaHost: fix parent zone for agent zone in a...
...satellite zone
This commit is contained in:
parent
cb825b5b94
commit
7dfadf1951
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user