Implement command to submit passive check results

Added command and mask to submit passive check
results for hosts/services.

refs #4355
This commit is contained in:
Johannes Meyer 2013-07-08 16:35:00 +02:00 committed by Marius Hein
parent 23e15e3f54
commit 101a1f093f
2 changed files with 24 additions and 0 deletions

View File

@ -487,6 +487,29 @@ class Monitoring_CommandController extends ModuleActionController
}
}
public function submitcheckresultAction()
{
// @TODO: How should the "perfdata" be handled? (The interface function does not accept it)
$form = new SendCommand("Submit passive check result");
$form->addChoice("state", "Check result:", array("UP", "DOWN", "UNREACHABLE"));
$form->addTextBox("output", "Check output:", "", false, true);
$form->addTextBox("perfdata", "Performance data:", "", false, true);
if ($this->_request->isPost()) {
if ($form->isValid()) {
$targets = $this->selectCommandTargets($form->getHosts(), $form->getServices());
$this->target->submitCheckResult($targets, $form->getChoice("state"),
$form->getText("output"));
}
} 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 ?>