From a630869bcf528468ced70db9c8d3b2095e67fe3a Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Fri, 4 Sep 2015 15:17:28 +0200 Subject: [PATCH] Provide stats for unhandled problems and improve layout refs #10033 --- .../controllers/HealthController.php | 10 ++- .../views/scripts/health/stats.phtml | 64 +++++++++++++++++-- public/css/icinga/widgets.less | 5 ++ 3 files changed, 71 insertions(+), 8 deletions(-) diff --git a/modules/monitoring/application/controllers/HealthController.php b/modules/monitoring/application/controllers/HealthController.php index c6f239d0c..bbfdcb030 100644 --- a/modules/monitoring/application/controllers/HealthController.php +++ b/modules/monitoring/application/controllers/HealthController.php @@ -129,6 +129,9 @@ class HealthController extends Controller )); $this->applyRestriction('monitoring/filter/objects', $servicestats); $this->view->servicestats = $servicestats->fetchRow(); + $this->view->unhandledServiceProblems = $this->view->servicestats->services_critical_unhandled + + $this->view->servicestats->services_unknown_unhandled + + $this->view->servicestats->services_warning_unhandled; $hoststats = $this->backend->select()->from('hoststatussummary', array( 'hosts_total', @@ -142,7 +145,12 @@ class HealthController extends Controller 'hosts_pending', )); $this->applyRestriction('monitoring/filter/objects', $hoststats); - $this->view->hoststats = $hoststats; + $this->view->hoststats = $hoststats->fetchRow(); + $this->view->unhandledhostProblems = $this->view->hoststats->hosts_down_unhandled + + $this->view->hoststats->hosts_unreachable_unhandled; + + $this->view->unhandledProblems = $this->view->unhandledhostProblems + + $this->view->unhandledServiceProblems; $this->view->runtimevariables = (object) $this->backend->select() ->from('runtimevariables', array('varname', 'varvalue')) diff --git a/modules/monitoring/application/views/scripts/health/stats.phtml b/modules/monitoring/application/views/scripts/health/stats.phtml index 30828cec7..275fbf4f8 100644 --- a/modules/monitoring/application/views/scripts/health/stats.phtml +++ b/modules/monitoring/application/views/scripts/health/stats.phtml @@ -9,16 +9,56 @@ if (! $this->compact): ?>
-
-
+

unhandledProblems ?> translate('Unhandled Problems:') ?> + unhandledProblems ?> +

+ + + + + + + + + + + +
translate('Service Problems:') ?> + + qlink( + $this->unhandledServiceProblems, + 'monitoring/list/services?service_problem=1&service_handled=0&sort=service_severity' + ) + ?> + +
translate('Host Problems:') ?> + + qlink( + $this->unhandledhostProblems, + 'monitoring/list/hosts?host_problem=1&host_handled=0' + ) + ?> + +
+
+

stats = $hoststats ?> render('list/components/hostssummary.phtml') ?>

- + + + + + + + + @@ -30,17 +70,17 @@ if (! $this->compact): ?>
translate('Runtime Variables') ?>translate('Host Checks') ?>
translate('Total') ?>
+

stats = $servicestats ?> render('list/components/servicesummary.phtml') ?>

- - - + + @@ -60,12 +100,13 @@ if (! $this->compact): ?>
translate('Amount') ?> translate('Runtime Variables') ?> translate('Service Checks') ?> translate('Per Host') ?>
+

translate('Active checks') ?>

- + @@ -86,9 +127,18 @@ if (! $this->compact): ?>
translate('Check Performance') ?> translate('Checks') ?> translate('Latency') ?> translate('Execution time') ?>
+

translate('Passive checks') ?>

+ + + + + + + + diff --git a/public/css/icinga/widgets.less b/public/css/icinga/widgets.less index 95b64429a..9f884e746 100644 --- a/public/css/icinga/widgets.less +++ b/public/css/icinga/widgets.less @@ -234,6 +234,11 @@ li li .badge-container { background-color: @colorInvalid; } +.badge a[href] { + color: white; + text-decoration: none; +} + #menu nav ul .badge { margin-right: 0em; top: 0.3em;
translate('Check Performance') ?> translate('Passive Checks') ?>
translate('Host Checks') ?>