From 4f959572f2ad210493602552fce961a8db806be3 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Thu, 21 Oct 2021 14:33:14 +0200 Subject: [PATCH] Add feature to specify a custom endpoint name for a host - Render Endpoint and Zone with a different name per host - Add custom variable `_director_custom_endpoint_name` to a host with that name - Update `command_endpoint` behavior in services to use custom var or hostname - Includes a feature flag that needs to be enabled --- library/Director/Objects/IcingaHost.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/library/Director/Objects/IcingaHost.php b/library/Director/Objects/IcingaHost.php index 95a74c08c..f690b44ad 100644 --- a/library/Director/Objects/IcingaHost.php +++ b/library/Director/Objects/IcingaHost.php @@ -252,14 +252,11 @@ public function renderAgentZoneAndEndpoint(IcingaConfig $config = null) $config->configFile($pre . 'agent_zones')->addObject($zone); } - protected function renderCustom_endpoint_name() + protected function renderCustom_endpoint_name($value) { // When feature flag feature_custom_endpoint is enabled, render custom var if ($this->connection->settings()->get('feature_custom_endpoint') === 'y') { - return c::renderKeyValue( - 'vars._director_custom_endpoint_name', - c::renderPhpValue($this->get('custom_endpoint_name')) - ); + return c::renderKeyValue('vars._director_custom_endpoint_name', c::renderString($value)); } return '';