From e8a626e8960a31d95eb8970d7144385ceacf5651 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 7 Mar 2014 16:43:22 +0100 Subject: [PATCH] Change the way how boxed status information is presented to the user --- .../controllers/ListController.php | 10 +- .../controllers/TacticalController.php | 14 +- .../views/scripts/list/hostgroups.phtml | 173 ++++--- .../views/scripts/list/servicegroups.phtml | 483 +++++++++--------- .../tactical/components/ok_hosts.phtml | 6 +- .../servicestatesummarybyhoststate.phtml | 60 ++- .../tactical/components/problem_hosts.phtml | 42 +- .../views/scripts/tactical/index.phtml | 1 + .../Backend/Ido/Query/StatusSummaryQuery.php | 12 +- .../Monitoring/DataView/ServiceStatus.php | 1 + .../Monitoring/DataView/StatusSummary.php | 12 +- 11 files changed, 435 insertions(+), 379 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index eba6e56cb..285ca50ee 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -390,17 +390,17 @@ class Monitoring_ListController extends MonitoringController array( 'hostgroup', 'hosts_up', - 'hosts_unreachable', + 'hosts_unreachable_handled', 'hosts_unreachable_unhandled', - 'hosts_down', + 'hosts_down_handled', 'hosts_down_unhandled', 'hosts_pending', 'services_ok', - 'services_unknown', + 'services_unknown_handled', 'services_unknown_unhandled', - 'services_critical', + 'services_critical_handled', 'services_critical_unhandled', - 'services_warning', + 'services_warning_handled', 'services_warning_unhandled', 'services_pending' ) diff --git a/modules/monitoring/application/controllers/TacticalController.php b/modules/monitoring/application/controllers/TacticalController.php index f7df84091..104112cf4 100644 --- a/modules/monitoring/application/controllers/TacticalController.php +++ b/modules/monitoring/application/controllers/TacticalController.php @@ -25,12 +25,10 @@ class Monitoring_TacticalController extends MonitoringController 'hosts_up_not_checked', 'hosts_pending', 'hosts_pending_not_checked', - 'hosts_down', 'hosts_down_handled', 'hosts_down_unhandled', 'hosts_down_passive', 'hosts_down_not_checked', - 'hosts_unreachable', 'hosts_unreachable_handled', 'hosts_unreachable_unhandled', 'hosts_unreachable_passive', @@ -40,15 +38,15 @@ class Monitoring_TacticalController extends MonitoringController 'services_ok_not_checked_on_ok_hosts', 'services_pending_on_ok_hosts', 'services_pending_not_checked_on_ok_hosts', - 'services_warning_on_ok_hosts', + 'services_warning_handled_on_ok_hosts', 'services_warning_unhandled_on_ok_hosts', 'services_warning_passive_on_ok_hosts', 'services_warning_not_checked_on_ok_hosts', - 'services_critical_on_ok_hosts', + 'services_critical_handled_on_ok_hosts', 'services_critical_unhandled_on_ok_hosts', 'services_critical_passive_on_ok_hosts', 'services_critical_not_checked_on_ok_hosts', - 'services_unknown_on_ok_hosts', + 'services_unknown_handled_on_ok_hosts', 'services_unknown_unhandled_on_ok_hosts', 'services_unknown_passive_on_ok_hosts', 'services_unknown_not_checked_on_ok_hosts', @@ -56,15 +54,15 @@ class Monitoring_TacticalController extends MonitoringController 'services_ok_not_checked_on_problem_hosts', 'services_pending_on_problem_hosts', 'services_pending_not_checked_on_problem_hosts', - 'services_warning_on_problem_hosts', + 'services_warning_handled_on_problem_hosts', 'services_warning_unhandled_on_problem_hosts', 'services_warning_passive_on_problem_hosts', 'services_warning_not_checked_on_problem_hosts', - 'services_critical_on_problem_hosts', + 'services_critical_handled_on_problem_hosts', 'services_critical_unhandled_on_problem_hosts', 'services_critical_passive_on_problem_hosts', 'services_critical_not_checked_on_problem_hosts', - 'services_unknown_on_problem_hosts', + 'services_unknown_handled_on_problem_hosts', 'services_unknown_unhandled_on_problem_hosts', 'services_unknown_passive_on_problem_hosts', 'services_unknown_not_checked_on_problem_hosts', diff --git a/modules/monitoring/application/views/scripts/list/hostgroups.phtml b/modules/monitoring/application/views/scripts/list/hostgroups.phtml index b6df1bd0a..55a54a281 100644 --- a/modules/monitoring/application/views/scripts/list/hostgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/hostgroups.phtml @@ -14,25 +14,16 @@ - - + +
HostsServicestranslate('Hosts'); ?>translate('Services'); ?>
-hosts_down): ?> +hosts_down_handled || $h->hosts_down_unhandled): ?>
- - hosts_down ?> DOWN - hosts_down_unhandled): ?> - hosts_down_unhandled ?> Unhandled + hosts_down_unhandled; ?> DOWN + + +hosts_down_handled): ?> + + hosts_down_handled . ' ' . ($h->hosts_down_unhandled ? $this->translate('Acknowledged') : 'DOWN'); ?>
-hosts_unreachable): ?> +hosts_unreachable_handled || $h->hosts_unreachable_unhandled): ?>
- - hosts_unreachable ?> UNREACHABLE - hosts_unreachable_unhandled): ?> - hosts_unreachable_unhandled ?> Unhandled + hosts_unreachable_unhandled; ?> UNREACHABLE + + +hosts_unreachable_handled): ?> + + hosts_unreachable_handled . ' ' . ($h->hosts_unreachable_unhandled ? $this->translate('Acknowledged') : 'UNREACHABLE'); ?>
@@ -85,7 +91,7 @@ 'hostgroup' => $h->hostgroup ) ); ?>" title="Hosts UP"> - hosts_up ?> UP + hosts_up; ?> UP @@ -100,91 +106,110 @@ 'hostgroup' => $h->hostgroup ) ); ?>" title="Hosts PENDING"> - hosts_pending ?> PENDING + hosts_pending; ?> PENDING
-services_critical): ?> +services_critical_handled || $h->services_critical_unhandled): ?>
- - services_critical ?> CRITICAL - services_critical_unhandled): ?> + + services_critical_unhandled; ?> CRITICAL + + +services_critical_handled): ?> - services_critical_unhandled ?> Unhandled + ); ?>" title="Services CRITICAL Handled"> + services_critical_handled . ' ' . ($h->services_critical_unhandled ? $this->translate('Acknowledged') : 'CRITICAL'); ?>
-services_warning): ?> +services_warning_handled || $h->services_warning_unhandled): ?>
- - services_warning ?> WARNING - services_warning_unhandled): ?> - services_warning_unhandled ?> Unhandled + services_warning_unhandled; ?> WARNING + + +services_warning_handled): ?> + + services_warning_handled . ' ' . ($h->services_warning_unhandled ? $this->translate('Acknowledged') : 'WARNING'); ?>
-services_unknown): ?> +services_unknown_handled || $h->services_unknown_unhandled): ?> -
- - services_unknown ?> UNKNOWN - +
services_unknown_unhandled): ?> - services_unknown_unhandled ?> Unhandled + services_unknown_unhandled; ?> UNKNOWN + + +services_unknown_handled): ?> + + services_unknown_handled . ' ' . ($h->services_unknown_unhandled ? $this->translate('Acknowledged') : 'UNKNOWN'); ?>
@@ -197,10 +222,11 @@ 'monitoring/list/services', array( 'service_state' => 0, - 'hostgroup' => $h->hostgroup + 'hostgroup' => $h->hostgroup, + 'sort' => 'service_severity' ) ); ?>" title="Services OK"> - services_ok ?> OK + services_ok; ?> OK
@@ -212,10 +238,11 @@ 'monitoring/list/services', array( 'service_state' => 99, - 'hostgroup' => $h->hostgroup + 'hostgroup' => $h->hostgroup, + 'sort' => 'service_severity' ) ); ?>" title="Services PENDING"> - services_pending ?> PENDING + services_pending; ?> PENDING diff --git a/modules/monitoring/application/views/scripts/list/servicegroups.phtml b/modules/monitoring/application/views/scripts/list/servicegroups.phtml index b33a5ed5d..1cc2e2d97 100644 --- a/modules/monitoring/application/views/scripts/list/servicegroups.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegroups.phtml @@ -5,238 +5,257 @@
- - {$status} = (string)((int)$servicegroup->{$status . '_handled'} - + (int)$servicegroup->{$status . '_unhandled'}); - ?> -
- -

