コード例 #1
0
 public function showAction()
 {
     $this->setAutorefreshInterval(15);
     $checkNowForm = new CheckNowCommandForm();
     $checkNowForm->setObjects($this->serviceList)->handleRequest();
     $this->view->checkNowForm = $checkNowForm;
     $this->serviceList->setColumns(array('host_icon_image', 'host_icon_image_alt', 'host_name', 'host_address', 'host_output', 'host_state', 'host_problem', 'host_handled', 'service_icon_image', 'service_icon_image_alt', 'service_output', 'service_description', 'service_state', 'service_problem', 'service_handled', 'service_acknowledged', 'service_in_downtime', 'service_is_flapping', 'service_notifications_enabled', 'service_active_checks_enabled', 'service_passive_checks_enabled'));
     $acknowledgedObjects = $this->serviceList->getAcknowledgedObjects();
     if (!empty($acknowledgedObjects)) {
         $removeAckForm = new RemoveAcknowledgementCommandForm();
         $removeAckForm->setObjects($acknowledgedObjects)->handleRequest();
         $this->view->removeAckForm = $removeAckForm;
     }
     $this->setAutorefreshInterval(15);
     $this->view->rescheduleAllLink = Url::fromRequest()->setPath('monitoring/services/reschedule-check');
     $this->view->downtimeAllLink = Url::fromRequest()->setPath('monitoring/services/schedule-downtime');
     $this->view->processCheckResultAllLink = Url::fromRequest()->setPath('monitoring/services/process-check-result');
     $this->view->addCommentLink = Url::fromRequest()->setPath('monitoring/services/add-comment');
     $this->view->deleteCommentLink = Url::fromRequest()->setPath('monitoring/services/delete-comment');
     $this->view->stats = $this->serviceList->getServiceStateSummary();
     $this->view->objects = $this->serviceList;
     $this->view->unhandledObjects = $this->serviceList->getUnhandledObjects();
     $this->view->problemObjects = $this->serviceList->getProblemObjects();
     $this->view->downtimeUnhandledLink = Url::fromPath('monitoring/services/schedule-downtime')->setQueryString($this->serviceList->getUnhandledObjects()->objectsFilter()->toQueryString());
     $this->view->downtimeLink = Url::fromPath('monitoring/services/schedule-downtime')->setQueryString($this->serviceList->getProblemObjects()->objectsFilter()->toQueryString());
     $this->view->acknowledgedObjects = $acknowledgedObjects;
     $this->view->acknowledgeLink = Url::fromPath('monitoring/services/acknowledge-problem')->setQueryString($this->serviceList->getUnacknowledgedObjects()->objectsFilter()->toQueryString());
     $this->view->unacknowledgedObjects = $this->serviceList->getUnacknowledgedObjects();
     $this->view->objectsInDowntime = $this->serviceList->getObjectsInDowntime();
     $this->view->inDowntimeLink = Url::fromPath('monitoring/list/services')->setQueryString($this->serviceList->getObjectsInDowntime()->objectsFilter(array('host' => 'host_name', 'service' => 'service_description'))->toQueryString());
     $this->view->showDowntimesLink = Url::fromPath('monitoring/downtimes/show')->setQueryString($this->serviceList->getObjectsInDowntime()->objectsFilter()->toQueryString());
     $this->view->commentsLink = Url::fromRequest()->setPath('monitoring/list/comments');
     $this->view->sendCustomNotificationLink = Url::fromRequest()->setPath('monitoring/services/send-custom-notification');
 }
コード例 #2
0
 public function showAction()
 {
     $this->setAutorefreshInterval(15);
     if ($this->Auth()->hasPermission('monitoring/command/schedule-check')) {
         $checkNowForm = new CheckNowCommandForm();
         $checkNowForm->setObjects($this->serviceList)->handleRequest();
         $this->view->checkNowForm = $checkNowForm;
     }
     $acknowledgedObjects = $this->serviceList->getAcknowledgedObjects();
     if (!empty($acknowledgedObjects)) {
         $removeAckForm = new RemoveAcknowledgementCommandForm();
         $removeAckForm->setObjects($acknowledgedObjects)->handleRequest();
         $this->view->removeAckForm = $removeAckForm;
     }
     $featureStatus = $this->serviceList->getFeatureStatus();
     $toggleFeaturesForm = new ToggleObjectFeaturesCommandForm(array('backend' => $this->backend, 'objects' => $this->serviceList));
     $toggleFeaturesForm->load((object) $featureStatus)->handleRequest();
     $this->view->toggleFeaturesForm = $toggleFeaturesForm;
     $this->setAutorefreshInterval(15);
     $this->view->rescheduleAllLink = Url::fromRequest()->setPath('monitoring/services/reschedule-check');
     $this->view->downtimeAllLink = Url::fromRequest()->setPath('monitoring/services/schedule-downtime');
     $this->view->processCheckResultAllLink = Url::fromRequest()->setPath('monitoring/services/process-check-result');
     $this->view->addCommentLink = Url::fromRequest()->setPath('monitoring/services/add-comment');
     $this->view->deleteCommentLink = Url::fromRequest()->setPath('monitoring/services/delete-comment');
     $this->view->stats = $this->serviceList->getServiceStateSummary();
     $this->view->objects = $this->serviceList;
     $this->view->unhandledObjects = $this->serviceList->getUnhandledObjects();
     $this->view->problemObjects = $this->serviceList->getProblemObjects();
     $this->view->downtimeUnhandledLink = Url::fromPath('monitoring/services/schedule-downtime')->setQueryString($this->serviceList->getUnhandledObjects()->objectsFilter()->toQueryString());
     $this->view->downtimeLink = Url::fromPath('monitoring/services/schedule-downtime')->setQueryString($this->serviceList->getProblemObjects()->objectsFilter()->toQueryString());
     $this->view->acknowledgedObjects = $acknowledgedObjects;
     $this->view->acknowledgeLink = Url::fromPath('monitoring/services/acknowledge-problem')->setQueryString($this->serviceList->getUnacknowledgedObjects()->objectsFilter()->toQueryString());
     $this->view->unacknowledgedObjects = $this->serviceList->getUnacknowledgedObjects();
     $this->view->objectsInDowntime = $this->serviceList->getObjectsInDowntime();
     $this->view->inDowntimeLink = Url::fromPath('monitoring/list/services')->setQueryString($this->serviceList->getObjectsInDowntime()->objectsFilter(array('host' => 'host_name', 'service' => 'service_description'))->toQueryString());
     $this->view->showDowntimesLink = Url::fromPath('monitoring/downtimes/show')->setQueryString($this->serviceList->getObjectsInDowntime()->objectsFilter()->andFilter(Filter::where('object_type', 'service'))->toQueryString());
     $this->view->commentsLink = Url::fromRequest()->setPath('monitoring/list/comments');
     $this->view->sendCustomNotificationLink = Url::fromRequest()->setPath('monitoring/services/send-custom-notification');
 }