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'); ?> +
+