servicegroup; ?>

-
-
- - - - - - - - - - - - - -
HostsServices
- hosts_down): ?> - -
- - hosts_down ?> DOWN - - hosts_down_unhandled): ?> - - hosts_down_unhandled ?> Unhandled - - -
- - - hosts_unreachable): ?> - -
- - hosts_unreachable ?> UNREACHABLE - - hosts_unreachable_unhandled): ?> - - hosts_unreachable_unhandled ?> Unhandled - - -
- - - hosts_up): ?> - -
- - hosts_up ?> UP - -
- - - hosts_pending): ?> - -
- - hosts_pending ?> PENDING - -
- - -
- services_critical): ?> - -
- - services_critical ?> CRITICAL - - services_critical_unhandled): ?> - - services_critical_unhandled ?> Unhandled - - -
- - - services_warning): ?> - -
- - services_warning ?> WARNING - - services_warning_unhandled): ?> - - services_warning_unhandled ?> Unhandled - - -
- - - services_unknown): ?> - -
- - services_unknown ?> UNKNOWN - - services_unknown_unhandled): ?> - - services_unknown_unhandled ?> Unhandled - - -
- - - services_ok): ?> - -
- - services_ok ?> OK - -
- - - services_pending): ?> - -
- - services_pending ?> PENDING - -
- - -
-
+ +
+ +

