Beispiel #1
0
 public function init()
 {
     $hostList = new HostList($this->backend);
     $this->applyRestriction('monitoring/filter/objects', $hostList);
     $hostList->addFilter(Filter::fromQueryString((string) $this->params));
     $this->hostList = $hostList;
     $this->view->baseFilter = $this->hostList->getFilter();
     $this->getTabs()->add('show', array('label' => $this->translate('Hosts') . sprintf(' (%d)', count($this->hostList)), 'title' => sprintf($this->translate('Show summarized information for %u hosts'), count($this->hostList)), 'url' => Url::fromRequest()))->extend(new DashboardAction())->extend(new MenuAction())->activate('show');
     $this->view->listAllLink = Url::fromRequest()->setPath('monitoring/list/hosts');
 }
Beispiel #2
0
 public function init()
 {
     $hostList = new HostList($this->backend);
     $this->applyRestriction('monitoring/filter/objects', $hostList);
     $hostList->addFilter(Filter::fromQueryString((string) $this->params));
     $this->hostList = $hostList;
     $this->hostList->setColumns(array('host_acknowledged', 'host_active_checks_enabled', 'host_display_name', 'host_event_handler_enabled', 'host_flap_detection_enabled', 'host_handled', 'host_in_downtime', 'host_is_flapping', 'host_last_state_change', 'host_name', 'host_notifications_enabled', 'host_obsessing', 'host_passive_checks_enabled', 'host_problem', 'host_state', 'instance_name'));
     $this->view->baseFilter = $this->hostList->getFilter();
     $this->getTabs()->add('show', array('label' => $this->translate('Hosts') . sprintf(' (%d)', count($this->hostList)), 'title' => sprintf($this->translate('Show summarized information for %u hosts'), count($this->hostList)), 'url' => Url::fromRequest()))->extend(new DashboardAction())->extend(new MenuAction())->activate('show');
     $this->view->listAllLink = Url::fromRequest()->setPath('monitoring/list/hosts');
 }
 public function showAction()
 {
     $this->setAutorefreshInterval(15);
     $checkNowForm = new CheckNowCommandForm();
     $checkNowForm->setObjects($this->hostList)->handleRequest();
     $this->view->checkNowForm = $checkNowForm;
     $this->hostList->setColumns(array('host_icon_image', 'host_icon_image_alt', 'host_name', 'host_address', 'host_state', 'host_problem', 'host_handled', 'host_acknowledged', 'host_in_downtime', 'host_last_ack', 'host_is_flapping', 'host_last_comment', 'host_output', 'host_notifications_enabled', 'host_active_checks_enabled', 'host_passive_checks_enabled'));
     $acknowledgedObjects = $this->hostList->getAcknowledgedObjects();
     if (!empty($acknowledgedObjects)) {
         $removeAckForm = new RemoveAcknowledgementCommandForm();
         $removeAckForm->setObjects($acknowledgedObjects)->handleRequest();
         $this->view->removeAckForm = $removeAckForm;
     }
     $hostStates = $this->hostList->getStateSummary();
     $this->setAutorefreshInterval(15);
     $this->view->rescheduleAllLink = Url::fromRequest()->setPath('monitoring/hosts/reschedule-check');
     $this->view->downtimeAllLink = Url::fromRequest()->setPath('monitoring/hosts/schedule-downtime');
     $this->view->processCheckResultAllLink = Url::fromRequest()->setPath('monitoring/hosts/process-check-result');
     $this->view->addCommentLink = Url::fromRequest()->setPath('monitoring/hosts/add-comment');
     $this->view->stats = $hostStates;
     $this->view->objects = $this->hostList;
     $this->view->unhandledObjects = $this->hostList->getUnhandledObjects();
     $this->view->problemObjects = $this->hostList->getProblemObjects();
     $this->view->acknowledgeUnhandledLink = Url::fromPath('monitoring/hosts/acknowledge-problem')->setQueryString($this->hostList->getUnhandledObjects()->objectsFilter()->toQueryString());
     $this->view->downtimeUnhandledLink = Url::fromPath('monitoring/hosts/schedule-downtime')->setQueryString($this->hostList->getUnhandledObjects()->objectsFilter()->toQueryString());
     $this->view->downtimeLink = Url::fromPath('monitoring/hosts/schedule-downtime')->setQueryString($this->hostList->getProblemObjects()->objectsFilter()->toQueryString());
     $this->view->acknowledgedObjects = $this->hostList->getAcknowledgedObjects();
     $this->view->acknowledgeLink = Url::fromPath('monitoring/hosts/acknowledge-problem')->setQueryString($this->hostList->getUnacknowledgedObjects()->objectsFilter()->toQueryString());
     $this->view->unacknowledgedObjects = $this->hostList->getUnacknowledgedObjects();
     $this->view->objectsInDowntime = $this->hostList->getObjectsInDowntime();
     $this->view->inDowntimeLink = Url::fromPath('monitoring/list/hosts')->setQueryString($this->hostList->getObjectsInDowntime()->objectsFilter()->toQueryString());
     $this->view->showDowntimesLink = Url::fromPath('monitoring/list/downtimes')->setQueryString($this->hostList->objectsFilter()->andFilter(FilterEqual::where('downtime_objecttype', 'host'))->toQueryString());
     $this->view->commentsLink = Url::fromRequest()->setPath('monitoring/list/comments');
     $this->view->baseFilter = $this->hostList->getFilter();
     $this->view->sendCustomNotificationLink = Url::fromRequest()->setPath('monitoring/hosts/send-custom-notification');
 }