Implement start/stop obsessing hosts/services

Added action and mask to start/stop obsessing
over hosts and services.

refs #4355
This commit is contained in:
Johannes Meyer 2013-07-08 11:38:43 +02:00 committed by Marius Hein
parent 3f88e3322b
commit 9b858b9a82
3 changed files with 36 additions and 0 deletions

View File

@ -411,6 +411,40 @@ class Monitoring_CommandController extends ModuleActionController
}
}
public function startobsessingAction()
{
$form = new SendCommand("Start obsessing?");
if ($this->_request->isPost()) {
if ($form->isValid()) {
$targets = $this->selectCommandTargets($form->getHosts(), $form->getServices());
$this->target->startObsessing($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 stopobsessingAction()
{
$form = new SendCommand("Stop obsessing?");
if ($this->_request->isPost()) {
if ($form->isValid()) {
$targets = $this->selectCommandTargets($form->getHosts(), $form->getServices());
$this->target->stopObsessing($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 sendComment()
{
$author = "AUTHOR"; //@TODO: get from auth backend

View File

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

View File

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