IcingaConfig: Add v1-masterless config format

Do not render a passive checkable to the master zone then.

refs #12919
This commit is contained in:
Markus Frosch 2016-10-13 15:51:37 +02:00
parent 31a321e13e
commit 802b923df6
3 changed files with 3 additions and 1 deletions

View File

@ -88,6 +88,7 @@ class SettingsForm extends QuickForm
array(
'v2' => $this->translate('Icinga v2.x'),
'v1' => $this->translate('Icinga v1.x'),
'v1-masterless' => $this->translate('Icinga v1.x (no master)'),
)
),
'description' => $this->translate(

View File

@ -90,7 +90,7 @@ class IcingaConfig
public function isLegacy()
{
return $this->configFormat === 'v1';
return strpos($this->configFormat, 'v1') === 0;
}
public function getObjectCount()

View File

@ -1482,6 +1482,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
if (
$this->getResolvedProperty('zone_id')
&& array_key_exists('enable_active_checks', $this->defaultProperties)
&& $config->getConfigFormat() !== 'v1-masterless'
) {
$passive = clone($this);
$passive->enable_active_checks = false;