From 0e0672e0c12c622f73562be768ecaa7bc968927e Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 5 Feb 2014 17:23:51 +0100 Subject: [PATCH 1/4] Add tactical overview (WIP) refs #3782 --- .../controllers/TacticalController.php | 17 +++ .../views/scripts/tactical/index.phtml | 120 ++++++++++++++++++ .../Backend/Ido/Query/StatusSummaryQuery.php | 61 ++++++--- .../Monitoring/DataView/StatusSummary.php | 60 ++++++++- modules/monitoring/public/css/main.less | 75 +++++++++++ 5 files changed, 315 insertions(+), 18 deletions(-) create mode 100644 modules/monitoring/application/controllers/TacticalController.php create mode 100644 modules/monitoring/application/views/scripts/tactical/index.phtml diff --git a/modules/monitoring/application/controllers/TacticalController.php b/modules/monitoring/application/controllers/TacticalController.php new file mode 100644 index 000000000..2b434bb2f --- /dev/null +++ b/modules/monitoring/application/controllers/TacticalController.php @@ -0,0 +1,17 @@ +view->statusSummary = StatusSummary::fromRequest($this->_request)->getQuery()->fetchRow(); + } +} +// @codingStandardsIgnoreStop \ No newline at end of file diff --git a/modules/monitoring/application/views/scripts/tactical/index.phtml b/modules/monitoring/application/views/scripts/tactical/index.phtml new file mode 100644 index 000000000..4c0d61600 --- /dev/null +++ b/modules/monitoring/application/views/scripts/tactical/index.phtml @@ -0,0 +1,120 @@ +statusSummary; +$state = array( + 'host' => array( + 'up' => 0, + 'down' => 1, + 'unreachable' => 2, + 'pending' => 99 + ), + 'service' => array( + 'ok' => 0, + 'warning' => 1, + 'critical' => 2, + 'unknown' => 3, + 'pending' => 99 + ) +); +function init_upper($string) { + return mb_strtoupper(substr($string, 0, 1)) . substr($string, 1); +} +$tacticalTables = array(); +foreach (array( + 'host' => array('up', 'down', 'unreachable', 'pending'), + 'service' => array('ok', 'critical', 'warning', 'unknown', 'pending') +) as $key => $value) { + $tacticalTables[$key] = array(); + foreach ($value as $valueState) { + $tacticalTables[$key][$valueState] = array(); + $value_2_ref = $key . 's_' . $valueState; + $tacticalTables[$key][$valueState][$valueState] = (int)$summary->{$value_2_ref}; + foreach (array('disabled', 'unhandled', 'on_problem_hosts') as $value_3) { + $value_3_ref = $value_2_ref . '_' . $value_3; + if (isset($summary->{$value_3_ref})) { + $tacticalTables[$key][$valueState][$value_3] = (int)$summary->{$value_3_ref}; + } + } + } +} +foreach ($tacticalTables as $key => $value) { + printf( + '', + count($value), + init_upper($key) + ); + foreach ($value as $keyState => $valueState) { + printf( + ''; + } + echo '

%ss

%s: %d', + $keyState, + $this->href( + 'monitoring/list/' . $key . 's', + array($key . '_state' => $state[$key][$keyState]) + ), + init_upper($key), + $keyState, + init_upper($keyState), + $valueState[$keyState] + ); + foreach ($valueState as $keyStateDetail => $valueStateDetail) { + if ($keyStateDetail !== $keyState && $valueStateDetail !== 0) { + $strReplaced = str_replace('_', ' ', $keyStateDetail); + printf( + '
%s: %d', + $this->href( + 'monitoring/list/' . $key . 's', + array( + $key . '_state' => $state[$key][$keyState], + $key . '_' . $keyStateDetail => 1 + ) + ), + init_upper($key), + $keyState, + $strReplaced, + ($strReplaced === 'unhandled' ? '' : ' style="color: #f5a9a9"'), + $strReplaced, + $valueStateDetail + ); + } + } + echo '
'; +} +?> + + + + + + + + + + '; + foreach (array('host', 'service') as $hst_srv) { + foreach (array('act', 'pass') as $act_pass) { + $var_ref = $this->statusSummary->{sprintf( + '%ss%s_%sive_checked', + $hst_srv, + ($check_enabled ? '' : '_not'), + $act_pass + )}; + if ($var_ref === '0') { + echo ''; + } + } + echo ''; + } + ?> +

Host Checks

Service Checks

