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:
Johannes Meyer 2013-07-08 11:38:05 +02:00 committed by Marius Hein
parent 1138afd5fb
commit 3f88e3322b
3 changed files with 31 additions and 4 deletions

View File

@ -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;
}
}

View File

@ -0,0 +1 @@
<?= $this->form ?>

View File

@ -0,0 +1 @@
<?= $this->form ?>