mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 01:04:09 +02:00
Implement enable/disable event handling for hosts/services
Added action and mask for enabling/disabling event handling of hosts and services. refs #4355
This commit is contained in:
parent
1c7a90e79f
commit
fe0d000a02
@ -309,6 +309,40 @@ class Monitoring_CommandController extends ModuleActionController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function enableeventhandlingAction()
|
||||||
|
{
|
||||||
|
$form = new SendCommand("Enable event handler?");
|
||||||
|
if ($this->_request->isPost()) {
|
||||||
|
if ($form->isValid()) {
|
||||||
|
$targets = $this->selectCommandTargets($form->getHosts(), $form->getServices());
|
||||||
|
$this->target->enableEventHandler($targets);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$form->setServices($this->getParameter("services", false));
|
||||||
|
$form->setHosts($this->getParameter("hosts"));
|
||||||
|
$form->setAction($this->view->url());
|
||||||
|
$form->addSubmitButton("Commit");
|
||||||
|
$this->view->form = $form;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function disableeventhandlingAction()
|
||||||
|
{
|
||||||
|
$form = new SendCommand("Disable event handler?");
|
||||||
|
if ($this->_request->isPost()) {
|
||||||
|
if ($form->isValid()) {
|
||||||
|
$targets = $this->selectCommandTargets($form->getHosts(), $form->getServices());
|
||||||
|
$this->target->disableEventHandler($targets);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$form->setServices($this->getParameter("services", false));
|
||||||
|
$form->setHosts($this->getParameter("hosts"));
|
||||||
|
$form->setAction($this->view->url());
|
||||||
|
$form->addSubmitButton("Commit");
|
||||||
|
$this->view->form = $form;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function sendPassivechecks()
|
public function sendPassivechecks()
|
||||||
{
|
{
|
||||||
if ($this->getMandatoryParameter("enable")) {
|
if ($this->getMandatoryParameter("enable")) {
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
<?= $this->form ?>
|
@ -0,0 +1 @@
|
|||||||
|
<?= $this->form ?>
|
Loading…
x
Reference in New Issue
Block a user