From 01be02fe9cf9d2b1d5fd6c968d37fafca20376de Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 18 Dec 2015 11:55:42 +0100 Subject: [PATCH] IcingaService: command endpoint respects use_agent --- library/Director/Objects/IcingaService.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/library/Director/Objects/IcingaService.php b/library/Director/Objects/IcingaService.php index ea5bdcf8..625cf737 100644 --- a/library/Director/Objects/IcingaService.php +++ b/library/Director/Objects/IcingaService.php @@ -80,6 +80,15 @@ class IcingaService extends IcingaObject return $this->renderRelationProperty('host', $this->host_id, 'host_name'); } + public function renderCommand_endpoint_id() + { + if ($this->use_agent === 'y') { + return $this->renderHost_id(); + } + + return $this->renderRelationProperty('command_endpoint', $this->command_endpoint_id); + } + public function renderUse_agent() { return '';