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'); }
/** * Show a host or service */ public function showAction() { $this->setAutorefreshInterval(10); $auth = $this->Auth(); if ($auth->hasPermission('monitoring/command/schedule-check')) { $checkNowForm = new CheckNowCommandForm(); $checkNowForm->setObjects($this->object)->handleRequest(); $this->view->checkNowForm = $checkNowForm; } if (!in_array((int) $this->object->state, array(0, 99))) { if ((bool) $this->object->acknowledged) { if ($auth->hasPermission('monitoring/command/remove-acknowledgement')) { $removeAckForm = new RemoveAcknowledgementCommandForm(); $removeAckForm->setObjects($this->object)->handleRequest(); $this->view->removeAckForm = $removeAckForm; } } } $this->object->populate(); $toggleFeaturesForm = new ToggleObjectFeaturesCommandForm(); $toggleFeaturesForm->setBackend($this->backend)->load($this->object)->setObjects($this->object)->handleRequest(); $this->view->toggleFeaturesForm = $toggleFeaturesForm; if (!empty($this->object->comments) && $auth->hasPermission('monitoring/command/comment/delete')) { $delCommentForm = new DeleteCommentCommandForm(); $delCommentForm->handleRequest(); $this->view->delCommentForm = $delCommentForm; } if (!empty($this->object->downtimes) && $auth->hasPermission('monitoring/command/downtime/delete')) { $delDowntimeForm = new DeleteDowntimeCommandForm(); $delDowntimeForm->handleRequest(); $this->view->delDowntimeForm = $delDowntimeForm; } $this->view->showInstance = $this->backend->select()->from('instance')->count() > 1; $this->view->object = $this->object; }
public function showAction() { $this->setAutorefreshInterval(15); $checkNowForm = new CheckNowCommandForm(); $checkNowForm->setObjects($this->hostList)->handleRequest(); $this->view->checkNowForm = $checkNowForm; $this->hostList->setColumns(array('host_acknowledged', 'host_active_checks_enabled', 'host_display_name', 'host_handled', 'host_in_downtime', 'host_is_flapping', 'host_last_state_change', 'host_name', 'host_notifications_enabled', 'host_passive_checks_enabled', 'host_problem', 'host_state')); $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('object_type', 'host'))->toQueryString()); $this->view->commentsLink = Url::fromRequest()->setPath('monitoring/list/comments'); $this->view->sendCustomNotificationLink = Url::fromRequest()->setPath('monitoring/hosts/send-custom-notification'); }
public function showAction() { $this->setAutorefreshInterval(15); if ($this->Auth()->hasPermission('monitoring/command/schedule-check')) { $checkNowForm = new CheckNowCommandForm(); $checkNowForm->setObjects($this->hostList)->handleRequest(); $this->view->checkNowForm = $checkNowForm; } $acknowledgedObjects = $this->hostList->getAcknowledgedObjects(); if (!empty($acknowledgedObjects)) { $removeAckForm = new RemoveAcknowledgementCommandForm(); $removeAckForm->setObjects($acknowledgedObjects)->handleRequest(); $this->view->removeAckForm = $removeAckForm; } $featureStatus = $this->hostList->getFeatureStatus(); $toggleFeaturesForm = new ToggleObjectFeaturesCommandForm(array('backend' => $this->backend, 'objects' => $this->hostList)); $toggleFeaturesForm->load((object) $featureStatus)->handleRequest(); $this->view->toggleFeaturesForm = $toggleFeaturesForm; $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('object_type', 'host'))->toQueryString()); $this->view->commentsLink = Url::fromRequest()->setPath('monitoring/list/comments'); $this->view->sendCustomNotificationLink = Url::fromRequest()->setPath('monitoring/hosts/send-custom-notification'); }