IcingaService: disable services belonging to a...

...single disabled host

fixes #12049
This commit is contained in:
Thomas Gelf 2016-10-29 22:06:52 +00:00
parent a4ef711ef0
commit 78903553e9
1 changed files with 12 additions and 0 deletions

View File

@ -170,6 +170,18 @@ class IcingaService extends IcingaObject
return $this->renderRelationProperty('host', $this->host_id, 'host_name');
}
public function toConfigString()
{
$str = parent::toConfigString();
if ($this->host_id && $this->getRelated('host')->isDisabled()) {
return "/* --- This services host has been disabled ---\n"
. $str . "*/\n";
} else {
return $str;
}
}
protected function renderObjectHeader()
{
if ($this->isApplyRule()