ActivePassiveActivePassive
'; + } else { + printf( + '%sabled: %s', + ($check_enabled ? 'up' : 'down'), + ($check_enabled ? 'en' : 'dis'), + $var_ref + ); + } + echo '
\ No newline at end of file diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php index e3e8c8bca..13b3fdbf4 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php @@ -37,21 +37,46 @@ class StatusSummaryQuery extends IdoQuery protected $columnMap = array( 'hoststatussummary' => array( 'hosts_up' => 'SUM(CASE WHEN object_type = \'host\' AND state = 0 THEN 1 ELSE 0 END)', - 'hosts_unreachable_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime != 0 THEN 1 ELSE 0 END)', - 'hosts_unreachable_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', + 'hosts_up_disabled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'hosts_down' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 THEN 1 ELSE 0 END)', 'hosts_down_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime != 0 THEN 1 ELSE 0 END)', 'hosts_down_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', - 'hosts_pending' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 THEN 1 ELSE 0 END)' + 'hosts_down_disabled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'hosts_unreachable' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 THEN 1 ELSE 0 END)', + 'hosts_unreachable_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime != 0 THEN 1 ELSE 0 END)', + 'hosts_unreachable_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', + 'hosts_unreachable_disabled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'hosts_pending' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 THEN 1 ELSE 0 END)', + 'hosts_pending_disabled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'hosts_active_checked' => 'SUM(CASE WHEN object_type = \'host\' AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'hosts_not_active_checked' => 'SUM(CASE WHEN object_type = \'host\' AND is_active_checked = 0 THEN 1 ELSE 0 END)', + 'hosts_passive_checked' => 'SUM(CASE WHEN object_type = \'host\' AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'hosts_not_passive_checked' => 'SUM(CASE WHEN object_type = \'host\' AND is_passive_checked = 0 THEN 1 ELSE 0 END)' ), 'servicestatussummary' => array( - 'services_ok' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 THEN 1 ELSE 0 END)', - 'services_pending' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 THEN 1 ELSE 0 END)', - 'services_warning_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', - 'services_critical_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', - 'services_unknown_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', - 'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', - 'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', - 'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)' + 'services_ok' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 THEN 1 ELSE 0 END)', + 'services_ok_disabled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_warning' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', + 'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', + 'services_warning_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND host_state != 99 AND host_state != 0 THEN 1 ELSE 0 END)', + 'services_warning_disabled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_critical' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 THEN 1 ELSE 0 END)', + 'services_critical_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', + 'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', + 'services_critical_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND host_state != 99 AND host_state != 0 THEN 1 ELSE 0 END)', + 'services_critical_disabled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_unknown' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 THEN 1 ELSE 0 END)', + 'services_unknown_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', + 'services_unknown_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND host_state != 99 AND host_state != 0 THEN 1 ELSE 0 END)', + 'services_unknown_disabled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_pending' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 THEN 1 ELSE 0 END)', + 'services_pending_disabled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_active_checked' => 'SUM(CASE WHEN object_type = \'service\' AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_not_active_checked' => 'SUM(CASE WHEN object_type = \'service\' AND is_active_checked = 0 THEN 1 ELSE 0 END)', + 'services_passive_checked' => 'SUM(CASE WHEN object_type = \'service\' AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_not_passive_checked' => 'SUM(CASE WHEN object_type = \'service\' AND is_passive_checked = 0 THEN 1 ELSE 0 END)' ) ); @@ -86,17 +111,21 @@ class StatusSummaryQuery extends IdoQuery array() ); $hosts->columns(array( - 'state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END', - 'acknowledged' => 'hs.problem_has_been_acknowledged', - 'in_downtime' => 'CASE WHEN (hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END', - 'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END', - 'object_type' => '(\'host\')' + 'state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END', + 'acknowledged' => 'hs.problem_has_been_acknowledged', + 'in_downtime' => 'CASE WHEN (hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END', + 'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END', + 'is_active_checked' => 'CASE WHEN hs.active_checks_enabled = 1 THEN 1 ELSE 0 END', + 'is_passive_checked' => 'CASE WHEN hs.passive_checks_enabled = 1 THEN 1 ELSE 0 END', + 'object_type' => '(\'host\')' )); $services->columns(array( 'state' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL THEN 99 ELSE ss.current_state END', 'acknowledged' => 'ss.problem_has_been_acknowledged', 'in_downtime' => 'CASE WHEN (ss.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END', 'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END', + 'is_active_checked' => 'CASE WHEN ss.active_checks_enabled = 1 THEN 1 ELSE 0 END', + 'is_passive_checked' => 'CASE WHEN ss.passive_checks_enabled = 1 THEN 1 ELSE 0 END', 'object_type' => '(\'service\')' )); $union = $this->db->select()->union(array($hosts, $services), Zend_Db_Select::SQL_UNION_ALL); diff --git a/modules/monitoring/library/Monitoring/DataView/StatusSummary.php b/modules/monitoring/library/Monitoring/DataView/StatusSummary.php index 908a01da2..6b12110eb 100644 --- a/modules/monitoring/library/Monitoring/DataView/StatusSummary.php +++ b/modules/monitoring/library/Monitoring/DataView/StatusSummary.php @@ -39,20 +39,76 @@ class StatusSummary extends DataView public function getColumns() { return array( - 'hosts_up', + /*'hosts_up', + 'hosts_unreachable', 'hosts_unreachable_handled', 'hosts_unreachable_unhandled', + 'hosts_down', 'hosts_down_handled', 'hosts_down_unhandled', 'hosts_pending', 'services_ok', + 'services_critical', 'services_critical_handled', 'services_critical_unhandled', + 'services_warning', 'services_warning_handled', 'services_warning_unhandled', + 'services_unknown', 'services_unknown_handled', 'services_unknown_unhandled', - 'services_pending' + 'services_pending', + 'services_active_checked', + 'services_not_active_checked', + 'services_passive_checked', + 'services_not_passive_checked', + 'hosts_active_checked', + 'hosts_not_active_checked', + 'hosts_passive_checked', + 'hosts_not_passive_checked', + 'services_critical_on_problem_hosts', + 'services_warning_on_problem_hosts', + 'services_unknown_on_problem_hosts'*/ + + 'hosts_up', + 'hosts_up_disabled', + 'hosts_down', + 'hosts_down_handled', + 'hosts_down_unhandled', + 'hosts_down_disabled', + 'hosts_unreachable', + 'hosts_unreachable_handled', + 'hosts_unreachable_unhandled', + 'hosts_unreachable_disabled', + 'hosts_pending', + 'hosts_pending_disabled', + 'hosts_active_checked', + 'hosts_not_active_checked', + 'hosts_passive_checked', + 'hosts_not_passive_checked', + 'services_ok', + 'services_ok_disabled', + 'services_warning', + 'services_warning_handled', + 'services_warning_unhandled', + 'services_warning_on_problem_hosts', + 'services_warning_disabled', + 'services_critical', + 'services_critical_handled', + 'services_critical_unhandled', + 'services_critical_on_problem_hosts', + 'services_critical_disabled', + 'services_unknown', + 'services_unknown_handled', + 'services_unknown_unhandled', + 'services_unknown_on_problem_hosts', + 'services_unknown_disabled', + 'services_pending', + 'services_pending_disabled', + 'services_active_checked', + 'services_not_active_checked', + 'services_passive_checked', + 'services_not_passive_checked' ); } } diff --git a/modules/monitoring/public/css/main.less b/modules/monitoring/public/css/main.less index 5bf5f2db5..c80da2b67 100644 --- a/modules/monitoring/public/css/main.less +++ b/modules/monitoring/public/css/main.less @@ -39,6 +39,69 @@ @colorWarning : #FFA500; @colorUnreachable : #E066FF; +table.tacticalTable { + //width: 100%; + border: 0px; + border-collapse: separate; + border-spacing: 5px; +} + +a.tacticalLink:link, +a.tacticalLink:visited, +a.tacticalLink:hover, +a.tacticalLink:active { + color: black; +} + +a.tacticalLinkWhite:link, +a.tacticalLinkWhite:visited, +a.tacticalLinkWhite:hover, +a.tacticalLinkWhite:active { + color: white; +} + +a.tacticalLink:link, +a.tacticalLink:visited, +a.tacticalLink:active, +a.tacticalLinkWhite:link, +a.tacticalLinkWhite:visited, +a.tacticalLinkWhite:active { + text-decoration: underline; +} + +a.tacticalLink:hover, +a.tacticalLinkWhite:hover { + text-decoration: none; +} + +.whiteFont { + color: white; +} + +.tacticalHeader { + //background-color: darkgray; + font-weight: bold; +} + +.tacticalSubHeader { + background-color: lightgray; +} + +.tacticalText { + font-weight: bold; + color: black; +} + +.equalheight-container { + overflow: hidden; +} + +.equalheight { + margin-bottom: -99999px; + padding-bottom: 99999px; + background-color:#efefef; +} + .host-name { display: block; margin-top: 5px; @@ -90,6 +153,18 @@ Status colors ========================================================================== */ +.status-ok { + background-color: @colorOk!important; +} + +.status-down { + background-color: @colorDown!important; +} + +.status-unreachable { + background-color: @colorUnreachable!important; +} + .status-up { background-color: @colorUp!important; } From b8efe1a93cedee0520d93effe99af8826c0bedc4 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 5 Feb 2014 17:50:20 +0100 Subject: [PATCH 2/4] Collect some garbage in the source code --- .../Monitoring/DataView/StatusSummary.php | 31 ---------- modules/monitoring/public/css/main.less | 57 ------------------- 2 files changed, 88 deletions(-) diff --git a/modules/monitoring/library/Monitoring/DataView/StatusSummary.php b/modules/monitoring/library/Monitoring/DataView/StatusSummary.php index 6b12110eb..87b676c1b 100644 --- a/modules/monitoring/library/Monitoring/DataView/StatusSummary.php +++ b/modules/monitoring/library/Monitoring/DataView/StatusSummary.php @@ -39,37 +39,6 @@ class StatusSummary extends DataView public function getColumns() { return array( - /*'hosts_up', - 'hosts_unreachable', - 'hosts_unreachable_handled', - 'hosts_unreachable_unhandled', - 'hosts_down', - 'hosts_down_handled', - 'hosts_down_unhandled', - 'hosts_pending', - 'services_ok', - 'services_critical', - 'services_critical_handled', - 'services_critical_unhandled', - 'services_warning', - 'services_warning_handled', - 'services_warning_unhandled', - 'services_unknown', - 'services_unknown_handled', - 'services_unknown_unhandled', - 'services_pending', - 'services_active_checked', - 'services_not_active_checked', - 'services_passive_checked', - 'services_not_passive_checked', - 'hosts_active_checked', - 'hosts_not_active_checked', - 'hosts_passive_checked', - 'hosts_not_passive_checked', - 'services_critical_on_problem_hosts', - 'services_warning_on_problem_hosts', - 'services_unknown_on_problem_hosts'*/ - 'hosts_up', 'hosts_up_disabled', 'hosts_down', diff --git a/modules/monitoring/public/css/main.less b/modules/monitoring/public/css/main.less index c80da2b67..17f414f80 100644 --- a/modules/monitoring/public/css/main.less +++ b/modules/monitoring/public/css/main.less @@ -40,68 +40,11 @@ @colorUnreachable : #E066FF; table.tacticalTable { - //width: 100%; border: 0px; border-collapse: separate; border-spacing: 5px; } -a.tacticalLink:link, -a.tacticalLink:visited, -a.tacticalLink:hover, -a.tacticalLink:active { - color: black; -} - -a.tacticalLinkWhite:link, -a.tacticalLinkWhite:visited, -a.tacticalLinkWhite:hover, -a.tacticalLinkWhite:active { - color: white; -} - -a.tacticalLink:link, -a.tacticalLink:visited, -a.tacticalLink:active, -a.tacticalLinkWhite:link, -a.tacticalLinkWhite:visited, -a.tacticalLinkWhite:active { - text-decoration: underline; -} - -a.tacticalLink:hover, -a.tacticalLinkWhite:hover { - text-decoration: none; -} - -.whiteFont { - color: white; -} - -.tacticalHeader { - //background-color: darkgray; - font-weight: bold; -} - -.tacticalSubHeader { - background-color: lightgray; -} - -.tacticalText { - font-weight: bold; - color: black; -} - -.equalheight-container { - overflow: hidden; -} - -.equalheight { - margin-bottom: -99999px; - padding-bottom: 99999px; - background-color:#efefef; -} - .host-name { display: block; margin-top: 5px; From ba45d64891cf9514da368a279a7ba2844a8b2060 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 3 Mar 2014 09:03:07 +0100 Subject: [PATCH 3/4] Extend StatusSummaryQuery and its view refs #3782 --- .../Backend/Ido/Query/StatusSummaryQuery.php | 236 ++++++++++++++---- .../Monitoring/DataView/StatusSummary.php | 162 ++++++++++-- 2 files changed, 321 insertions(+), 77 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php index 13b3fdbf4..42c8916ca 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php @@ -35,48 +35,166 @@ use \Zend_Db_Select; class StatusSummaryQuery extends IdoQuery { protected $columnMap = array( - 'hoststatussummary' => array( - 'hosts_up' => 'SUM(CASE WHEN object_type = \'host\' AND state = 0 THEN 1 ELSE 0 END)', - 'hosts_up_disabled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'hosts_down' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 THEN 1 ELSE 0 END)', - 'hosts_down_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime != 0 THEN 1 ELSE 0 END)', - 'hosts_down_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', - 'hosts_down_disabled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'hosts_unreachable' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 THEN 1 ELSE 0 END)', - 'hosts_unreachable_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime != 0 THEN 1 ELSE 0 END)', - 'hosts_unreachable_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', - 'hosts_unreachable_disabled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'hosts_pending' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 THEN 1 ELSE 0 END)', - 'hosts_pending_disabled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'hosts_active_checked' => 'SUM(CASE WHEN object_type = \'host\' AND is_active_checked = 1 THEN 1 ELSE 0 END)', - 'hosts_not_active_checked' => 'SUM(CASE WHEN object_type = \'host\' AND is_active_checked = 0 THEN 1 ELSE 0 END)', - 'hosts_passive_checked' => 'SUM(CASE WHEN object_type = \'host\' AND is_passive_checked = 1 THEN 1 ELSE 0 END)', - 'hosts_not_passive_checked' => 'SUM(CASE WHEN object_type = \'host\' AND is_passive_checked = 0 THEN 1 ELSE 0 END)' + 'hoststatussummary' => array( + 'hosts_up' => 'SUM(CASE WHEN object_type = \'host\' AND state = 0 THEN 1 ELSE 0 END)', + 'hosts_up_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'hosts_pending' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 THEN 1 ELSE 0 END)', + 'hosts_pending_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'hosts_down' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 THEN 1 ELSE 0 END)', + 'hosts_down_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)', + 'hosts_down_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', + 'hosts_down_handled_active' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'hosts_down_handled_passive' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'hosts_down_handled_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'hosts_down_unhandled_active' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'hosts_down_unhandled_passive' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'hosts_down_unhandled_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'hosts_unreachable' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 THEN 1 ELSE 0 END)', + 'hosts_unreachable_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)', + 'hosts_unreachable_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', + 'hosts_unreachable_handled_active' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'hosts_unreachable_handled_passive' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'hosts_unreachable_handled_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'hosts_unreachable_unhandled_active' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'hosts_unreachable_unhandled_passive' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'hosts_unreachable_unhandled_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'hosts_active' => 'SUM(CASE WHEN object_type = \'host\' AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'hosts_passive' => 'SUM(CASE WHEN object_type = \'host\' AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'hosts_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'hosts_processing_event_handlers' => 'SUM(CASE WHEN object_type = \'host\' AND is_processing_events = 1 THEN 1 ELSE 0 END)', + 'hosts_triggering_notifications' => 'SUM(CASE WHEN object_type = \'host\' AND is_triggering_notifications = 1 THEN 1 ELSE 0 END)', + 'hosts_with_flap_detection' => 'SUM(CASE WHEN object_type = \'host\' AND is_allowed_to_flap = 1 THEN 1 ELSE 0 END)', + 'hosts_flapping' => 'SUM(CASE WHEN object_type = \'host\' AND is_flapping = 1 THEN 1 ELSE 0 END)' ), - 'servicestatussummary' => array( - 'services_ok' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 THEN 1 ELSE 0 END)', - 'services_ok_disabled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'services_warning' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 THEN 1 ELSE 0 END)', - 'services_warning_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', - 'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', - 'services_warning_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND host_state != 99 AND host_state != 0 THEN 1 ELSE 0 END)', - 'services_warning_disabled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'services_critical' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 THEN 1 ELSE 0 END)', - 'services_critical_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', - 'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', - 'services_critical_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND host_state != 99 AND host_state != 0 THEN 1 ELSE 0 END)', - 'services_critical_disabled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'services_unknown' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 THEN 1 ELSE 0 END)', - 'services_unknown_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', - 'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', - 'services_unknown_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND host_state != 99 AND host_state != 0 THEN 1 ELSE 0 END)', - 'services_unknown_disabled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'services_pending' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 THEN 1 ELSE 0 END)', - 'services_pending_disabled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', - 'services_active_checked' => 'SUM(CASE WHEN object_type = \'service\' AND is_active_checked = 1 THEN 1 ELSE 0 END)', - 'services_not_active_checked' => 'SUM(CASE WHEN object_type = \'service\' AND is_active_checked = 0 THEN 1 ELSE 0 END)', - 'services_passive_checked' => 'SUM(CASE WHEN object_type = \'service\' AND is_passive_checked = 1 THEN 1 ELSE 0 END)', - 'services_not_passive_checked' => 'SUM(CASE WHEN object_type = \'service\' AND is_passive_checked = 0 THEN 1 ELSE 0 END)' + 'servicestatussummary' => array( + 'services_ok' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 THEN 1 ELSE 0 END)', + 'services_ok_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_pending' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 THEN 1 ELSE 0 END)', + 'services_pending_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_warning' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', + 'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', + 'services_warning_handled_active' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_active' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_critical' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 THEN 1 ELSE 0 END)', + 'services_critical_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', + 'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', + 'services_critical_handled_active' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_handled_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_handled_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_active' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_unknown' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 THEN 1 ELSE 0 END)', + 'services_unknown_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', + 'services_unknown_handled_active' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_handled_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_handled_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_active' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_active' => 'SUM(CASE WHEN object_type = \'service\' AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_passive' => 'SUM(CASE WHEN object_type = \'service\' AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_processing_event_handlers' => 'SUM(CASE WHEN object_type = \'service\' AND is_processing_events = 1 THEN 1 ELSE 0 END)', + 'services_triggering_notifications' => 'SUM(CASE WHEN object_type = \'service\' AND is_triggering_notifications = 1 THEN 1 ELSE 0 END)', + 'services_with_flap_detection' => 'SUM(CASE WHEN object_type = \'service\' AND is_allowed_to_flap = 1 THEN 1 ELSE 0 END)', + 'services_flapping' => 'SUM(CASE WHEN object_type = \'service\' AND is_flapping = 1 THEN 1 ELSE 0 END)', + + + 'services_ok_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 0 THEN 1 ELSE 0 END)', + 'services_ok_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_pending_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 99 THEN 1 ELSE 0 END)', + 'services_pending_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_warning_handled_active_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled_passive_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 1 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_active_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_passive_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 1 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_critical_handled_active_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_handled_passive_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 2 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_handled_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_active_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_passive_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 2 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_unknown_handled_active_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_handled_passive_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 3 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_handled_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_active_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_passive_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 3 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_ok_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 0 THEN 1 ELSE 0 END)', + 'services_ok_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_pending_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 99 THEN 1 ELSE 0 END)', + 'services_pending_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_warning_handled_active_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled_passive_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 1 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_active_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_passive_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 1 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_critical_handled_active_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_handled_passive_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 2 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_handled_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_active_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_passive_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 2 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_unknown_handled_active_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_handled_passive_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 3 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_handled_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_active_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_passive_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 3 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_ok_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 0 THEN 1 ELSE 0 END)', + 'services_ok_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_pending_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 99 THEN 1 ELSE 0 END)', + 'services_pending_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_warning_handled_active_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled_passive_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 1 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_active_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_passive_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 1 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_critical_handled_active_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_handled_passive_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 2 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_handled_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_active_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_passive_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 2 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_unknown_handled_active_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_handled_passive_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 3 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_handled_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_active_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_passive_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 3 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_ok_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 0 THEN 1 ELSE 0 END)', + 'services_ok_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_pending_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 99 THEN 1 ELSE 0 END)', + 'services_pending_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_warning_handled_active_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled_passive_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 1 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_handled_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_active_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_passive_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 1 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_warning_unhandled_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_critical_handled_active_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_handled_passive_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 2 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_handled_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_active_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_passive_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 2 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_critical_unhandled_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_unknown_handled_active_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_handled_passive_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 3 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_handled_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_active_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_passive_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 3 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)' ) ); @@ -111,22 +229,30 @@ class StatusSummaryQuery extends IdoQuery array() ); $hosts->columns(array( - 'state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END', - 'acknowledged' => 'hs.problem_has_been_acknowledged', - 'in_downtime' => 'CASE WHEN (hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END', - 'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END', - 'is_active_checked' => 'CASE WHEN hs.active_checks_enabled = 1 THEN 1 ELSE 0 END', - 'is_passive_checked' => 'CASE WHEN hs.passive_checks_enabled = 1 THEN 1 ELSE 0 END', - 'object_type' => '(\'host\')' + 'state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END', + 'acknowledged' => 'hs.problem_has_been_acknowledged', + 'in_downtime' => 'CASE WHEN (hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END', + 'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END', + 'is_passive_checked' => 'CASE WHEN hs.active_checks_enabled = 0 AND hs.passive_checks_enabled = 1 THEN 1 ELSE 0 END', + 'is_active_checked' => 'hs.active_checks_enabled', + 'is_processing_events' => 'hs.event_handler_enabled', + 'is_triggering_notifications' => 'hs.notifications_enabled', + 'is_allowed_to_flap' => 'hs.flap_detection_enabled', + 'is_flapping' => 'hs.is_flapping', + 'object_type' => '(\'host\')' )); $services->columns(array( - 'state' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL THEN 99 ELSE ss.current_state END', - 'acknowledged' => 'ss.problem_has_been_acknowledged', - 'in_downtime' => 'CASE WHEN (ss.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END', - 'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END', - 'is_active_checked' => 'CASE WHEN ss.active_checks_enabled = 1 THEN 1 ELSE 0 END', - 'is_passive_checked' => 'CASE WHEN ss.passive_checks_enabled = 1 THEN 1 ELSE 0 END', - 'object_type' => '(\'service\')' + 'state' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL THEN 99 ELSE ss.current_state END', + 'acknowledged' => 'ss.problem_has_been_acknowledged', + 'in_downtime' => 'CASE WHEN (ss.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END', + 'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END', + 'is_passive_checked' => 'CASE WHEN ss.active_checks_enabled = 0 AND ss.passive_checks_enabled = 1 THEN 1 ELSE 0 END', + 'is_active_checked' => 'ss.active_checks_enabled', + 'is_processing_events' => 'ss.event_handler_enabled', + 'is_triggering_notifications' => 'ss.notifications_enabled', + 'is_allowed_to_flap' => 'ss.flap_detection_enabled', + 'is_flapping' => 'ss.is_flapping', + 'object_type' => '(\'service\')' )); $union = $this->db->select()->union(array($hosts, $services), Zend_Db_Select::SQL_UNION_ALL); $this->baseQuery = $this->db->select()->from(array('statussummary' => $union), array()); diff --git a/modules/monitoring/library/Monitoring/DataView/StatusSummary.php b/modules/monitoring/library/Monitoring/DataView/StatusSummary.php index 87b676c1b..74a03771c 100644 --- a/modules/monitoring/library/Monitoring/DataView/StatusSummary.php +++ b/modules/monitoring/library/Monitoring/DataView/StatusSummary.php @@ -40,44 +40,162 @@ class StatusSummary extends DataView { return array( 'hosts_up', - 'hosts_up_disabled', + 'hosts_up_not_checked', + 'hosts_pending', + 'hosts_pending_not_checked', 'hosts_down', 'hosts_down_handled', 'hosts_down_unhandled', - 'hosts_down_disabled', + 'hosts_down_handled_active', + 'hosts_down_handled_passive', + 'hosts_down_handled_not_checked', + 'hosts_down_unhandled_active', + 'hosts_down_unhandled_passive', + 'hosts_down_unhandled_not_checked', 'hosts_unreachable', 'hosts_unreachable_handled', 'hosts_unreachable_unhandled', - 'hosts_unreachable_disabled', - 'hosts_pending', - 'hosts_pending_disabled', - 'hosts_active_checked', - 'hosts_not_active_checked', - 'hosts_passive_checked', - 'hosts_not_passive_checked', + 'hosts_unreachable_handled_active', + 'hosts_unreachable_handled_passive', + 'hosts_unreachable_handled_not_checked', + 'hosts_unreachable_unhandled_active', + 'hosts_unreachable_unhandled_passive', + 'hosts_unreachable_unhandled_not_checked', + 'hosts_active', + 'hosts_passive', + 'hosts_not_checked', + 'hosts_processing_event_handlers', + 'hosts_triggering_notifications', + 'hosts_with_flap_detection', + 'hosts_flapping', 'services_ok', - 'services_ok_disabled', + 'services_ok_not_checked', + 'services_pending', + 'services_pending_not_checked', 'services_warning', 'services_warning_handled', 'services_warning_unhandled', - 'services_warning_on_problem_hosts', - 'services_warning_disabled', + 'services_warning_handled_active', + 'services_warning_handled_passive', + 'services_warning_handled_not_checked', + 'services_warning_unhandled_active', + 'services_warning_unhandled_passive', + 'services_warning_unhandled_not_checked', 'services_critical', 'services_critical_handled', 'services_critical_unhandled', - 'services_critical_on_problem_hosts', - 'services_critical_disabled', + 'services_critical_handled_active', + 'services_critical_handled_passive', + 'services_critical_handled_not_checked', + 'services_critical_unhandled_active', + 'services_critical_unhandled_passive', + 'services_critical_unhandled_not_checked', 'services_unknown', 'services_unknown_handled', 'services_unknown_unhandled', - 'services_unknown_on_problem_hosts', - 'services_unknown_disabled', - 'services_pending', - 'services_pending_disabled', - 'services_active_checked', - 'services_not_active_checked', - 'services_passive_checked', - 'services_not_passive_checked' + 'services_unknown_handled_active', + 'services_unknown_handled_passive', + 'services_unknown_handled_not_checked', + 'services_unknown_unhandled_active', + 'services_unknown_unhandled_passive', + 'services_unknown_unhandled_not_checked', + 'services_active', + 'services_passive', + 'services_not_checked', + 'services_processing_event_handlers', + 'services_triggering_notifications', + 'services_with_flap_detection', + 'services_flapping', + + + 'services_ok_on_up_hosts', + 'services_ok_not_checked_on_up_hosts', + 'services_pending_on_up_hosts', + 'services_pending_not_checked_on_up_hosts', + 'services_warning_handled_active_on_up_hosts', + 'services_warning_handled_passive_on_up_hosts', + 'services_warning_handled_not_checked_on_up_hosts', + 'services_warning_unhandled_active_on_up_hosts', + 'services_warning_unhandled_passive_on_up_hosts', + 'services_warning_unhandled_not_checked_on_up_hosts', + 'services_critical_handled_active_on_up_hosts', + 'services_critical_handled_passive_on_up_hosts', + 'services_critical_handled_not_checked_on_up_hosts', + 'services_critical_unhandled_active_on_up_hosts', + 'services_critical_unhandled_passive_on_up_hosts', + 'services_critical_unhandled_not_checked_on_up_hosts', + 'services_unknown_handled_active_on_up_hosts', + 'services_unknown_handled_passive_on_up_hosts', + 'services_unknown_handled_not_checked_on_up_hosts', + 'services_unknown_unhandled_active_on_up_hosts', + 'services_unknown_unhandled_passive_on_up_hosts', + 'services_unknown_unhandled_not_checked_on_up_hosts', + 'services_ok_on_down_hosts', + 'services_ok_not_checked_on_down_hosts', + 'services_pending_on_down_hosts', + 'services_pending_not_checked_on_down_hosts', + 'services_warning_handled_active_on_down_hosts', + 'services_warning_handled_passive_on_down_hosts', + 'services_warning_handled_not_checked_on_down_hosts', + 'services_warning_unhandled_active_on_down_hosts', + 'services_warning_unhandled_passive_on_down_hosts', + 'services_warning_unhandled_not_checked_on_down_hosts', + 'services_critical_handled_active_on_down_hosts', + 'services_critical_handled_passive_on_down_hosts', + 'services_critical_handled_not_checked_on_down_hosts', + 'services_critical_unhandled_active_on_down_hosts', + 'services_critical_unhandled_passive_on_down_hosts', + 'services_critical_unhandled_not_checked_on_down_hosts', + 'services_unknown_handled_active_on_down_hosts', + 'services_unknown_handled_passive_on_down_hosts', + 'services_unknown_handled_not_checked_on_down_hosts', + 'services_unknown_unhandled_active_on_down_hosts', + 'services_unknown_unhandled_passive_on_down_hosts', + 'services_unknown_unhandled_not_checked_on_down_hosts', + 'services_ok_on_unreachable_hosts', + 'services_ok_not_checked_on_unreachable_hosts', + 'services_pending_on_unreachable_hosts', + 'services_pending_not_checked_on_unreachable_hosts', + 'services_warning_handled_active_on_unreachable_hosts', + 'services_warning_handled_passive_on_unreachable_hosts', + 'services_warning_handled_not_checked_on_unreachable_hosts', + 'services_warning_unhandled_active_on_unreachable_hosts', + 'services_warning_unhandled_passive_on_unreachable_hosts', + 'services_warning_unhandled_not_checked_on_unreachable_hosts', + 'services_critical_handled_active_on_unreachable_hosts', + 'services_critical_handled_passive_on_unreachable_hosts', + 'services_critical_handled_not_checked_on_unreachable_hosts', + 'services_critical_unhandled_active_on_unreachable_hosts', + 'services_critical_unhandled_passive_on_unreachable_hosts', + 'services_critical_unhandled_not_checked_on_unreachable_hosts', + 'services_unknown_handled_active_on_unreachable_hosts', + 'services_unknown_handled_passive_on_unreachable_hosts', + 'services_unknown_handled_not_checked_on_unreachable_hosts', + 'services_unknown_unhandled_active_on_unreachable_hosts', + 'services_unknown_unhandled_passive_on_unreachable_hosts', + 'services_unknown_unhandled_not_checked_on_unreachable_hosts', + 'services_ok_on_pending_hosts', + 'services_ok_not_checked_on_pending_hosts', + 'services_pending_on_pending_hosts', + 'services_pending_not_checked_on_pending_hosts', + 'services_warning_handled_active_on_pending_hosts', + 'services_warning_handled_passive_on_pending_hosts', + 'services_warning_handled_not_checked_on_pending_hosts', + 'services_warning_unhandled_active_on_pending_hosts', + 'services_warning_unhandled_passive_on_pending_hosts', + 'services_warning_unhandled_not_checked_on_pending_hosts', + 'services_critical_handled_active_on_pending_hosts', + 'services_critical_handled_passive_on_pending_hosts', + 'services_critical_handled_not_checked_on_pending_hosts', + 'services_critical_unhandled_active_on_pending_hosts', + 'services_critical_unhandled_passive_on_pending_hosts', + 'services_critical_unhandled_not_checked_on_pending_hosts', + 'services_unknown_handled_active_on_pending_hosts', + 'services_unknown_handled_passive_on_pending_hosts', + 'services_unknown_handled_not_checked_on_pending_hosts', + 'services_unknown_unhandled_active_on_pending_hosts', + 'services_unknown_unhandled_passive_on_pending_hosts', + 'services_unknown_unhandled_not_checked_on_pending_hosts' ); } } From 3e495b6eaf8e18f26e82489ea2fbc0583e178bcf Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 4 Mar 2014 09:39:00 +0100 Subject: [PATCH 4/4] Refactor view so that it applies to the new design refs #3782 --- .../controllers/TacticalController.php | 135 +++++- .../components/hostservicechecks.phtml | 76 +++ .../components/monitoringfeatures.phtml | 182 ++++++++ .../servicestatesummarybyhoststate.phtml | 437 ++++++++++++++++++ .../tactical/components/statussummary.phtml | 431 +++++++++++++++++ .../views/scripts/tactical/index.phtml | 127 +---- 6 files changed, 1264 insertions(+), 124 deletions(-) create mode 100644 modules/monitoring/application/views/scripts/tactical/components/hostservicechecks.phtml create mode 100644 modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml create mode 100644 modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml create mode 100644 modules/monitoring/application/views/scripts/tactical/components/statussummary.phtml diff --git a/modules/monitoring/application/controllers/TacticalController.php b/modules/monitoring/application/controllers/TacticalController.php index 2b434bb2f..3a3354d15 100644 --- a/modules/monitoring/application/controllers/TacticalController.php +++ b/modules/monitoring/application/controllers/TacticalController.php @@ -1,17 +1,144 @@ view->statusSummary = StatusSummary::fromRequest($this->_request)->getQuery()->fetchRow(); + $this->view->statusSummary = StatusSummary::fromRequest( + $this->_request, + array( + 'hosts_up', + 'hosts_up_not_checked', + 'hosts_pending', + 'hosts_pending_not_checked', + 'hosts_down', + 'hosts_down_handled', + 'hosts_down_unhandled', + 'hosts_down_handled_active', + 'hosts_down_handled_passive', + 'hosts_down_handled_not_checked', + 'hosts_down_unhandled_active', + 'hosts_down_unhandled_passive', + 'hosts_down_unhandled_not_checked', + 'hosts_unreachable', + 'hosts_unreachable_handled', + 'hosts_unreachable_unhandled', + 'hosts_unreachable_handled_active', + 'hosts_unreachable_handled_passive', + 'hosts_unreachable_handled_not_checked', + 'hosts_unreachable_unhandled_active', + 'hosts_unreachable_unhandled_passive', + 'hosts_unreachable_unhandled_not_checked', + + 'services_ok_on_up_hosts', + 'services_ok_not_checked_on_up_hosts', + 'services_pending_on_up_hosts', + 'services_pending_not_checked_on_up_hosts', + 'services_warning_handled_active_on_up_hosts', + 'services_warning_handled_passive_on_up_hosts', + 'services_warning_handled_not_checked_on_up_hosts', + 'services_warning_unhandled_active_on_up_hosts', + 'services_warning_unhandled_passive_on_up_hosts', + 'services_warning_unhandled_not_checked_on_up_hosts', + 'services_critical_handled_active_on_up_hosts', + 'services_critical_handled_passive_on_up_hosts', + 'services_critical_handled_not_checked_on_up_hosts', + 'services_critical_unhandled_active_on_up_hosts', + 'services_critical_unhandled_passive_on_up_hosts', + 'services_critical_unhandled_not_checked_on_up_hosts', + 'services_unknown_handled_active_on_up_hosts', + 'services_unknown_handled_passive_on_up_hosts', + 'services_unknown_handled_not_checked_on_up_hosts', + 'services_unknown_unhandled_active_on_up_hosts', + 'services_unknown_unhandled_passive_on_up_hosts', + 'services_unknown_unhandled_not_checked_on_up_hosts', + 'services_ok_on_down_hosts', + 'services_ok_not_checked_on_down_hosts', + 'services_pending_on_down_hosts', + 'services_pending_not_checked_on_down_hosts', + 'services_warning_handled_active_on_down_hosts', + 'services_warning_handled_passive_on_down_hosts', + 'services_warning_handled_not_checked_on_down_hosts', + 'services_warning_unhandled_active_on_down_hosts', + 'services_warning_unhandled_passive_on_down_hosts', + 'services_warning_unhandled_not_checked_on_down_hosts', + 'services_critical_handled_active_on_down_hosts', + 'services_critical_handled_passive_on_down_hosts', + 'services_critical_handled_not_checked_on_down_hosts', + 'services_critical_unhandled_active_on_down_hosts', + 'services_critical_unhandled_passive_on_down_hosts', + 'services_critical_unhandled_not_checked_on_down_hosts', + 'services_unknown_handled_active_on_down_hosts', + 'services_unknown_handled_passive_on_down_hosts', + 'services_unknown_handled_not_checked_on_down_hosts', + 'services_unknown_unhandled_active_on_down_hosts', + 'services_unknown_unhandled_passive_on_down_hosts', + 'services_unknown_unhandled_not_checked_on_down_hosts', + 'services_ok_on_unreachable_hosts', + 'services_ok_not_checked_on_unreachable_hosts', + 'services_pending_on_unreachable_hosts', + 'services_pending_not_checked_on_unreachable_hosts', + 'services_warning_handled_active_on_unreachable_hosts', + 'services_warning_handled_passive_on_unreachable_hosts', + 'services_warning_handled_not_checked_on_unreachable_hosts', + 'services_warning_unhandled_active_on_unreachable_hosts', + 'services_warning_unhandled_passive_on_unreachable_hosts', + 'services_warning_unhandled_not_checked_on_unreachable_hosts', + 'services_critical_handled_active_on_unreachable_hosts', + 'services_critical_handled_passive_on_unreachable_hosts', + 'services_critical_handled_not_checked_on_unreachable_hosts', + 'services_critical_unhandled_active_on_unreachable_hosts', + 'services_critical_unhandled_passive_on_unreachable_hosts', + 'services_critical_unhandled_not_checked_on_unreachable_hosts', + 'services_unknown_handled_active_on_unreachable_hosts', + 'services_unknown_handled_passive_on_unreachable_hosts', + 'services_unknown_handled_not_checked_on_unreachable_hosts', + 'services_unknown_unhandled_active_on_unreachable_hosts', + 'services_unknown_unhandled_passive_on_unreachable_hosts', + 'services_unknown_unhandled_not_checked_on_unreachable_hosts', + 'services_ok_on_pending_hosts', + 'services_ok_not_checked_on_pending_hosts', + 'services_pending_on_pending_hosts', + 'services_pending_not_checked_on_pending_hosts', + 'services_warning_handled_active_on_pending_hosts', + 'services_warning_handled_passive_on_pending_hosts', + 'services_warning_handled_not_checked_on_pending_hosts', + 'services_warning_unhandled_active_on_pending_hosts', + 'services_warning_unhandled_passive_on_pending_hosts', + 'services_warning_unhandled_not_checked_on_pending_hosts', + 'services_critical_handled_active_on_pending_hosts', + 'services_critical_handled_passive_on_pending_hosts', + 'services_critical_handled_not_checked_on_pending_hosts', + 'services_critical_unhandled_active_on_pending_hosts', + 'services_critical_unhandled_passive_on_pending_hosts', + 'services_critical_unhandled_not_checked_on_pending_hosts', + 'services_unknown_handled_active_on_pending_hosts', + 'services_unknown_handled_passive_on_pending_hosts', + 'services_unknown_handled_not_checked_on_pending_hosts', + 'services_unknown_unhandled_active_on_pending_hosts', + 'services_unknown_unhandled_passive_on_pending_hosts', + 'services_unknown_unhandled_not_checked_on_pending_hosts', + + 'hosts_active', + 'hosts_passive', + 'hosts_not_checked', + 'services_active', + 'services_passive', + 'services_not_checked', + 'hosts_processing_event_handlers', + 'services_processing_event_handlers', + 'hosts_triggering_notifications', + 'services_triggering_notifications', + 'hosts_with_flap_detection', + 'services_with_flap_detection', + 'hosts_flapping', + 'services_flapping' + ) + )->getQuery()->fetchRow(); } } -// @codingStandardsIgnoreStop \ No newline at end of file diff --git a/modules/monitoring/application/views/scripts/tactical/components/hostservicechecks.phtml b/modules/monitoring/application/views/scripts/tactical/components/hostservicechecks.phtml new file mode 100644 index 000000000..4bce6ce99 --- /dev/null +++ b/modules/monitoring/application/views/scripts/tactical/components/hostservicechecks.phtml @@ -0,0 +1,76 @@ + + + + + + + + + + + + +
Host checksService checks
+statusSummary->hosts_active): ?> + + + statusSummary->hosts_active; ?> Active + + + +statusSummary->hosts_passive): ?> + + + statusSummary->hosts_passive; ?> Passive + + + +statusSummary->hosts_not_checked): ?> + + + statusSummary->hosts_not_checked; ?> Not checked + + + + +statusSummary->services_active): ?> + + + statusSummary->services_active; ?> Active + + + +statusSummary->services_passive): ?> + + + statusSummary->services_passive; ?> Passive + + + +statusSummary->services_not_checked): ?> + + + statusSummary->services_not_checked; ?> Not checked + + + +
+
diff --git a/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml b/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml new file mode 100644 index 000000000..72f000a4b --- /dev/null +++ b/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml @@ -0,0 +1,182 @@ +statusSummary; +$total_services = $summary->services_active + $summary->services_passive + $summary->services_not_checked; +$total_hosts = $summary->hosts_active + $summary->hosts_passive + $summary->hosts_not_checked; + +$services_without_flap_detection = $total_services - $summary->services_with_flap_detection; +$hosts_without_flap_detection = $total_hosts - $summary->hosts_with_flap_detection; +$non_flapping_services = $total_services - $summary->services_flapping; +$non_flapping_hosts = $total_hosts - $summary->hosts_flapping; +$hosts_not_triggering_notifications = $total_hosts - $summary->hosts_triggering_notifications; +$services_not_triggering_notifications = $total_services - $summary->services_triggering_notifications; +$hosts_not_processing_event_handlers = $total_hosts - $summary->hosts_processing_event_handlers; +$services_not_processing_event_handlers = $total_services - $summary->services_processing_event_handlers; + +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Monitoring features
HostsServices
+ Flap detection +
+ + + + hosts disabled + + + + All hosts enabled + + +hosts_flapping): ?> + + + hosts_flapping; ?> hosts flapping + + + + + + + + + services disabled + + + + All services enabled + + +services_flapping): ?> + + + services_flapping; ?> services flapping + + + + +
+ Notifications +
+ + + + hosts disabled + + + + All hosts enabled + + + + + + + + hosts disabled + + + + All services enabled + + + +
+ Event handlers +
+ + + + hosts disabled + + + + All hosts enabled + + + + + + + + hosts disabled + + + + All services enabled + + + +
+
diff --git a/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml b/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml new file mode 100644 index 000000000..51ed78c53 --- /dev/null +++ b/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml @@ -0,0 +1,437 @@ + + + + + + CRITICAL + + + + + unhandled + + + + + Active + + + + + + + Passive + + + + + + + Not checked + + + + + + + + + handled + + + + + Active + + + + + + + Passive + + + + + + + Not checked + + + + + + + + + + + WARNING + + + + + unhandled + + + + + Active + + + + + + + Passive + + + + + + + Not checked + + + + + + + + + handled + + + + + Active + + + + + + + Passive + + + + + + + Not checked + + + + + + + + + + + UNKNOWN + + + + + unhandled + + + + + Active + + + + + + + Passive + + + + + + + Not checked + + + + + + + + + handled + + + + + Active + + + + + + + Passive + + + + + + + Not checked + + + + + + + + + + + OK + + + + + Not checked + + + + + + + + + PENDING + + + + + Not checked + + + + + diff --git a/modules/monitoring/application/views/scripts/tactical/components/statussummary.phtml b/modules/monitoring/application/views/scripts/tactical/components/statussummary.phtml new file mode 100644 index 000000000..018a90509 --- /dev/null +++ b/modules/monitoring/application/views/scripts/tactical/components/statussummary.phtml @@ -0,0 +1,431 @@ + + + + + + + + +statusSummary->hosts_up): ?> + + + + + +statusSummary->hosts_pending): ?> + + + + + +statusSummary->hosts_down): ?> + + + + + +statusSummary->hosts_unreachable): ?> + + + + + + +
Status Summary
HostsServices
+ + + statusSummary->hosts_up; ?> UP + +statusSummary->hosts_up_not_checked): ?> + + + statusSummary->hosts_up_not_checked; ?> disabled + + + + + + partial( + 'tactical/components/parts/servicestatesummarybyhoststate.phtml', + array( + 'hostState' => 0, + 'services_ok' => $this->statusSummary->services_ok_on_up_hosts, + 'services_ok_not_checked' => $this->statusSummary->services_ok_not_checked_on_up_hosts, + 'services_pending' => $this->statusSummary->services_pending_on_up_hosts, + 'services_pending_not_checked' => $this->statusSummary->services_pending_not_checked_on_up_hosts, + 'services_warning_handled_active' => $this->statusSummary->services_warning_handled_active_on_up_hosts, + 'services_warning_handled_passive' => $this->statusSummary->services_warning_handled_passive_on_up_hosts, + 'services_warning_handled_not_checked' => $this->statusSummary->services_warning_handled_not_checked_on_up_hosts, + 'services_warning_unhandled_active' => $this->statusSummary->services_warning_unhandled_active_on_up_hosts, + 'services_warning_unhandled_passive' => $this->statusSummary->services_warning_unhandled_passive_on_up_hosts, + 'services_warning_unhandled_not_checked' => $this->statusSummary->services_warning_unhandled_not_checked_on_up_hosts, + 'services_critical_handled_active' => $this->statusSummary->services_critical_handled_active_on_up_hosts, + 'services_critical_handled_passive' => $this->statusSummary->services_critical_handled_passive_on_up_hosts, + 'services_critical_handled_not_checked' => $this->statusSummary->services_critical_handled_not_checked_on_up_hosts, + 'services_critical_unhandled_active' => $this->statusSummary->services_critical_unhandled_active_on_up_hosts, + 'services_critical_unhandled_passive' => $this->statusSummary->services_critical_unhandled_passive_on_up_hosts, + 'services_critical_unhandled_not_checked' => $this->statusSummary->services_critical_unhandled_not_checked_on_up_hosts, + 'services_unknown_handled_active' => $this->statusSummary->services_unknown_handled_active_on_up_hosts, + 'services_unknown_handled_passive' => $this->statusSummary->services_unknown_handled_passive_on_up_hosts, + 'services_unknown_handled_not_checked' => $this->statusSummary->services_unknown_handled_not_checked_on_up_hosts, + 'services_unknown_unhandled_active' => $this->statusSummary->services_unknown_unhandled_active_on_up_hosts, + 'services_unknown_unhandled_passive' => $this->statusSummary->services_unknown_unhandled_passive_on_up_hosts, + 'services_unknown_unhandled_not_checked' => $this->statusSummary->services_unknown_unhandled_not_checked_on_up_hosts + ) + ); ?> +
+ + + statusSummary->hosts_pending; ?> PENDING + +statusSummary->hosts_pending_not_checked): ?> + + + statusSummary->hosts_pending_not_checked; ?> disabled + + + + + + partial( + 'tactical/components/parts/servicestatesummarybyhoststate.phtml', + array( + 'hostState' => 99, + 'services_ok' => $this->statusSummary->services_ok_on_pending_hosts, + 'services_ok_not_checked' => $this->statusSummary->services_ok_not_checked_on_pending_hosts, + 'services_pending' => $this->statusSummary->services_pending_on_pending_hosts, + 'services_pending_not_checked' => $this->statusSummary->services_pending_not_checked_on_pending_hosts, + 'services_warning_handled_active' => $this->statusSummary->services_warning_handled_active_on_pending_hosts, + 'services_warning_handled_passive' => $this->statusSummary->services_warning_handled_passive_on_pending_hosts, + 'services_warning_handled_not_checked' => $this->statusSummary->services_warning_handled_not_checked_on_pending_hosts, + 'services_warning_unhandled_active' => $this->statusSummary->services_warning_unhandled_active_on_pending_hosts, + 'services_warning_unhandled_passive' => $this->statusSummary->services_warning_unhandled_passive_on_pending_hosts, + 'services_warning_unhandled_not_checked' => $this->statusSummary->services_warning_unhandled_not_checked_on_pending_hosts, + 'services_critical_handled_active' => $this->statusSummary->services_critical_handled_active_on_pending_hosts, + 'services_critical_handled_passive' => $this->statusSummary->services_critical_handled_passive_on_pending_hosts, + 'services_critical_handled_not_checked' => $this->statusSummary->services_critical_handled_not_checked_on_pending_hosts, + 'services_critical_unhandled_active' => $this->statusSummary->services_critical_unhandled_active_on_pending_hosts, + 'services_critical_unhandled_passive' => $this->statusSummary->services_critical_unhandled_passive_on_pending_hosts, + 'services_critical_unhandled_not_checked' => $this->statusSummary->services_critical_unhandled_not_checked_on_pending_hosts, + 'services_unknown_handled_active' => $this->statusSummary->services_unknown_handled_active_on_pending_hosts, + 'services_unknown_handled_passive' => $this->statusSummary->services_unknown_handled_passive_on_pending_hosts, + 'services_unknown_handled_not_checked' => $this->statusSummary->services_unknown_handled_not_checked_on_pending_hosts, + 'services_unknown_unhandled_active' => $this->statusSummary->services_unknown_unhandled_active_on_pending_hosts, + 'services_unknown_unhandled_passive' => $this->statusSummary->services_unknown_unhandled_passive_on_pending_hosts, + 'services_unknown_unhandled_not_checked' => $this->statusSummary->services_unknown_unhandled_not_checked_on_pending_hosts + ) + ); ?> +
+ + + statusSummary->hosts_down; ?> DOWN + +statusSummary->hosts_down_unhandled): ?> + + + statusSummary->hosts_down_unhandled; ?> unhandled + +statusSummary->hosts_down_unhandled_active): ?> + + + statusSummary->hosts_down_unhandled_active; ?> Active + + + +statusSummary->hosts_down_unhandled_passive): ?> + + + statusSummary->hosts_down_unhandled_passive; ?> Passive + + + +statusSummary->hosts_down_unhandled_not_checked): ?> + + + statusSummary->hosts_down_unhandled_not_checked; ?> Not checked + + + + + +statusSummary->hosts_down_handled): ?> + + + statusSummary->hosts_down_handled; ?> handled + +statusSummary->hosts_down_handled_active): ?> + + + statusSummary->hosts_down_handled_active; ?> Active + + + +statusSummary->hosts_down_handled_passive): ?> + + + statusSummary->hosts_down_handled_passive; ?> Passive + + + +statusSummary->hosts_down_handled_not_checked): ?> + + + statusSummary->hosts_down_handled_not_checked; ?> Not checked + + + + + + + + partial( + 'tactical/components/parts/servicestatesummarybyhoststate.phtml', + array( + 'hostState' => 1, + 'services_ok' => $this->statusSummary->services_ok_on_down_hosts, + 'services_ok_not_checked' => $this->statusSummary->services_ok_not_checked_on_down_hosts, + 'services_pending' => $this->statusSummary->services_pending_on_down_hosts, + 'services_pending_not_checked' => $this->statusSummary->services_pending_not_checked_on_down_hosts, + 'services_warning_handled_active' => $this->statusSummary->services_warning_handled_active_on_down_hosts, + 'services_warning_handled_passive' => $this->statusSummary->services_warning_handled_passive_on_down_hosts, + 'services_warning_handled_not_checked' => $this->statusSummary->services_warning_handled_not_checked_on_down_hosts, + 'services_warning_unhandled_active' => $this->statusSummary->services_warning_unhandled_active_on_down_hosts, + 'services_warning_unhandled_passive' => $this->statusSummary->services_warning_unhandled_passive_on_down_hosts, + 'services_warning_unhandled_not_checked' => $this->statusSummary->services_warning_unhandled_not_checked_on_down_hosts, + 'services_critical_handled_active' => $this->statusSummary->services_critical_handled_active_on_down_hosts, + 'services_critical_handled_passive' => $this->statusSummary->services_critical_handled_passive_on_down_hosts, + 'services_critical_handled_not_checked' => $this->statusSummary->services_critical_handled_not_checked_on_down_hosts, + 'services_critical_unhandled_active' => $this->statusSummary->services_critical_unhandled_active_on_down_hosts, + 'services_critical_unhandled_passive' => $this->statusSummary->services_critical_unhandled_passive_on_down_hosts, + 'services_critical_unhandled_not_checked' => $this->statusSummary->services_critical_unhandled_not_checked_on_down_hosts, + 'services_unknown_handled_active' => $this->statusSummary->services_unknown_handled_active_on_down_hosts, + 'services_unknown_handled_passive' => $this->statusSummary->services_unknown_handled_passive_on_down_hosts, + 'services_unknown_handled_not_checked' => $this->statusSummary->services_unknown_handled_not_checked_on_down_hosts, + 'services_unknown_unhandled_active' => $this->statusSummary->services_unknown_unhandled_active_on_down_hosts, + 'services_unknown_unhandled_passive' => $this->statusSummary->services_unknown_unhandled_passive_on_down_hosts, + 'services_unknown_unhandled_not_checked' => $this->statusSummary->services_unknown_unhandled_not_checked_on_down_hosts + ) + ); ?> +
+ + + statusSummary->hosts_unreachable; ?> UNREACHABLE + +statusSummary->hosts_unreachable_unhandled): ?> + + + statusSummary->hosts_unreachable_unhandled; ?> unhandled + +statusSummary->hosts_unreachable_unhandled_active): ?> + + + statusSummary->hosts_unreachable_unhandled_active; ?> Active + + + +statusSummary->hosts_unreachable_unhandled_passive): ?> + + + statusSummary->hosts_unreachable_unhandled_passive; ?> Passive + + + +statusSummary->hosts_unreachable_unhandled_not_checked): ?> + + + statusSummary->hosts_unreachable_unhandled_not_checked; ?> Not checked + + + + + +statusSummary->hosts_unreachable_handled): ?> + + + statusSummary->hosts_unreachable_handled; ?> handled + +statusSummary->hosts_unreachable_handled_active): ?> + + + statusSummary->hosts_unreachable_handled_active; ?> Active + + + +statusSummary->hosts_unreachable_handled_passive): ?> + + + statusSummary->hosts_unreachable_handled_passive; ?> Passive + + + +statusSummary->hosts_unreachable_handled_not_checked): ?> + + + statusSummary->hosts_unreachable_handled_not_checked; ?> Not checked + + + + + + + + partial( + 'tactical/components/parts/servicestatesummarybyhoststate.phtml', + array( + 'hostState' => 2, + 'services_ok' => $this->statusSummary->services_ok_on_unreachable_hosts, + 'services_ok_not_checked' => $this->statusSummary->services_ok_not_checked_on_unreachable_hosts, + 'services_pending' => $this->statusSummary->services_pending_on_unreachable_hosts, + 'services_pending_not_checked' => $this->statusSummary->services_pending_not_checked_on_unreachable_hosts, + 'services_warning_handled_active' => $this->statusSummary->services_warning_handled_active_on_unreachable_hosts, + 'services_warning_handled_passive' => $this->statusSummary->services_warning_handled_passive_on_unreachable_hosts, + 'services_warning_handled_not_checked' => $this->statusSummary->services_warning_handled_not_checked_on_unreachable_hosts, + 'services_warning_unhandled_active' => $this->statusSummary->services_warning_unhandled_active_on_unreachable_hosts, + 'services_warning_unhandled_passive' => $this->statusSummary->services_warning_unhandled_passive_on_unreachable_hosts, + 'services_warning_unhandled_not_checked' => $this->statusSummary->services_warning_unhandled_not_checked_on_unreachable_hosts, + 'services_critical_handled_active' => $this->statusSummary->services_critical_handled_active_on_unreachable_hosts, + 'services_critical_handled_passive' => $this->statusSummary->services_critical_handled_passive_on_unreachable_hosts, + 'services_critical_handled_not_checked' => $this->statusSummary->services_critical_handled_not_checked_on_unreachable_hosts, + 'services_critical_unhandled_active' => $this->statusSummary->services_critical_unhandled_active_on_unreachable_hosts, + 'services_critical_unhandled_passive' => $this->statusSummary->services_critical_unhandled_passive_on_unreachable_hosts, + 'services_critical_unhandled_not_checked' => $this->statusSummary->services_critical_unhandled_not_checked_on_unreachable_hosts, + 'services_unknown_handled_active' => $this->statusSummary->services_unknown_handled_active_on_unreachable_hosts, + 'services_unknown_handled_passive' => $this->statusSummary->services_unknown_handled_passive_on_unreachable_hosts, + 'services_unknown_handled_not_checked' => $this->statusSummary->services_unknown_handled_not_checked_on_unreachable_hosts, + 'services_unknown_unhandled_active' => $this->statusSummary->services_unknown_unhandled_active_on_unreachable_hosts, + 'services_unknown_unhandled_passive' => $this->statusSummary->services_unknown_unhandled_passive_on_unreachable_hosts, + 'services_unknown_unhandled_not_checked' => $this->statusSummary->services_unknown_unhandled_not_checked_on_unreachable_hosts + ) + ); ?> +
+
diff --git a/modules/monitoring/application/views/scripts/tactical/index.phtml b/modules/monitoring/application/views/scripts/tactical/index.phtml index 4c0d61600..2d650991f 100644 --- a/modules/monitoring/application/views/scripts/tactical/index.phtml +++ b/modules/monitoring/application/views/scripts/tactical/index.phtml @@ -1,120 +1,7 @@ -statusSummary; -$state = array( - 'host' => array( - 'up' => 0, - 'down' => 1, - 'unreachable' => 2, - 'pending' => 99 - ), - 'service' => array( - 'ok' => 0, - 'warning' => 1, - 'critical' => 2, - 'unknown' => 3, - 'pending' => 99 - ) -); -function init_upper($string) { - return mb_strtoupper(substr($string, 0, 1)) . substr($string, 1); -} -$tacticalTables = array(); -foreach (array( - 'host' => array('up', 'down', 'unreachable', 'pending'), - 'service' => array('ok', 'critical', 'warning', 'unknown', 'pending') -) as $key => $value) { - $tacticalTables[$key] = array(); - foreach ($value as $valueState) { - $tacticalTables[$key][$valueState] = array(); - $value_2_ref = $key . 's_' . $valueState; - $tacticalTables[$key][$valueState][$valueState] = (int)$summary->{$value_2_ref}; - foreach (array('disabled', 'unhandled', 'on_problem_hosts') as $value_3) { - $value_3_ref = $value_2_ref . '_' . $value_3; - if (isset($summary->{$value_3_ref})) { - $tacticalTables[$key][$valueState][$value_3] = (int)$summary->{$value_3_ref}; - } - } - } -} -foreach ($tacticalTables as $key => $value) { - printf( - '', - count($value), - init_upper($key) - ); - foreach ($value as $keyState => $valueState) { - printf( - ''; - } - echo '

%ss

%s: %d', - $keyState, - $this->href( - 'monitoring/list/' . $key . 's', - array($key . '_state' => $state[$key][$keyState]) - ), - init_upper($key), - $keyState, - init_upper($keyState), - $valueState[$keyState] - ); - foreach ($valueState as $keyStateDetail => $valueStateDetail) { - if ($keyStateDetail !== $keyState && $valueStateDetail !== 0) { - $strReplaced = str_replace('_', ' ', $keyStateDetail); - printf( - '
%s: %d', - $this->href( - 'monitoring/list/' . $key . 's', - array( - $key . '_state' => $state[$key][$keyState], - $key . '_' . $keyStateDetail => 1 - ) - ), - init_upper($key), - $keyState, - $strReplaced, - ($strReplaced === 'unhandled' ? '' : ' style="color: #f5a9a9"'), - $strReplaced, - $valueStateDetail - ); - } - } - echo '
'; -} -?> - - - - - - - - - - '; - foreach (array('host', 'service') as $hst_srv) { - foreach (array('act', 'pass') as $act_pass) { - $var_ref = $this->statusSummary->{sprintf( - '%ss%s_%sive_checked', - $hst_srv, - ($check_enabled ? '' : '_not'), - $act_pass - )}; - if ($var_ref === '0') { - echo ''; - } - } - echo ''; - } - ?> -

Host Checks

Service Checks

ActivePassiveActivePassive
'; - } else { - printf( - '%sabled: %s', - ($check_enabled ? 'up' : 'down'), - ($check_enabled ? 'en' : 'dis'), - $var_ref - ); - } - echo '
\ No newline at end of file +
+
+ render('tactical/components/hostservicechecks.phtml'); ?> + render('tactical/components/monitoringfeatures.phtml'); ?> + render('tactical/components/statussummary.phtml'); ?> +
+