From f102f75eb95b28b16a1f49ad52cae03ad2710991 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 9 Jul 2013 13:50:07 +0200 Subject: [PATCH] Implement command to delay notifications Added command and mask to delay notifications for hosts/services. refs #4355 --- .../controllers/CommandController.php | 19 +++++++++++++++++++ .../scripts/command/delaynotification.phtml | 1 + 2 files changed, 20 insertions(+) create mode 100644 modules/monitoring/application/views/scripts/command/delaynotification.phtml diff --git a/modules/monitoring/application/controllers/CommandController.php b/modules/monitoring/application/controllers/CommandController.php index de9a652b0..f3bc2ae4a 100644 --- a/modules/monitoring/application/controllers/CommandController.php +++ b/modules/monitoring/application/controllers/CommandController.php @@ -541,6 +541,25 @@ class Monitoring_CommandController extends ModuleActionController } } + public function delaynotificationAction() + { + $form = new SendCommand("Delay a notification"); + $form->addNumberBox("delay", "Notification delay (minutes from now):"); + + if ($this->_request->isPost()) { + if ($form->isValid()) { + $targets = $this->selectCommandTargets($form->getHosts(), $form->getServices()); + $this->target->delayNotification($targets, $form->getNumber("delay")); + } + } 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/delaynotification.phtml b/modules/monitoring/application/views/scripts/command/delaynotification.phtml new file mode 100644 index 000000000..4bae1498a --- /dev/null +++ b/modules/monitoring/application/views/scripts/command/delaynotification.phtml @@ -0,0 +1 @@ +form ?> \ No newline at end of file