diff --git a/modules/monitoring/application/controllers/CommandController.php b/modules/monitoring/application/controllers/CommandController.php index 5610c6a94..ab1723f0b 100644 --- a/modules/monitoring/application/controllers/CommandController.php +++ b/modules/monitoring/application/controllers/CommandController.php @@ -377,12 +377,37 @@ class Monitoring_CommandController extends ModuleActionController } } - public function sendPassivechecks() + public function enablepassivechecksAction() { - if ($this->getMandatoryParameter("enable")) { - $this->target->enablePassiveChecks($this->selectCommandTargets()); + $form = new SendCommand("Enable passive checks?"); + if ($this->_request->isPost()) { + if ($form->isValid()) { + $targets = $this->selectCommandTargets($form->getHosts(), $form->getServices()); + $this->target->enablePassiveChecks($targets); + } } 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; } } diff --git a/modules/monitoring/application/views/scripts/command/disablepassivechecks.phtml b/modules/monitoring/application/views/scripts/command/disablepassivechecks.phtml new file mode 100644 index 000000000..4bae1498a --- /dev/null +++ b/modules/monitoring/application/views/scripts/command/disablepassivechecks.phtml @@ -0,0 +1 @@ +form ?> \ No newline at end of file diff --git a/modules/monitoring/application/views/scripts/command/enablepassivechecks.phtml b/modules/monitoring/application/views/scripts/command/enablepassivechecks.phtml new file mode 100644 index 000000000..4bae1498a --- /dev/null +++ b/modules/monitoring/application/views/scripts/command/enablepassivechecks.phtml @@ -0,0 +1 @@ +form ?> \ No newline at end of file