servicegroup; ?>

+
+
+ + + + + + + + + + + + + +
translate('Hosts'); ?>translate('Services'); ?>
+hosts_down_handled || $servicegroup->hosts_down_unhandled): ?> + +
+hosts_down_unhandled): ?> + + hosts_down_unhandled; ?> DOWN + + +hosts_down_handled): ?> + + hosts_down_handled . ' ' . ($servicegroup->hosts_down_unhandled ? $this->translate('Acknowledged') : 'DOWN'); ?> + + +
+ + +hosts_unreachable_handled || $servicegroup->hosts_unreachable_unhandled): ?> + +
+hosts_unreachable_unhandled): ?> + + hosts_unreachable_unhandled; ?> UNREACHABLE + + +hosts_unreachable_handled): ?> + + hosts_unreachable_handled . ' ' . ($servicegroup->hosts_unreachable_unhandled ? $this->translate('Acknowledged') : 'UNREACHABLE'); ?> + + +
+ + +hosts_up): ?> + +
+ + hosts_up; ?> UP + +
+ + +hosts_pending): ?> + +
+ + hosts_pending; ?> PENDING + +
+ + +
+services_critical_handled || $servicegroup->services_critical_unhandled): ?> + +
+services_critical_unhandled): ?> + + services_critical_unhandled; ?> CRITICAL + + +services_critical_handled): ?> + + services_critical_handled . ' ' . ($servicegroup->services_critical_unhandled ? $this->translate('Acknowledged') : 'CRITICAL'); ?> + + +
+ + +services_warning_handled || $servicegroup->services_warning_unhandled): ?> + +
+services_warning_unhandled): ?> + + services_warning_unhandled; ?> WARNING + + +services_warning_handled): ?> + + services_warning_handled . ' ' . ($servicegroup->services_warning_unhandled ? $this->translate('Acknowledged') : 'WARNING'); ?> + + +
+ + +services_unknown_handled || $servicegroup->services_unknown_unhandled): ?> + +
+services_unknown_unhandled): ?> + + services_unknown_unhandled; ?> UNKNOWN + + +services_unknown_handled): ?> + + services_unknown_handled . ' ' . ($servicegroup->services_unknown_unhandled ? $this->translate('Acknowledged') : 'UNKNOWN'); ?> + + +
+ + +services_ok): ?> + +
+ + services_ok; ?> OK + +
+ + +services_pending): ?> + +
+ + services_pending; ?> PENDING + +
+ + +
- +
+
diff --git a/modules/monitoring/application/views/scripts/tactical/components/ok_hosts.phtml b/modules/monitoring/application/views/scripts/tactical/components/ok_hosts.phtml index 9b94d0d0d..d71d4283d 100644 --- a/modules/monitoring/application/views/scripts/tactical/components/ok_hosts.phtml +++ b/modules/monitoring/application/views/scripts/tactical/components/ok_hosts.phtml @@ -90,15 +90,15 @@ 'services_ok_not_checked' => $this->statusSummary->services_ok_not_checked_on_ok_hosts, 'services_pending' => $this->statusSummary->services_pending_on_ok_hosts, 'services_pending_not_checked' => $this->statusSummary->services_pending_not_checked_on_ok_hosts, - 'services_warning' => $this->statusSummary->services_warning_on_ok_hosts, + 'services_warning_handled' => $this->statusSummary->services_warning_handled_on_ok_hosts, 'services_warning_unhandled' => $this->statusSummary->services_warning_unhandled_on_ok_hosts, 'services_warning_passive' => $this->statusSummary->services_warning_passive_on_ok_hosts, 'services_warning_not_checked' => $this->statusSummary->services_warning_not_checked_on_ok_hosts, - 'services_critical' => $this->statusSummary->services_critical_on_ok_hosts, + 'services_critical_handled' => $this->statusSummary->services_critical_handled_on_ok_hosts, 'services_critical_unhandled' => $this->statusSummary->services_critical_unhandled_on_ok_hosts, 'services_critical_passive' => $this->statusSummary->services_critical_passive_on_ok_hosts, 'services_critical_not_checked' => $this->statusSummary->services_critical_not_checked_on_ok_hosts, - 'services_unknown' => $this->statusSummary->services_unknown_on_ok_hosts, + 'services_unknown_handled' => $this->statusSummary->services_unknown_handled_on_ok_hosts, 'services_unknown_unhandled' => $this->statusSummary->services_unknown_unhandled_on_ok_hosts, 'services_unknown_passive' => $this->statusSummary->services_unknown_passive_on_ok_hosts, 'services_unknown_not_checked' => $this->statusSummary->services_unknown_not_checked_on_ok_hosts diff --git a/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml b/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml index f2ebc1f8a..484bbb65e 100644 --- a/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml +++ b/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml @@ -1,17 +1,19 @@ - +
- - CRITICAL - - translate('Unhandled'); ?> + CRITICAL + + + + + translate('Acknowledged') : 'CRITICAL'); ?> @@ -66,20 +68,22 @@
- +
- - WARNING - - translate('Unhandled'); ?> + WARNING + + + + + translate('Acknowledged') : 'WARNING'); ?> @@ -134,20 +138,22 @@
- +
- - UNKNOWN - - translate('Unhandled'); ?> + UNKNOWN + + + + + translate('Acknowledged') : 'UNKNOWN'); ?> diff --git a/modules/monitoring/application/views/scripts/tactical/components/problem_hosts.phtml b/modules/monitoring/application/views/scripts/tactical/components/problem_hosts.phtml index 2600fca23..35610e636 100644 --- a/modules/monitoring/application/views/scripts/tactical/components/problem_hosts.phtml +++ b/modules/monitoring/application/views/scripts/tactical/components/problem_hosts.phtml @@ -11,20 +11,22 @@
-statusSummary->hosts_down): ?> +statusSummary->hosts_down_handled || $this->statusSummary->hosts_down_unhandled): ?>
- - statusSummary->hosts_down; ?> DOWN - statusSummary->hosts_down_unhandled): ?> - statusSummary->hosts_down_unhandled . ' ' . $this->translate('Unhandled'); ?> + statusSummary->hosts_down_unhandled; ?> DOWN + + +statusSummary->hosts_down_handled): ?> + + statusSummary->hosts_down_handled . ' ' . $this->statusSummary->hosts_down_unhandled ? $this->translate('Acknowledged') : 'DOWN'; ?> statusSummary->hosts_down_passive): ?> @@ -77,20 +79,22 @@
-statusSummary->hosts_unreachable): ?> +statusSummary->hosts_unreachable_handled || $this->statusSummary->hosts_unreachable_unhandled): ?>
- - statusSummary->hosts_unreachable; ?> UNREACHABLE - statusSummary->hosts_unreachable_unhandled): ?> - statusSummary->hosts_unreachable_unhandled . ' ' . $this->translate('Unhandled'); ?> + statusSummary->hosts_unreachable_unhandled; ?> UNREACHABLE + + +statusSummary->hosts_unreachable_handled): ?> + + statusSummary->hosts_unreachable . ' ' . $this->statusSummary->hosts_unreachable_unhandled ? $this->translate('Acknowledged') : 'UNREACHABLE'; ?> statusSummary->hosts_unreachable_passive): ?> @@ -153,15 +157,15 @@ 'services_ok_not_checked' => $this->statusSummary->services_ok_not_checked_on_problem_hosts, 'services_pending' => $this->statusSummary->services_pending_on_problem_hosts, 'services_pending_not_checked' => $this->statusSummary->services_pending_not_checked_on_problem_hosts, - 'services_warning' => $this->statusSummary->services_warning_on_problem_hosts, + 'services_warning_handled' => $this->statusSummary->services_warning_handled_on_problem_hosts, 'services_warning_unhandled' => $this->statusSummary->services_warning_unhandled_on_problem_hosts, 'services_warning_passive' => $this->statusSummary->services_warning_passive_on_problem_hosts, 'services_warning_not_checked' => $this->statusSummary->services_warning_not_checked_on_problem_hosts, - 'services_critical' => $this->statusSummary->services_critical_on_problem_hosts, + 'services_critical_handled' => $this->statusSummary->services_critical_handled_on_problem_hosts, 'services_critical_unhandled' => $this->statusSummary->services_critical_unhandled_on_problem_hosts, 'services_critical_passive' => $this->statusSummary->services_critical_passive_on_problem_hosts, 'services_critical_not_checked' => $this->statusSummary->services_critical_not_checked_on_problem_hosts, - 'services_unknown' => $this->statusSummary->services_unknown_on_problem_hosts, + 'services_unknown_handled' => $this->statusSummary->services_unknown_handled_on_problem_hosts, 'services_unknown_unhandled' => $this->statusSummary->services_unknown_unhandled_on_problem_hosts, 'services_unknown_passive' => $this->statusSummary->services_unknown_passive_on_problem_hosts, 'services_unknown_not_checked' => $this->statusSummary->services_unknown_not_checked_on_problem_hosts diff --git a/modules/monitoring/application/views/scripts/tactical/index.phtml b/modules/monitoring/application/views/scripts/tactical/index.phtml index 6089b5017..fb866d2ef 100644 --- a/modules/monitoring/application/views/scripts/tactical/index.phtml +++ b/modules/monitoring/application/views/scripts/tactical/index.phtml @@ -7,6 +7,7 @@
render('tactical/components/problem_hosts.phtml'); ?> render('tactical/components/ok_hosts.phtml'); ?> +
render('tactical/components/hostservicechecks.phtml'); ?> render('tactical/components/monitoringfeatures.phtml'); ?>
diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php index a50237389..b4c2f252f 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php @@ -91,15 +91,15 @@ class StatusSummaryQuery extends IdoQuery 'services_ok_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', 'services_pending_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 99 THEN 1 ELSE 0 END)', 'services_pending_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'services_warning_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 1 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)', 'services_warning_unhandled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', 'services_warning_passive_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 1 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', 'services_warning_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 1 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'services_critical_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 2 THEN 1 ELSE 0 END)', + 'services_critical_handled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 2 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)', 'services_critical_unhandled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 2 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', 'services_critical_passive_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 2 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', 'services_critical_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 2 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'services_unknown_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 3 THEN 1 ELSE 0 END)', + 'services_unknown_handled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 3 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)', 'services_unknown_unhandled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 3 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', 'services_unknown_passive_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 3 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', 'services_unknown_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 3 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', @@ -107,15 +107,15 @@ class StatusSummaryQuery extends IdoQuery 'services_ok_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', 'services_pending_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 99 THEN 1 ELSE 0 END)', 'services_pending_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'services_warning_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 1 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)', 'services_warning_unhandled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', 'services_warning_passive_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 1 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', 'services_warning_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 1 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'services_critical_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 2 THEN 1 ELSE 0 END)', + 'services_critical_handled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 2 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)', 'services_critical_unhandled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 2 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', 'services_critical_passive_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 2 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', 'services_critical_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 2 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'services_unknown_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 3 THEN 1 ELSE 0 END)', + 'services_unknown_handled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 3 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)', 'services_unknown_unhandled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 3 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', 'services_unknown_passive_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 3 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', 'services_unknown_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 3 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)' diff --git a/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php b/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php index 731f15af2..caf622e59 100644 --- a/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php +++ b/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php @@ -44,6 +44,7 @@ class ServiceStatus extends DataView 'host_state_type', 'host_last_state_change', 'host_address', + 'host_problem', 'host_handled', 'service_description', 'service_display_name', diff --git a/modules/monitoring/library/Monitoring/DataView/StatusSummary.php b/modules/monitoring/library/Monitoring/DataView/StatusSummary.php index 77fa3d574..efba4e37d 100644 --- a/modules/monitoring/library/Monitoring/DataView/StatusSummary.php +++ b/modules/monitoring/library/Monitoring/DataView/StatusSummary.php @@ -92,15 +92,15 @@ class StatusSummary extends DataView 'services_ok_not_checked_on_ok_hosts', 'services_pending_on_ok_hosts', 'services_pending_not_checked_on_ok_hosts', - 'services_warning_on_ok_hosts', + 'services_warning_handled_on_ok_hosts', 'services_warning_unhandled_on_ok_hosts', 'services_warning_passive_on_ok_hosts', 'services_warning_not_checked_on_ok_hosts', - 'services_critical_on_ok_hosts', + 'services_critical_handled_on_ok_hosts', 'services_critical_unhandled_on_ok_hosts', 'services_critical_passive_on_ok_hosts', 'services_critical_not_checked_on_ok_hosts', - 'services_unknown_on_ok_hosts', + 'services_unknown_handled_on_ok_hosts', 'services_unknown_unhandled_on_ok_hosts', 'services_unknown_passive_on_ok_hosts', 'services_unknown_not_checked_on_ok_hosts', @@ -108,15 +108,15 @@ class StatusSummary extends DataView 'services_ok_not_checked_on_problem_hosts', 'services_pending_on_problem_hosts', 'services_pending_not_checked_on_problem_hosts', - 'services_warning_on_problem_hosts', + 'services_warning_handled_on_problem_hosts', 'services_warning_unhandled_on_problem_hosts', 'services_warning_passive_on_problem_hosts', 'services_warning_not_checked_on_problem_hosts', - 'services_critical_on_problem_hosts', + 'services_critical_handled_on_problem_hosts', 'services_critical_unhandled_on_problem_hosts', 'services_critical_passive_on_problem_hosts', 'services_critical_not_checked_on_problem_hosts', - 'services_unknown_on_problem_hosts', + 'services_unknown_handled_on_problem_hosts', 'services_unknown_unhandled_on_problem_hosts', 'services_unknown_passive_on_problem_hosts', 'services_unknown_not_checked_on_problem_hosts'