mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-20 12:24:29 +02:00
Enable propagate host downtime commands for Icinga 2
This only works when using the latest Icinga 2 snapshot packages. Before releasing Web 2.4.0, we have to include a check to only offer these commands when using Icinga 2 2.6.0+ refs #10774
This commit is contained in:
parent
2b060d9bd4
commit
93474972bf
@ -34,24 +34,22 @@ class ScheduleHostDowntimeCommandForm extends ScheduleServiceDowntimeCommandForm
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! $this->getBackend()->isIcinga2()) {
|
$this->addElement(
|
||||||
$this->addElement(
|
'select',
|
||||||
'select',
|
'child_hosts',
|
||||||
'child_hosts',
|
array(
|
||||||
array(
|
'description' => $this->translate(
|
||||||
'description' => $this->translate(
|
'Define what should be done with the child hosts of the hosts.'
|
||||||
'Define what should be done with the child hosts of the hosts.'
|
),
|
||||||
),
|
'label' => $this->translate('Child Hosts'),
|
||||||
'label' => $this->translate('Child Hosts'),
|
'multiOptions' => array(
|
||||||
'multiOptions' => array(
|
0 => $this->translate('Do nothing with child hosts'),
|
||||||
0 => $this->translate('Do nothing with child hosts'),
|
1 => $this->translate('Schedule triggered downtime for all child hosts'),
|
||||||
1 => $this->translate('Schedule triggered downtime for all child hosts'),
|
2 => $this->translate('Schedule non-triggered downtime for all child hosts')
|
||||||
2 => $this->translate('Schedule non-triggered downtime for all child hosts')
|
),
|
||||||
),
|
'value' => 0
|
||||||
'value' => 0
|
)
|
||||||
)
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ use Icinga\Module\Monitoring\Command\Object\AddCommentCommand;
|
|||||||
use Icinga\Module\Monitoring\Command\Object\DeleteCommentCommand;
|
use Icinga\Module\Monitoring\Command\Object\DeleteCommentCommand;
|
||||||
use Icinga\Module\Monitoring\Command\Object\DeleteDowntimeCommand;
|
use Icinga\Module\Monitoring\Command\Object\DeleteDowntimeCommand;
|
||||||
use Icinga\Module\Monitoring\Command\Object\ProcessCheckResultCommand;
|
use Icinga\Module\Monitoring\Command\Object\ProcessCheckResultCommand;
|
||||||
|
use Icinga\Module\Monitoring\Command\Object\PropagateHostDowntimeCommand;
|
||||||
use Icinga\Module\Monitoring\Command\Object\RemoveAcknowledgementCommand;
|
use Icinga\Module\Monitoring\Command\Object\RemoveAcknowledgementCommand;
|
||||||
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceCheckCommand;
|
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceCheckCommand;
|
||||||
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceDowntimeCommand;
|
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceDowntimeCommand;
|
||||||
@ -148,6 +149,12 @@ class IcingaApiCommandRenderer implements IcingaCommandRendererInterface
|
|||||||
'fixed' => $command->getFixed(),
|
'fixed' => $command->getFixed(),
|
||||||
'trigger_name' => $command->getTriggerId()
|
'trigger_name' => $command->getTriggerId()
|
||||||
);
|
);
|
||||||
|
if ($command->getObject()->getType() === $command::TYPE_HOST
|
||||||
|
&& $command instanceof PropagateHostDowntimeCommand
|
||||||
|
) {
|
||||||
|
/** @var \Icinga\Module\Monitoring\Command\Object\PropagateHostDowntimeCommand $command */
|
||||||
|
$data['child_options'] = $command->getTriggered() ? 1 : 2;
|
||||||
|
}
|
||||||
$this->applyFilter($data, $command->getObject());
|
$this->applyFilter($data, $command->getObject());
|
||||||
return IcingaApiCommand::create($endpoint, $data);
|
return IcingaApiCommand::create($endpoint, $data);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user