diff --git a/modules/monitoring/application/controllers/CommandController.php b/modules/monitoring/application/controllers/CommandController.php index ab1723f0b..c929bf23d 100644 --- a/modules/monitoring/application/controllers/CommandController.php +++ b/modules/monitoring/application/controllers/CommandController.php @@ -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 diff --git a/modules/monitoring/application/views/scripts/command/startobsessing.phtml b/modules/monitoring/application/views/scripts/command/startobsessing.phtml new file mode 100644 index 000000000..4bae1498a --- /dev/null +++ b/modules/monitoring/application/views/scripts/command/startobsessing.phtml @@ -0,0 +1 @@ +form ?> \ No newline at end of file diff --git a/modules/monitoring/application/views/scripts/command/stopobsessing.phtml b/modules/monitoring/application/views/scripts/command/stopobsessing.phtml new file mode 100644 index 000000000..4bae1498a --- /dev/null +++ b/modules/monitoring/application/views/scripts/command/stopobsessing.phtml @@ -0,0 +1 @@ +form ?> \ No newline at end of file