mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 17:24:16 +02:00
Implement enable/disable passive checks for hosts/services
Added action and mask to enable/disable passive checks for hosts and services. refs #4355
This commit is contained in:
parent
1138afd5fb
commit
3f88e3322b
@ -377,12 +377,37 @@ class Monitoring_CommandController extends ModuleActionController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendPassivechecks()
|
public function enablepassivechecksAction()
|
||||||
{
|
{
|
||||||
if ($this->getMandatoryParameter("enable")) {
|
$form = new SendCommand("Enable passive checks?");
|
||||||
$this->target->enablePassiveChecks($this->selectCommandTargets());
|
if ($this->_request->isPost()) {
|
||||||
|
if ($form->isValid()) {
|
||||||
|
$targets = $this->selectCommandTargets($form->getHosts(), $form->getServices());
|
||||||
|
$this->target->enablePassiveChecks($targets);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->target->disablePassiveChecks($this->selectCommandTargets());
|
$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 disablepassivechecksAction()
|
||||||
|
{
|
||||||
|
$form = new SendCommand("Disable passive checks?");
|
||||||
|
if ($this->_request->isPost()) {
|
||||||
|
if ($form->isValid()) {
|
||||||
|
$targets = $this->selectCommandTargets($form->getHosts(), $form->getServices());
|
||||||
|
$this->target->disablePassiveChecks($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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
<?= $this->form ?>
|
@ -0,0 +1 @@
|
|||||||
|
<?= $this->form ?>
|
Loading…
x
Reference in New Issue
Block a user