diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 285ca50ee..5a2521784 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -167,6 +167,12 @@ class Monitoring_ListController extends MonitoringController 'title' => 'Services Status', 'url' => Url::fromPath('monitoring/list/services') ))->activate('services'); + $this->view->showHost = true; + if ($host = $this->_getParam('host')) { + if (strpos($host, '*') === false) { + $this->view->showHost = false; + } + } $this->view->title = 'Service Status'; $this->setAutorefreshInterval(10); $query = $this->fetchServices(); diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 1b65e8502..e25af462d 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -107,9 +107,12 @@ class Monitoring_ShowController extends Controller public function servicesAction() { $this->getTabs()->activate('services'); - $params = $this->_request->getParams(); - unset($params['service']); - $this->view->services = $this->fetchServices($params)->paginate(); + $this->_setParam('service', null); + $this->view->services = $this->view->action('services', 'list', 'monitoring', array( + 'view' => 'compact', + 'limit' => '', + 'sort' => 'service_description', + )); } @@ -160,7 +163,21 @@ class Monitoring_ShowController extends Controller $params['service'] = $object->service_description; } elseif ($service = $this->_getParam('service')) { $params['service'] = $service; + } elseif ($service = $this->_getParam('active_service')) { + $params['service'] = $service; } + $servicesParams = $params; + $servicesParams['active_service'] = $servicesParams['service']; + unset($servicesParams['service']); + $tabs->add( + 'host', + array( + 'title' => 'Host', + 'icon' => 'img/icons/host.png', + 'url' => 'monitoring/show/host', + 'urlParams' => $params, + ) + ); if (isset($params['service'])) { $tabs->add( 'service', @@ -172,22 +189,13 @@ class Monitoring_ShowController extends Controller ) ); } - $tabs->add( - 'host', - array( - 'title' => 'Host', - 'icon' => 'img/icons/host.png', - 'url' => 'monitoring/show/host', - 'urlParams' => $params, - ) - ); $tabs->add( 'services', array( 'title' => 'Services', 'icon' => 'img/icons/service.png', 'url' => 'monitoring/show/services', - 'urlParams' => $params, + 'urlParams' => $servicesParams, ) ); $tabs->add( diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index a17a8c96c..5c5a00ea3 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -82,11 +82,11 @@ foreach ($services as $service): service_icon_image): ?> icon($this->resolveMacros($service->service_icon_image, $service)) ?> -service_display_name ?> on host_name; ?> +service_display_name ?>showHost): ?> on host_name; ?> host_state != 0): ?> (monitoringState($service, 'host')); ?>) -
+

escape(substr(strip_tags($service->service_output), 0, 10000)); ?>

diff --git a/modules/monitoring/application/views/scripts/show/services.phtml b/modules/monitoring/application/views/scripts/show/services.phtml index d629e1db8..502debacb 100644 --- a/modules/monitoring/application/views/scripts/show/services.phtml +++ b/modules/monitoring/application/views/scripts/show/services.phtml @@ -1,4 +1,6 @@
render('show/components/header.phtml') ?>
+
+