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:
Johannes Meyer 2013-07-08 11:11:47 +02:00 committed by Marius Hein
parent 1c7a90e79f
commit fe0d000a02
3 changed files with 36 additions and 0 deletions

View File

@ -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()
{
if ($this->getMandatoryParameter("enable")) {

View File

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

View File

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