From 3e02d5aff85babc3ffbfcf52313f2108e313aa23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:46:43 +0200 Subject: Adding upstream version 2.12.1. Signed-off-by: Daniel Baumann --- .../application/views/scripts/comment/remove.phtml | 11 + .../application/views/scripts/comment/show.phtml | 86 +++++ .../views/scripts/comments/delete-all.phtml | 12 + .../application/views/scripts/comments/show.phtml | 19 + .../application/views/scripts/config/form.phtml | 6 + .../application/views/scripts/config/index.phtml | 78 ++++ .../views/scripts/config/security.phtml | 6 + .../views/scripts/downtime/remove.phtml | 13 + .../application/views/scripts/downtime/show.phtml | 173 +++++++++ .../views/scripts/downtimes/delete-all.phtml | 12 + .../application/views/scripts/downtimes/show.phtml | 19 + .../application/views/scripts/event/show.phtml | 34 ++ .../scripts/form/reorder-command-transports.phtml | 93 +++++ .../scripts/health/disable-notifications.phtml | 20 ++ .../application/views/scripts/health/info.phtml | 87 +++++ .../views/scripts/health/not-running.phtml | 8 + .../application/views/scripts/health/stats.phtml | 150 ++++++++ .../application/views/scripts/host/services.phtml | 23 ++ .../application/views/scripts/host/show.phtml | 14 + .../application/views/scripts/hosts/show.phtml | 206 +++++++++++ .../application/views/scripts/list/comments.phtml | 61 ++++ .../scripts/list/components/hostssummary.phtml | 92 +++++ .../scripts/list/components/selectioninfo.phtml | 15 + .../scripts/list/components/servicesummary.phtml | 118 ++++++ .../views/scripts/list/contactgroups.phtml | 53 +++ .../application/views/scripts/list/contacts.phtml | 83 +++++ .../application/views/scripts/list/downtimes.phtml | 64 ++++ .../application/views/scripts/list/eventgrid.phtml | 123 +++++++ .../views/scripts/list/eventhistory.phtml | 22 ++ .../views/scripts/list/hostgroup-grid.phtml | 173 +++++++++ .../views/scripts/list/hostgroups.phtml | 296 ++++++++++++++++ .../application/views/scripts/list/hosts.phtml | 106 ++++++ .../views/scripts/list/notifications.phtml | 124 +++++++ .../views/scripts/list/servicegrid-flipped.phtml | 144 ++++++++ .../views/scripts/list/servicegrid.phtml | 144 ++++++++ .../views/scripts/list/servicegroup-grid.phtml | 217 ++++++++++++ .../views/scripts/list/servicegroups.phtml | 184 ++++++++++ .../application/views/scripts/list/services.phtml | 161 +++++++++ .../views/scripts/object/detail-history.phtml | 13 + .../views/scripts/object/detail-tabhook.phtml | 21 ++ .../partials/command/object-command-form.phtml | 18 + .../partials/command/objects-command-form.phtml | 15 + .../partials/comment/comment-description.phtml | 24 ++ .../scripts/partials/comment/comment-detail.phtml | 82 +++++ .../scripts/partials/comment/comment-header.phtml | 10 + .../scripts/partials/comment/comments-header.phtml | 32 ++ .../partials/downtime/downtime-header.phtml | 101 ++++++ .../partials/downtime/downtimes-header.phtml | 40 +++ .../views/scripts/partials/event-history.phtml | 267 ++++++++++++++ .../scripts/partials/host/objects-header.phtml | 41 +++ .../scripts/partials/object/detail-content.phtml | 53 +++ .../scripts/partials/object/host-header.phtml | 51 +++ .../scripts/partials/object/quick-actions.phtml | 144 ++++++++ .../scripts/partials/object/service-header.phtml | 72 ++++ .../scripts/partials/service/objects-header.phtml | 45 +++ .../views/scripts/partials/show-more.phtml | 15 + .../application/views/scripts/service/show.phtml | 8 + .../application/views/scripts/services/show.phtml | 208 +++++++++++ .../scripts/show/components/acknowledgement.phtml | 94 +++++ .../views/scripts/show/components/actions.phtml | 43 +++ .../scripts/show/components/checksource.phtml | 6 + .../scripts/show/components/checkstatistics.phtml | 85 +++++ .../scripts/show/components/checktimeperiod.phtml | 21 ++ .../views/scripts/show/components/command.phtml | 52 +++ .../views/scripts/show/components/comments.phtml | 86 +++++ .../views/scripts/show/components/contacts.phtml | 38 ++ .../views/scripts/show/components/downtime.phtml | 109 ++++++ .../views/scripts/show/components/extensions.phtml | 4 + .../views/scripts/show/components/flags.phtml | 4 + .../views/scripts/show/components/flapping.phtml | 14 + .../views/scripts/show/components/grapher.phtml | 6 + .../views/scripts/show/components/hostgroups.phtml | 19 + .../views/scripts/show/components/notes.phtml | 48 +++ .../scripts/show/components/notifications.phtml | 68 ++++ .../views/scripts/show/components/output.phtml | 5 + .../views/scripts/show/components/perfdata.phtml | 4 + .../views/scripts/show/components/reachable.phtml | 15 + .../scripts/show/components/servicegroups.phtml | 20 ++ .../views/scripts/show/components/status.phtml | 0 .../application/views/scripts/show/contact.phtml | 67 ++++ .../tactical/components/hostservicechecks.phtml | 131 +++++++ .../tactical/components/monitoringfeatures.phtml | 287 +++++++++++++++ .../scripts/tactical/components/ok_hosts.phtml | 81 +++++ .../parts/servicestatesummarybyhoststate.phtml | 394 +++++++++++++++++++++ .../tactical/components/problem_hosts.phtml | 74 ++++ .../application/views/scripts/tactical/index.phtml | 145 ++++++++ .../application/views/scripts/timeline/index.phtml | 196 ++++++++++ 87 files changed, 6626 insertions(+) create mode 100644 modules/monitoring/application/views/scripts/comment/remove.phtml create mode 100644 modules/monitoring/application/views/scripts/comment/show.phtml create mode 100644 modules/monitoring/application/views/scripts/comments/delete-all.phtml create mode 100644 modules/monitoring/application/views/scripts/comments/show.phtml create mode 100644 modules/monitoring/application/views/scripts/config/form.phtml create mode 100644 modules/monitoring/application/views/scripts/config/index.phtml create mode 100644 modules/monitoring/application/views/scripts/config/security.phtml create mode 100644 modules/monitoring/application/views/scripts/downtime/remove.phtml create mode 100644 modules/monitoring/application/views/scripts/downtime/show.phtml create mode 100644 modules/monitoring/application/views/scripts/downtimes/delete-all.phtml create mode 100644 modules/monitoring/application/views/scripts/downtimes/show.phtml create mode 100644 modules/monitoring/application/views/scripts/event/show.phtml create mode 100644 modules/monitoring/application/views/scripts/form/reorder-command-transports.phtml create mode 100644 modules/monitoring/application/views/scripts/health/disable-notifications.phtml create mode 100644 modules/monitoring/application/views/scripts/health/info.phtml create mode 100644 modules/monitoring/application/views/scripts/health/not-running.phtml create mode 100644 modules/monitoring/application/views/scripts/health/stats.phtml create mode 100644 modules/monitoring/application/views/scripts/host/services.phtml create mode 100644 modules/monitoring/application/views/scripts/host/show.phtml create mode 100644 modules/monitoring/application/views/scripts/hosts/show.phtml create mode 100644 modules/monitoring/application/views/scripts/list/comments.phtml create mode 100644 modules/monitoring/application/views/scripts/list/components/hostssummary.phtml create mode 100644 modules/monitoring/application/views/scripts/list/components/selectioninfo.phtml create mode 100644 modules/monitoring/application/views/scripts/list/components/servicesummary.phtml create mode 100644 modules/monitoring/application/views/scripts/list/contactgroups.phtml create mode 100644 modules/monitoring/application/views/scripts/list/contacts.phtml create mode 100644 modules/monitoring/application/views/scripts/list/downtimes.phtml create mode 100644 modules/monitoring/application/views/scripts/list/eventgrid.phtml create mode 100644 modules/monitoring/application/views/scripts/list/eventhistory.phtml create mode 100644 modules/monitoring/application/views/scripts/list/hostgroup-grid.phtml create mode 100644 modules/monitoring/application/views/scripts/list/hostgroups.phtml create mode 100644 modules/monitoring/application/views/scripts/list/hosts.phtml create mode 100644 modules/monitoring/application/views/scripts/list/notifications.phtml create mode 100644 modules/monitoring/application/views/scripts/list/servicegrid-flipped.phtml create mode 100644 modules/monitoring/application/views/scripts/list/servicegrid.phtml create mode 100644 modules/monitoring/application/views/scripts/list/servicegroup-grid.phtml create mode 100644 modules/monitoring/application/views/scripts/list/servicegroups.phtml create mode 100644 modules/monitoring/application/views/scripts/list/services.phtml create mode 100644 modules/monitoring/application/views/scripts/object/detail-history.phtml create mode 100644 modules/monitoring/application/views/scripts/object/detail-tabhook.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/command/object-command-form.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/command/objects-command-form.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/comment/comment-description.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/comment/comment-header.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/comment/comments-header.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/event-history.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/host/objects-header.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/object/detail-content.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/object/host-header.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/object/quick-actions.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/object/service-header.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/service/objects-header.phtml create mode 100644 modules/monitoring/application/views/scripts/partials/show-more.phtml create mode 100644 modules/monitoring/application/views/scripts/service/show.phtml create mode 100644 modules/monitoring/application/views/scripts/services/show.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/actions.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/checksource.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/checktimeperiod.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/command.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/comments.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/contacts.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/downtime.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/extensions.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/flags.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/flapping.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/grapher.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/hostgroups.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/notes.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/notifications.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/output.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/perfdata.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/reachable.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/servicegroups.phtml create mode 100644 modules/monitoring/application/views/scripts/show/components/status.phtml create mode 100644 modules/monitoring/application/views/scripts/show/contact.phtml 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/ok_hosts.phtml create mode 100644 modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml create mode 100644 modules/monitoring/application/views/scripts/tactical/components/problem_hosts.phtml create mode 100644 modules/monitoring/application/views/scripts/tactical/index.phtml create mode 100644 modules/monitoring/application/views/scripts/timeline/index.phtml (limited to 'modules/monitoring/application/views/scripts') diff --git a/modules/monitoring/application/views/scripts/comment/remove.phtml b/modules/monitoring/application/views/scripts/comment/remove.phtml new file mode 100644 index 0000000..73f8c68 --- /dev/null +++ b/modules/monitoring/application/views/scripts/comment/remove.phtml @@ -0,0 +1,11 @@ +
+ + compact): ?> + tabs; ?> + + + render('partials/downtime/downtime-header.phtml'); ?> +
+
+ +
diff --git a/modules/monitoring/application/views/scripts/comment/show.phtml b/modules/monitoring/application/views/scripts/comment/show.phtml new file mode 100644 index 0000000..3cbfb76 --- /dev/null +++ b/modules/monitoring/application/views/scripts/comment/show.phtml @@ -0,0 +1,86 @@ +
+ compact): ?> + tabs; ?> + + +
+ render('partials/comment/comment-header.phtml'); ?> +
+
+
+ +

translate('Comment detail information') ?>

+ + + + comment->objecttype === 'service'): ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
translate('Service') ?> + icon('service', $this->translate('Service')); ?> + link()->service( + $this->comment->service_description, + $this->comment->service_display_name, + $this->comment->host_name, + $this->comment->host_display_name + ); + ?> + translate('Host') ?> + icon('host', $this->translate('Host')); ?> + link()->host( + $this->comment->host_name, + $this->comment->host_display_name + ); + ?> +
translate('Author') ?>icon('user', $this->translate('User')) ?> escape($this->comment->author) ?>
translate('Persistent') ?>escape($this->comment->persistent) ? $this->translate('Yes') : $this->translate('No') ?>
translate('Created') ?>formatDateTime($this->comment->timestamp) ?>
translate('Expires') ?> + comment->expiration ? sprintf( + $this->translate('This comment expires on %s at %s.'), + $this->formatDate($this->comment->expiration), + $this->formatTime($this->comment->expiration) + ) : $this->translate('This comment does not expire.'); + ?> +
translate('Comment') ?>nl2br($this->createTicketLinks($this->markdown($comment->comment))) ?>
translate('Commands') ?> + +
+ +
+ diff --git a/modules/monitoring/application/views/scripts/comments/delete-all.phtml b/modules/monitoring/application/views/scripts/comments/delete-all.phtml new file mode 100644 index 0000000..698c4ee --- /dev/null +++ b/modules/monitoring/application/views/scripts/comments/delete-all.phtml @@ -0,0 +1,12 @@ +
+ + compact): ?> + tabs; ?> + + + render('partials/comment/comments-header.phtml'); ?> +
+ +
+ +
diff --git a/modules/monitoring/application/views/scripts/comments/show.phtml b/modules/monitoring/application/views/scripts/comments/show.phtml new file mode 100644 index 0000000..67e1c6b --- /dev/null +++ b/modules/monitoring/application/views/scripts/comments/show.phtml @@ -0,0 +1,19 @@ +
+compact): ?> + tabs ?> + + render('partials/comment/comments-header.phtml') ?> +
+ +
+

translate('Commands') ?>

+ qlink( + sprintf($this->translate('Remove %d comments'), $comments->count()), + $removeAllLink, + null, + array( + 'icon' => 'trash', + 'title' => $this->translate('Remove all selected comments') + ) + ) ?> +
diff --git a/modules/monitoring/application/views/scripts/config/form.phtml b/modules/monitoring/application/views/scripts/config/form.phtml new file mode 100644 index 0000000..cbf0659 --- /dev/null +++ b/modules/monitoring/application/views/scripts/config/form.phtml @@ -0,0 +1,6 @@ +
+ showOnlyCloseButton(); ?> +
+
+ +
\ No newline at end of file diff --git a/modules/monitoring/application/views/scripts/config/index.phtml b/modules/monitoring/application/views/scripts/config/index.phtml new file mode 100644 index 0000000..a1264c2 --- /dev/null +++ b/modules/monitoring/application/views/scripts/config/index.phtml @@ -0,0 +1,78 @@ +
+ +
+ +
+
+

translate('Monitoring Backends') ?>

+ qlink( + $this->translate('Create a New Monitoring Backend') , + 'monitoring/config/createbackend', + null, + array( + 'class' => 'button-link', + 'icon' => 'plus', + 'title' => $this->translate('Create a new monitoring backend') + ) + ) ?> + + + + + + + + + backendsConfig as $backendName => $config): ?> + + + + + + +
translate('Monitoring Backend') ?>
+ qlink( + $backendName, + 'monitoring/config/editbackend', + array('backend-name' => $backendName), + array( + 'icon' => 'edit', + 'title' => sprintf($this->translate('Edit monitoring backend %s'), $backendName) + ) + ) ?> + (translate('Type: %s'), + $this->escape($config->type === 'ido' ? 'IDO' : ucfirst($config->type)) + ) ?>) + + + qlink( + '', + 'monitoring/config/removebackend', + array('backend-name' => $backendName), + array( + 'class' => 'action-link', + 'icon' => 'cancel', + 'title' => sprintf($this->translate('Remove monitoring backend %s'), $backendName) + ) + ) ?> +
+
+
+

translate('Command Transports') ?>

+ qlink( + $this->translate('Create a New Command Transport') , + 'monitoring/config/createtransport', + null, + array( + 'class' => 'button-link', + 'icon' => 'plus', + 'title' => $this->translate('Create a new command transport') + ) + ) ?> + +
+
diff --git a/modules/monitoring/application/views/scripts/config/security.phtml b/modules/monitoring/application/views/scripts/config/security.phtml new file mode 100644 index 0000000..3801678 --- /dev/null +++ b/modules/monitoring/application/views/scripts/config/security.phtml @@ -0,0 +1,6 @@ +
+ +
+
+ +
\ No newline at end of file diff --git a/modules/monitoring/application/views/scripts/downtime/remove.phtml b/modules/monitoring/application/views/scripts/downtime/remove.phtml new file mode 100644 index 0000000..34a7dbd --- /dev/null +++ b/modules/monitoring/application/views/scripts/downtime/remove.phtml @@ -0,0 +1,13 @@ +
+ + compact): ?> + tabs; ?> + + + + render('partials/downtime/downtime-header.phtml') ?> +
+
+
+ +
\ No newline at end of file diff --git a/modules/monitoring/application/views/scripts/downtime/show.phtml b/modules/monitoring/application/views/scripts/downtime/show.phtml new file mode 100644 index 0000000..4db03cb --- /dev/null +++ b/modules/monitoring/application/views/scripts/downtime/show.phtml @@ -0,0 +1,173 @@ +
+ compact): ?> + tabs; ?> + + + + render('partials/downtime/downtime-header.phtml'); ?> +
+
+

translate('Details') ?>

+ + + + + + + + + + + + + + + + + + + +
+ isService ? $this->translate('Service') : $this->translate('Host') ?> + + isService): ?> + link()->service( + $downtime->service_description, + $downtime->service_display_name, + $downtime->host_name, + $downtime->host_display_name + ); + $icon = $this->icon('service', $this->translate('Service')); + ?> + + icon('host', $this->translate('Host')); + $link = $this->link()->host($downtime->host_name, $downtime->host_display_name) + ?> + + + +
translate('Author') ?>icon('user', $this->translate('User')) ?> escape($this->downtime->author_name) ?>
translate('Entry Time') ?>formatDateTime($this->downtime->entry_time) ?>
translate('Comment') ?>nl2br($this->createTicketLinks($this->markdown($downtime->comment))) ?>
+ +

translate('Duration') ?>

+ + + + + + + + + + + + + + + + downtime->is_flexible): ?> + + + + + + + + + + + + + + + + + + + + + + + + + + +
escape( + $this->downtime->is_flexible ? + $this->translate('Flexible') : $this->translate('Fixed') + ); ?> + icon('info-circled', $this->downtime->is_flexible ? + $this->translate('Flexible downtimes have a hard start and end time,' + . ' but also an additional restriction on the duration in which ' + . ' the host or service may actually be down.') : + $this->translate('Fixed downtimes have a static start and end time.')) ?> + + is_flexible): ?> + is_in_effect): ?> + translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.') + : $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'), + $this->formatDate($downtime->start), + $this->formatTime($downtime->start), + $this->formatDuration($downtime->duration), + $this->formatDate($downtime->end), + $this->formatTime($downtime->end) + ) ?> + + translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.') + : $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'), + $this->formatDateTime($downtime->scheduled_start), + $this->formatDateTime($downtime->scheduled_end), + $this->formatDuration($downtime->duration) + ) ?> + + + is_in_effect): ?> + translate('This fixed service downtime was started on %s at %s and expires on %s at %s.') + : $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'), + $this->formatDate($downtime->start), + $this->formatTime($downtime->start), + $this->formatDate($downtime->end), + $this->formatTime($downtime->end) + ) ?> + + translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.') + : $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'), + $this->formatDate($downtime->start), + $this->formatTime($downtime->start), + $this->formatDate($downtime->end), + $this->formatTime($downtime->end) + ) ?> + + +
translate('Scheduled start') ?>formatDateTime($this->downtime->scheduled_start) ?>
translate('Scheduled end') ?>formatDateTime($this->downtime->scheduled_end) ?>
translate('Duration') ?>formatDuration($this->downtime->duration) ?>
translate('Actual start time') ?>formatDateTime($downtime->start) ?>
translate('Actual end time') ?>formatDateTime($downtime->end) ?>
translate('In effect') ?> + escape( + $this->downtime->is_in_effect ? + $this->translate('Yes') : $this->translate('No') + ); + ?> +
translate('Commands') ?> + +
+ +
+ diff --git a/modules/monitoring/application/views/scripts/downtimes/delete-all.phtml b/modules/monitoring/application/views/scripts/downtimes/delete-all.phtml new file mode 100644 index 0000000..e6435fe --- /dev/null +++ b/modules/monitoring/application/views/scripts/downtimes/delete-all.phtml @@ -0,0 +1,12 @@ +
+ + compact): ?> + tabs; ?> + + + render('partials/downtime/downtimes-header.phtml'); ?> +
+ +
+ +
\ No newline at end of file diff --git a/modules/monitoring/application/views/scripts/downtimes/show.phtml b/modules/monitoring/application/views/scripts/downtimes/show.phtml new file mode 100644 index 0000000..73d9bf6 --- /dev/null +++ b/modules/monitoring/application/views/scripts/downtimes/show.phtml @@ -0,0 +1,19 @@ +
+compact): ?> + tabs ?> + + render('partials/downtime/downtimes-header.phtml') ?> +
+ +
+

translate('Commands') ?>

+ qlink( + sprintf($this->translate('Remove all %d scheduled downtimes'), $downtimes->count()), + $removeAllLink, + null, + array( + 'icon' => 'trash', + 'title' => $this->translate('Remove all selected downtimes') + ) + ) ?> +
diff --git a/modules/monitoring/application/views/scripts/event/show.phtml b/modules/monitoring/application/views/scripts/event/show.phtml new file mode 100644 index 0000000..c844a6f --- /dev/null +++ b/modules/monitoring/application/views/scripts/event/show.phtml @@ -0,0 +1,34 @@ + +
+compact) { + echo $this->tabs; +} + +echo $object instanceof Service + ? '

' . $this->translate('Current Service State') . '

' . $this->render('partials/object/service-header.phtml') + : '

' . $this->translate('Current Host State') . '

' . $this->render('partials/object/host-header.phtml'); +?> +
+
+ + +

escape($this->translate('Event Details')) ?>

+ + '; + } + ?> +
' . $this->escape($detail[0]) . '' . $detail[1] . '
+
diff --git a/modules/monitoring/application/views/scripts/form/reorder-command-transports.phtml b/modules/monitoring/application/views/scripts/form/reorder-command-transports.phtml new file mode 100644 index 0000000..2f81610 --- /dev/null +++ b/modules/monitoring/application/views/scripts/form/reorder-command-transports.phtml @@ -0,0 +1,93 @@ + +
+ + + + + + + + + + getConfig(); + $total = $transportConfig->count(); + foreach ($transportConfig as $transportName => $config): + ++$i; + ?> + + + + + + + +
translate('Transport') ?>
+ qlink( + $transportName, + 'monitoring/config/edittransport', + array('transport' => $transportName), + array( + 'icon' => 'edit', + 'title' => sprintf($this->translate('Edit command transport %s'), $transportName) + ) + ); ?> + (translate('Type: %s'), + ucfirst($config->get('transport', 'local')) + ) ?>) + + + qlink( + '', + 'monitoring/config/removetransport', + array('transport' => $transportName), + array( + 'class' => 'action-link', + 'icon' => 'cancel', + 'title' => sprintf($this->translate('Remove command transport %s'), $transportName) + ) + ); ?> + + 0): ?> + + + + + +
+ getElement($form->getTokenElementName()) ?> + getElement($form->getUidElementName()) ?> +
diff --git a/modules/monitoring/application/views/scripts/health/disable-notifications.phtml b/modules/monitoring/application/views/scripts/health/disable-notifications.phtml new file mode 100644 index 0000000..e8c75e5 --- /dev/null +++ b/modules/monitoring/application/views/scripts/health/disable-notifications.phtml @@ -0,0 +1,20 @@ +compact): ?> +
+ tabs->showOnlyCloseButton(); ?> +
+ +
+

+ notifications_enabled === false): ?> +
+ translate('Host and service notifications are already disabled.') ?> + programStatus->disable_notif_expire_time): ?> + translate('Notifications will be re-enabled in %s.'), + $this->timeUntil($this->programStatus->disable_notif_expire_time)); ?> + +
+ + + +
diff --git a/modules/monitoring/application/views/scripts/health/info.phtml b/modules/monitoring/application/views/scripts/health/info.phtml new file mode 100644 index 0000000..76d9ee3 --- /dev/null +++ b/modules/monitoring/application/views/scripts/health/info.phtml @@ -0,0 +1,87 @@ +runtimeVariables()->create($this->runtimevariables); +$cp = $this->checkPerformance()->create($this->checkperformance); + +if (! $this->compact): ?> +
+ tabs; ?> +
+ + +
+
+
+

translate('Process Info') ?>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
translate('Program Version') ?>programStatus->program_version + ? $this->programStatus->program_version + : $this->translate('N/A') ?>
translate('Program Start Time') ?>formatDateTime($this->programStatus->program_start_time) ?>
translate('Last Status Update'); ?>timeAgo($this->programStatus->status_update_time); ?>
translate('Last External Command Check'); ?>timeAgo($this->programStatus->last_command_check); ?>
translate('Last Log File Rotation'); ?>programStatus->last_log_rotation + ? $this->timeSince($this->programStatus->last_log_rotation) + : $this->translate('N/A') ?>
translate('Global Service Event Handler'); ?>programStatus->global_service_event_handler + ? $this->programStatus->global_service_event_handler + : $this->translate('N/A'); ?>
translate('Global Host Event Handler'); ?>programStatus->global_host_event_handler + ? $this->programStatus->global_host_event_handler + : $this->translate('N/A'); ?>
translate('Active Endpoint'); ?>programStatus->endpoint_name + ? $this->programStatus->endpoint_name + : $this->translate('N/A') ?>
translate('Active Icinga Web 2 Endpoint'); ?>translate('N/A') ?>
+ programStatus->is_currently_running === true): ?> +
+ translate( + '%1$s has been up and running with PID %2$d %3$s', + 'Last format parameter represents the time running' + ), + $this->backendName, + $this->programStatus->process_id, + $this->timeSince($this->programStatus->program_start_time)) ?> +
+ +
+ translate('Backend %s is not running'), $this->backendName) ?> +
+ +
+
+

translate('Feature Commands') ?>

+ toggleFeaturesForm ?> +
+
+
diff --git a/modules/monitoring/application/views/scripts/health/not-running.phtml b/modules/monitoring/application/views/scripts/health/not-running.phtml new file mode 100644 index 0000000..8439fc4 --- /dev/null +++ b/modules/monitoring/application/views/scripts/health/not-running.phtml @@ -0,0 +1,8 @@ +compact): ?> +
+ tabs; ?> +
+ +
+ translate('%s is currently not up and running'), $this->backendName) ?> +
diff --git a/modules/monitoring/application/views/scripts/health/stats.phtml b/modules/monitoring/application/views/scripts/health/stats.phtml new file mode 100644 index 0000000..5cfb8f9 --- /dev/null +++ b/modules/monitoring/application/views/scripts/health/stats.phtml @@ -0,0 +1,150 @@ +runtimeVariables()->create($this->runtimevariables); +$cp = $this->checkPerformance()->create($this->checkperformance); + +if (! $this->compact): ?> +
+ tabs ?> +
+ + +
+
+
+

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

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

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

+ + + + + + + + + + + + + + + + + +
translate('Runtime Variables') ?>translate('Host Checks') ?>
translate('Total') ?>total_scheduled_hosts ?>
translate('Scheduled') ?>total_scheduled_hosts ?>
+ +

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

+ + + + + + + + + + + + + + + + + + + + +
translate('Runtime Variables') ?>translate('Service Checks') ?>translate('Per Host') ?>
translate('Total') ?>total_services ?>average_services_per_host) ?>
translate('Scheduled') ?>total_scheduled_services ?>average_scheduled_services_per_host) ?>
+ +

translate('Active checks') ?>

+ + + + + + + + + + + + + + + + + + + + + + + +
translate('Check Performance') ?>translate('Checks') ?>translate('Latency') ?>translate('Execution time') ?>
translate('Host Checks') ?>host_active_count; ?>host_active_latency_avg) ?>shost_active_execution_avg) ?>s
translate('Service Checks') ?>service_active_count; ?>service_active_latency_avg) ?>sservice_active_execution_avg) ?>s
+ +

translate('Passive checks') ?>

+ + + + + + + + + + + + + + + + + +
translate('Check Performance') ?>translate('Passive Checks') ?>
translate('Host Checks') ?>host_passive_count ?>
translate('Service Checks') ?>service_passive_count ?>
+
+
+
diff --git a/modules/monitoring/application/views/scripts/host/services.phtml b/modules/monitoring/application/views/scripts/host/services.phtml new file mode 100644 index 0000000..ac1dc5b --- /dev/null +++ b/modules/monitoring/application/views/scripts/host/services.phtml @@ -0,0 +1,23 @@ + + +
+ compact): ?> + tabs; ?> + + render('partials/object/host-header.phtml') ?> + baseFilter = Filter::where('host', $object->host_name); + $this->stats = $object->stats; + echo $this->render('list/components/servicesummary.phtml'); + ?> +
+partial( + 'list/services.phtml', + 'monitoring', + array( + 'compact' => true, + 'showHost' => false, + 'services' => $services, + 'addColumns' => array() + ) +); ?> diff --git a/modules/monitoring/application/views/scripts/host/show.phtml b/modules/monitoring/application/views/scripts/host/show.phtml new file mode 100644 index 0000000..72f5af4 --- /dev/null +++ b/modules/monitoring/application/views/scripts/host/show.phtml @@ -0,0 +1,14 @@ + +
+compact): ?> + tabs ?> + + render('partials/object/host-header.phtml') ?> +stats = $object->stats; + $this->baseFilter = Filter::where('host', $object->host_name); + echo $this->render('list/components/servicesummary.phtml'); +?> + render('partials/object/quick-actions.phtml') ?> +
+render('partials/object/detail-content.phtml') ?> diff --git a/modules/monitoring/application/views/scripts/hosts/show.phtml b/modules/monitoring/application/views/scripts/hosts/show.phtml new file mode 100644 index 0000000..97b8434 --- /dev/null +++ b/modules/monitoring/application/views/scripts/hosts/show.phtml @@ -0,0 +1,206 @@ +
+ compact): ?> + + + render('list/components/hostssummary.phtml') ?> + render('partials/host/objects-header.phtml'); ?> + getScheduledDowntimes()); + ?> +
+ +
+ + translate('No hosts found matching the filter'); ?> + + render('show/components/extensions.phtml') ?> +

translate('Problem Handling') ?>

+ + + 0): ?> + + + + + + + 0): ?> + + + + + + + + + + + + getComments())) > 0): ?> + + + + + + + + + + + + 0): ?> + + + + + + +
translate('%d unhandled problems'), $unackCount) ?> + qlink( + $this->translate('Acknowledge'), + $acknowledgeLink, + null, + array( + 'class' => 'action-link', + 'icon' => 'check' + ) + ) ?> +
translatePlural( + '%s acknowledgement', + '%s acknowledgements', + $acknowledgedCount + ), + '' . $acknowledgedCount . '' + ); ?> + setLabelEnabled(true) ?> +
translate('Comments') ?> + qlink( + $this->translate('Add comments'), + $addCommentLink, + null, + array( + 'class' => 'action-link', + 'icon' => 'comment-empty' + ) + ) ?> +
+ qlink( + sprintf( + $this->translatePlural( + '%s comment', + '%s comments', + $commentCount + ), + $commentCount + ), + $commentsLink, + null, + array('data-base-target' => '_next') + ); ?> +
+ translate('Downtimes') ?> + + qlink( + $this->translate('Schedule downtimes'), + $downtimeAllLink, + null, + array( + 'icon' => 'plug', + 'class' => 'action-link' + ) + ) ?> +
+ qlink( + sprintf( + $this->translatePlural( + '%d scheduled downtime', + '%d scheduled downtimes', + $scheduledDowntimeCount + ), + $scheduledDowntimeCount + ), + $showDowntimesLink, + null, + array( + 'data-base-target' => '_next' + ) + ) ?> +
+ + hasPermission('monitoring/command/send-custom-notification')): ?> +

translate('Notifications') ?>

+ + + + + + + +
translate('Notifications') ?> + qlink( + $this->translate('Send notifications'), + $sendCustomNotificationLink, + null, + array( + 'class' => 'action-link', + 'icon' => 'bell' + ) + ) ?> +
+ + +

translate('Check Execution') ?>

+ + + + + + + + + + + + + + + + + + + + + + +
translate('Command') ?> + qlink( + $this->translate('Process check result'), + $processCheckResultAllLink, + null, + array( + 'class' => 'action-link', + 'icon' => 'edit' + ) + ) ?> +
translate('Schedule Check') ?>
+ qlink( + $this->translate('Reschedule'), + $rescheduleAllLink, + null, + array( + 'class' => 'action-link', + 'icon' => 'calendar-empty' + ) + ) ?> +
+

translate('Feature Commands') ?>

+ + +
diff --git a/modules/monitoring/application/views/scripts/list/comments.phtml b/modules/monitoring/application/views/scripts/list/comments.phtml new file mode 100644 index 0000000..c7fb86a --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/comments.phtml @@ -0,0 +1,61 @@ +compact): ?> +
+ tabs ?> + render('list/components/selectioninfo.phtml') ?> + paginator ?> +
+ limiter ?> + sortBox ?> +
+ filterEditor ?> +
+ +
+hasResult()): ?> +

translate('No comments found matching the filter') ?>

+
+ + " + data-icinga-multiselect-data="comment_id"> + + + + + + + + peekAhead($this->compact) as $comment): ?> + + + + + + +
translate('Type') ?>translate('Comment') ?>
+ partial('partials/comment/comment-description.phtml', array('comment' => $comment)) ?> + + partial( + 'partials/comment/comment-detail.phtml', + array( + 'comment' => $comment, + 'delCommentForm' => isset($delCommentForm) ? $delCommentForm : null + // Form is unset if the current user lacks the respective permission + )) ?> +
+hasMore()): ?> + + + diff --git a/modules/monitoring/application/views/scripts/list/components/hostssummary.phtml b/modules/monitoring/application/views/scripts/list/components/hostssummary.phtml new file mode 100644 index 0000000..4b9f1cd --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/components/hostssummary.phtml @@ -0,0 +1,92 @@ +fetchRow(); +} +?> +
+ qlink( + sprintf($this->translatePlural('%u Host', '%u Hosts', $stats->hosts_total), $stats->hosts_total), + // @TODO(el): Fix that + Url::fromPath('monitoring/list/hosts')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()), + null, + array('title' => sprintf( + $this->translatePlural('List %u host', 'List all %u hosts', $stats->hosts_total), + $stats->hosts_total + )) + ) ?>: +setBaseFilter(isset($baseFilter) ? $baseFilter : null) + ->setUrl('monitoring/list/hosts') + ->add( + StateBadges::STATE_UP, + $stats->hosts_up, + array( + 'host_state' => 0 + ), + 'List %u host that is currently in state UP', + 'List %u hosts which are currently in state UP', + array($stats->hosts_up) + ) + ->add( + StateBadges::STATE_DOWN, + $stats->hosts_down_unhandled, + array( + 'host_state' => 1, + 'host_handled' => 0 + ), + 'List %u host that is currently in state DOWN', + 'List %u hosts which are currently in state DOWN', + array($stats->hosts_down_unhandled) + ) + ->add( + StateBadges::STATE_DOWN_HANDLED, + $stats->hosts_down_handled, + array( + 'host_state' => 1, + 'host_handled' => 1 + ), + 'List %u host that is currently in state DOWN (Acknowledged)', + 'List %u hosts which are currently in state DOWN (Acknowledged)', + array($stats->hosts_down_handled) + ) + ->add( + StateBadges::STATE_UNREACHABLE, + $stats->hosts_unreachable_unhandled, + array( + 'host_state' => 2, + 'host_handled' => 0 + ), + 'List %u host that is currently in state UNREACHABLE', + 'List %u hosts which are currently in state UNREACHABLE', + array($stats->hosts_unreachable_unhandled) + ) + ->add( + StateBadges::STATE_UNREACHABLE_HANDLED, + $stats->hosts_unreachable_handled, + array( + 'host_state' => 2, + 'host_handled' => 1 + ), + 'List %u host that is currently in state UNREACHABLE (Acknowledged)', + 'List %u hosts which are currently in state UNREACHABLE (Acknowledged)', + array($stats->hosts_unreachable_handled) + ) + ->add( + StateBadges::STATE_PENDING, + $stats->hosts_pending, + array( + 'host_state' => 99 + ), + 'List %u host that is currently in state PENDING', + 'List %u hosts which are currently in state PENDING', + array($stats->hosts_pending) + ); +echo $stateBadges->render(); +?> +
diff --git a/modules/monitoring/application/views/scripts/list/components/selectioninfo.phtml b/modules/monitoring/application/views/scripts/list/components/selectioninfo.phtml new file mode 100644 index 0000000..ec0fb85 --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/components/selectioninfo.phtml @@ -0,0 +1,15 @@ +translate( + 'Press and hold the Ctrl key while clicking on rows to select multiple rows or press and hold the Shift key to' + .' select a range of rows', + 'Multi-selection help' +); +?> +
+ translate('%s row(s) selected', 'Multi-selection count'), + '0' + ) ?> +
diff --git a/modules/monitoring/application/views/scripts/list/components/servicesummary.phtml b/modules/monitoring/application/views/scripts/list/components/servicesummary.phtml new file mode 100644 index 0000000..73a3b57 --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/components/servicesummary.phtml @@ -0,0 +1,118 @@ +fetchRow(); +} +?> +
+ qlink( + sprintf($this->translatePlural( + '%u Service', '%u Services', $stats->services_total), + $stats->services_total + ), + // @TODO(el): Fix that + Url::fromPath('monitoring/list/services')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()), + null, + array('title' => sprintf( + $this->translatePlural('List %u service', 'List all %u services', $stats->services_total), + $stats->services_total + )) + ) ?>: +setBaseFilter(isset($baseFilter) ? $baseFilter : null) + ->setUrl('monitoring/list/services') + ->add( + StateBadges::STATE_OK, + $stats->services_ok, + array( + 'service_state' => 0 + ), + 'List %u service that is currently in state OK', + 'List %u services which are currently in state OK', + array($stats->services_ok) + ) + ->add( + StateBadges::STATE_CRITICAL, + $stats->services_critical_unhandled, + array( + 'service_state' => 2, + 'service_handled' => 0 + ), + 'List %u service that is currently in state CRITICAL', + 'List %u services which are currently in state CRITICAL', + array($stats->services_critical_unhandled) + ) + ->add( + StateBadges::STATE_CRITICAL_HANDLED, + $stats->services_critical_handled, + array( + 'service_state' => 2, + 'service_handled' => 1 + ), + 'List %u handled service that is currently in state CRITICAL', + 'List %u handled services which are currently in state CRITICAL', + array($stats->services_critical_handled) + ) + ->add( + StateBadges::STATE_UNKNOWN, + $stats->services_unknown_unhandled, + array( + 'service_state' => 3, + 'service_handled' => 0 + ), + 'List %u service that is currently in state UNKNOWN', + 'List %u services which are currently in state UNKNOWN', + array($stats->services_unknown_unhandled) + ) + ->add( + StateBadges::STATE_UNKNOWN_HANDLED, + $stats->services_unknown_handled, + array( + 'service_state' => 3, + 'service_handled' => 1 + ), + 'List %u handled service that is currently in state UNKNOWN', + 'List %u handled services which are currently in state UNKNOWN', + array($stats->services_unknown_handled) + + ) + ->add( + StateBadges::STATE_WARNING, + $stats->services_warning_unhandled, + array( + 'service_state' => 1, + 'service_handled' => 0 + ), + 'List %u service that is currently in state WARNING', + 'List %u services which are currently in state WARNING', + array($stats->services_warning_unhandled) + ) + ->add( + StateBadges::STATE_WARNING_HANDLED, + $stats->services_warning_handled, + array( + 'service_state' => 1, + 'service_handled' => 1 + ), + 'List %u handled service that is currently in state WARNING', + 'List %u handled services which are currently in state WARNING', + array($stats->services_warning_handled) + ) + ->add( + StateBadges::STATE_PENDING, + $stats->services_pending, + array( + 'service_state' => 99 + ), + 'List %u handled service that is currently in state PENDING', + 'List %u handled services which are currently in state PENDING', + array($stats->services_pending) + ); +echo $stateBadges->render(); +?> +
diff --git a/modules/monitoring/application/views/scripts/list/contactgroups.phtml b/modules/monitoring/application/views/scripts/list/contactgroups.phtml new file mode 100644 index 0000000..125aeea --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/contactgroups.phtml @@ -0,0 +1,53 @@ +compact): ?> +
+ tabs ?> + paginator ?> +
+ limiter ?> + sortBox ?> +
+ filterEditor ?> +
+ +
+hasResult()): ?> +

translate('No contact groups found matching the filter') ?>

+
+ + + + + + + + + + + + + + + + + + +
translate('Contact Group') ?>translate('Alias') ?>
+ contact_count ?> + + qlink( + $contactGroup->contactgroup_name, + 'monitoring/list/contacts', + array('contactgroup_name' => $contactGroup->contactgroup_name), + array('title' => sprintf( + $this->translate('Show detailed information about %s'), + $contactGroup->contactgroup_name + )) + ) ?> + + contactgroup_name !== $contactGroup->contactgroup_alias): ?> + contactgroup_alias ?> + +
+ diff --git a/modules/monitoring/application/views/scripts/list/contacts.phtml b/modules/monitoring/application/views/scripts/list/contacts.phtml new file mode 100644 index 0000000..42ec778 --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/contacts.phtml @@ -0,0 +1,83 @@ +compact): ?> +
+ tabs ?> + paginator ?> +
+ limiter ?> + sortBox ?> +
+ filterEditor ?> +
+ +
+hasResult()): ?> +

translate('No contacts found matching the filter') ?>

+
+ + + + + + + + + + + peekAhead($this->compact) as $contact): ?> + + + + + + contact_notify_service_timeperiod): ?> + + + + contact_notify_host_timeperiod): ?> + + + + + +
translate('Name') ?>translate('Email') ?>translate('Pager') ?>
+ qlink( + $contact->contact_name, + 'monitoring/show/contact', + array('contact_name' => $contact->contact_name), + array( + 'title' => sprintf( + $this->translate('Show detailed information about %s'), + $contact->contact_alias + ) + ) + ) ?> + + translate('Email') ?>: + + escape($contact->contact_email) ?> + + + contact_pager): ?> + escape($contact->contact_pager) ?> + + + escape($contact->contact_notify_service_timeperiod) ?> + + escape($contact->contact_notify_host_timeperiod) ?> +
+hasMore()): ?> + + + diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml new file mode 100644 index 0000000..46ce0bb --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -0,0 +1,64 @@ +compact): ?> +
+ tabs ?> + render('list/components/selectioninfo.phtml') ?> + paginator ?> +
+ limiter ?> + sortBox ?> +
+ filterEditor ?> +
+ +
+hasResult()): ?> +

translate('No downtimes found matching the filter.') ?>

+
+ + " + data-icinga-multiselect-data="downtime_id"> + + + + + + + + peekAhead($this->compact) as $downtime): + if (isset($downtime->service_description)) { + $this->isService = true; + $this->stateName = Service::getStateText($downtime->service_state); + } else { + $this->isService = false; + $this->stateName = Host::getStateText($downtime->host_state); + } + // Set downtime for partials + $this->downtime = $downtime; + ?> + + render('partials/downtime/downtime-header.phtml') ?> + + + +
translate('State') ?>translate('Downtime') ?>
+hasMore()): ?> + + + diff --git a/modules/monitoring/application/views/scripts/list/eventgrid.phtml b/modules/monitoring/application/views/scripts/list/eventgrid.phtml new file mode 100644 index 0000000..ca19123 --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/eventgrid.phtml @@ -0,0 +1,123 @@ +compact): ?> +
+ tabs ?> + form ?> +
+ +
+ array( + 'tooltip' => $this->translate('%d hosts ok on %s'), + 'color' => '#49DF96', + 'opacity' => '0.55' + ), + 'cnt_unreachable_hard' => array( + 'tooltip' => $this->translate('%d hosts unreachable on %s'), + 'color' => '#77AAFF', + 'opacity' => '0.55' + ), + 'cnt_critical_hard' => array( + 'tooltip' => $this->translate('%d services critical on %s'), + 'color' => '#ff5566', + 'opacity' => '0.9' + ), + + 'cnt_warning_hard' => array( + 'tooltip' => $this->translate('%d services warning on %s'), + 'color' => '#ffaa44', + 'opacity' => '1.0' + ), + + 'cnt_down_hard' => array( + 'tooltip' => $this->translate('%d hosts down on %s'), + 'color' => '#ff5566', + 'opacity' => '0.9' + ), + 'cnt_unknown_hard' => array( + 'tooltip' => $this->translate('%d services unknown on %s'), + 'color' => '#cc77ff', + 'opacity' => '0.7' + ), + 'cnt_ok' => array( + 'tooltip' => $this->translate('%d services ok on %s'), + 'color' => '#49DF96', + 'opacity' => '0.55' + ) +); + +$data = array(); +foreach ($summary as $entry) { + $day = $entry->day; + $value = $entry->$column; + $caption = sprintf( + $settings[$column]['tooltip'], + $value, + $this->formatDate(strtotime($day ?? '')) + ); + $linkFilter = Filter::matchAll( + Filter::expression('timestamp', '<', strtotime($day . ' 23:59:59')), + Filter::expression('timestamp', '>', strtotime($day . ' 00:00:00')), + $form->getFilter(), + $filter + ); + $data[$day] = array( + 'value' => $value, + 'caption' => $caption, + 'url' => $this->href('monitoring/list/eventhistory?' . $linkFilter->toQueryString()) + ); +} + +if (! $summary->hasResult()) { + echo $this->translate('No state changes in the selected time period.') . '
'; + return; +} + +$from = intval($form->getValue('from', strtotime('3 months ago'))); +$to = intval($form->getValue('to', time())); + +// don't display more than ten years, or else this will get really slow +if ($to - $from > 315360000) { + $from = $to - 315360000; +} + +$f = new DateTime(); +$f->setTimestamp($from); +$t = new DateTime(); +$t->setTimestamp($to); +$diff = $t->diff($f); +$step = 124; + +for ($i = 0; $i < $diff->days; $i += $step) { + $end = clone $f; + if ($diff->days - $i > $step) { + // full range, move last day to next chunk + $end->add(new DateInterval('P' . ($step - 1) . 'D')); + } else { + // include last day + $end->add(new DateInterval('P' . ($diff->days - $i) . 'D')); + } + $grid = new HistoryColorGrid(null, $f->getTimestamp(), $end->getTimestamp()); + $grid->setColor($settings[$column]['color']); + $grid->opacity = $settings[$column]['opacity']; + $grid->orientation = $orientation; + $grid->setData($data); + $grids[] = $grid; + + $f->add(new DateInterval('P' . $step . 'D')); +} +?> +
+ $grid): ?> +
+ + orientation === 'horizontal' ? '
' : '' ?> +
+ +
+ diff --git a/modules/monitoring/application/views/scripts/list/eventhistory.phtml b/modules/monitoring/application/views/scripts/list/eventhistory.phtml new file mode 100644 index 0000000..0573e8a --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/eventhistory.phtml @@ -0,0 +1,22 @@ +compact): ?> +
+ tabs ?> +
+ limiter ?> + sortBox ?> +
+ filterEditor ?> +
+ +partial( + 'partials/event-history.phtml', + array( + 'compact' => $this->compact, + 'history' => $history, + 'isOverview' => true, + 'translationDomain' => $this->translationDomain + ) +) ?> + diff --git a/modules/monitoring/application/views/scripts/list/hostgroup-grid.phtml b/modules/monitoring/application/views/scripts/list/hostgroup-grid.phtml new file mode 100644 index 0000000..34498d0 --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/hostgroup-grid.phtml @@ -0,0 +1,173 @@ +compact): ?> + + +
+hasResult()): ?> +

translate('No host groups found matching the filter.') ?>

+
+ +
+ +
+ hosts_down_unhandled > 0): ?> + qlink( + $hostGroup->hosts_down_unhandled, + $this->url('monitoring/list/hosts')->addFilter($this->filterEditor->getFilter()), + [ + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'host_handled' => 0, + 'host_state' => 1 + ], + [ + 'class' => 'state-down', + 'title' => sprintf( + $this->translatePlural( + 'List %u host that is currently in state DOWN in the host group "%s"', + 'List %u hosts which are currently in state DOWN in the host group "%s"', + $hostGroup->hosts_down_unhandled + ), + $hostGroup->hosts_down_unhandled, + $hostGroup->hostgroup_alias + ) + ] + ) ?> + hosts_unreachable_unhandled > 0): ?> + qlink( + $hostGroup->hosts_unreachable_unhandled, + $this->url('monitoring/list/hosts')->addFilter($this->filterEditor->getFilter()), + [ + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'host_handled' => 0, + 'host_state' => 2 + ], + [ + 'class' => 'state-unreachable', + 'title' => sprintf( + $this->translatePlural( + 'List %u host that is currently in state UNREACHABLE in the host group "%s"', + 'List %u hosts which are currently in state UNREACHABLE in the host group "%s"', + $hostGroup->hosts_unreachable_unhandled + ), + $hostGroup->hosts_unreachable_unhandled, + $hostGroup->hostgroup_alias + ) + ] + ) ?> + hosts_down_handled > 0): ?> + qlink( + $hostGroup->hosts_down_handled, + $this->url('monitoring/list/hosts')->addFilter($this->filterEditor->getFilter()), + [ + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'host_handled' => 1, + 'host_state' => 1 + ], + [ + 'class' => 'state-down handled', + 'title' => sprintf( + $this->translatePlural( + 'List %u host that is currently in state DOWN (Acknowledged) in the host group "%s"', + 'List %u hosts which are currently in state DOWN (Acknowledged) in the host group "%s"', + $hostGroup->hosts_down_handled + ), + $hostGroup->hosts_down_handled, + $hostGroup->hostgroup_alias + ) + ] + ) ?> + hosts_unreachable_handled > 0): ?> + qlink( + $hostGroup->hosts_unreachable_handled, + $this->url('monitoring/list/hosts')->addFilter($this->filterEditor->getFilter()), + [ + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'host_handled' => 0, + 'host_state' => 2 + ], + [ + 'class' => 'state-unreachable handled', + 'title' => sprintf( + $this->translatePlural( + 'List %u host that is currently in state UNREACHABLE (Acknowledged) in the host group "%s"', + 'List %u hosts which are currently in state UNREACHABLE (Acknowledged) in the host group "%s"', + $hostGroup->hosts_unreachable_handled + ), + $hostGroup->hosts_unreachable_handled, + $hostGroup->hostgroup_alias + ) + ] + ) ?> + hosts_pending > 0): ?> + qlink( + $hostGroup->hosts_pending, + $this->url('monitoring/list/hosts')->addFilter($this->filterEditor->getFilter()), + [ + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'host_state' => 99 + ], + [ + 'class' => 'state-pending', + 'title' => sprintf( + $this->translatePlural( + 'List %u host that is currently in state PENDING in the host group "%s"', + 'List %u hosts which are currently in state PENDING in the host group "%s"', + $hostGroup->hosts_pending + ), + $hostGroup->hosts_pending, + $hostGroup->hostgroup_alias + ) + ] + ) ?> + hosts_up > 0): ?> + qlink( + $hostGroup->hosts_up, + $this->url('monitoring/list/hosts')->addFilter($this->filterEditor->getFilter()), + [ + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'host_state' => 0 + ], + [ + 'class' => 'state-up', + 'title' => sprintf( + $this->translatePlural( + 'List %u host that is currently in state UP in the host group "%s"', + 'List %u hosts which are currently in state UP in the host group "%s"', + $hostGroup->hosts_up + ), + $hostGroup->hosts_up, + $hostGroup->hostgroup_alias + ) + ] + ) ?> + +
+ 0 +
+ + qlink( + $hostGroup->hostgroup_alias, + $this->url('monitoring/list/hosts')->addFilter($this->filterEditor->getFilter()), + ['hostgroup_name' => $hostGroup->hostgroup_name], + [ + 'title' => sprintf( + $this->translate('List all hosts in the group "%s"'), + $hostGroup->hostgroup_alias + ) + ] + ) ?> +
+ +
+ diff --git a/modules/monitoring/application/views/scripts/list/hostgroups.phtml b/modules/monitoring/application/views/scripts/list/hostgroups.phtml new file mode 100644 index 0000000..a0592c8 --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/hostgroups.phtml @@ -0,0 +1,296 @@ +compact): ?> +
+ tabs ?> + paginator ?> + + filterEditor ?> +
+ + +
+hasResult()): ?> +

translate('No host groups found matching the filter.') ?>

+
+ + + + + + + + + + + + + peekAhead($this->compact) as $hostGroup): ?> + + + + + + + + + +
translate('Host Group') ?>translate('Host States') ?>translate('Service States') ?>
+ hosts_total ?> + + qlink( + $hostGroup->hostgroup_alias, + $this + ->url('monitoring/list/hosts') + ->setParams(['hostgroup_name' => $hostGroup->hostgroup_name]) + ->addFilter($this->filterEditor->getFilter()), + ['sort' => 'host_severity'], + ['title' => sprintf( + $this->translate('List all hosts in the group "%s"'), + $hostGroup->hostgroup_alias + )] + ) ?> + + setUrl('monitoring/list/hosts') + ->setBaseFilter($this->filterEditor->getFilter()) + ->add( + StateBadges::STATE_UP, + $hostGroup->hosts_up, + array( + 'host_state' => 0, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'host_severity' + ), + 'List %u host that is currently in state UP in the host group "%s"', + 'List %u hosts which are currently in state UP in the host group "%s"', + array($hostGroup->hosts_up, $hostGroup->hostgroup_alias) + ) + ->add( + StateBadges::STATE_DOWN, + $hostGroup->hosts_down_unhandled, + array( + 'host_state' => 1, + 'host_acknowledged' => 0, + 'host_in_downtime' => 0, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'host_severity' + ), + 'List %u host that is currently in state DOWN in the host group "%s"', + 'List %u hosts which are currently in state DOWN in the host group "%s"', + array($hostGroup->hosts_down_unhandled, $hostGroup->hostgroup_alias) + ) + ->add( + StateBadges::STATE_DOWN_HANDLED, + $hostGroup->hosts_down_handled, + array( + 'host_state' => 1, + 'host_handled' => 1, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'host_severity' + ), + 'List %u host that is currently in state DOWN (Acknowledged) in the host group "%s"', + 'List %u hosts which are currently in state DOWN (Acknowledged) in the host group "%s"', + array($hostGroup->hosts_down_handled, $hostGroup->hostgroup_alias) + ) + ->add( + StateBadges::STATE_UNREACHABLE, + $hostGroup->hosts_unreachable_unhandled, + array( + 'host_state' => 2, + 'host_acknowledged' => 0, + 'host_in_downtime' => 0, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'host_severity' + ), + 'List %u host that is currently in state UNREACHABLE in the host group "%s"', + 'List %u hosts which are currently in state UNREACHABLE in the host group "%s"', + array($hostGroup->hosts_unreachable_unhandled, $hostGroup->hostgroup_alias) + ) + ->add( + StateBadges::STATE_UNREACHABLE_HANDLED, + $hostGroup->hosts_unreachable_handled, + array( + 'host_state' => 2, + 'host_handled' => 1, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'host_severity' + ), + 'List %u host that is currently in state UNREACHABLE (Acknowledged) in the host group "%s"', + 'List %u hosts which are currently in state UNREACHABLE (Acknowledged) in the host group "%s"', + array($hostGroup->hosts_unreachable_handled, $hostGroup->hostgroup_alias) + ) + ->add( + StateBadges::STATE_PENDING, + $hostGroup->hosts_pending, + array( + 'host_state' => 99, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'host_severity' + ), + 'List %u host that is currently in state PENDING in the host group "%s"', + 'List %u hosts which are currently in state PENDING in the host group "%s"', + array($hostGroup->hosts_pending, $hostGroup->hostgroup_alias) + ); + echo $stateBadges->render(); + ?> + + qlink( + $hostGroup->services_total, + $this + ->url('monitoring/list/services') + ->setParams(['hostgroup_name' => $hostGroup->hostgroup_name]) + ->addFilter($this->filterEditor->getFilter()), + ['sort' => 'service_severity'], + [ + 'title' => sprintf( + $this->translate('List all services of all hosts in host group "%s"'), + $hostGroup->hostgroup_alias + ), + 'class' => 'badge' + ] + ) ?> + + setUrl('monitoring/list/services') + ->setBaseFilter($this->filterEditor->getFilter()) + ->add( + StateBadges::STATE_OK, + $hostGroup->services_ok, + array( + 'service_state' => 0, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'service_severity' + ), + 'List %u service that is currently in state OK on hosts in the host group "%s"', + 'List %u services which are currently in state OK on hosts in the host group "%s"', + array($hostGroup->services_ok, $hostGroup->hostgroup_alias) + ) + ->add( + StateBadges::STATE_CRITICAL, + $hostGroup->services_critical_unhandled, + array( + 'service_state' => 2, + 'service_acknowledged' => 0, + 'service_in_downtime' => 0, + 'host_problem' => 0, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'service_severity' + ), + 'List %u service that is currently in state CRITICAL on hosts in the host group "%s"', + 'List %u services which are currently in state CRITICAL on hosts in the host group "%s"', + array($hostGroup->services_critical_unhandled, $hostGroup->hostgroup_alias) + ) + ->add( + StateBadges::STATE_CRITICAL_HANDLED, + $hostGroup->services_critical_handled, + array( + 'service_state' => 2, + 'service_handled' => 1, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'service_severity' + ), + 'List %u service that is currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"', + 'List %u services which are currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"', + array($hostGroup->services_critical_handled, $hostGroup->hostgroup_alias) + ) + ->add( + StateBadges::STATE_UNKNOWN, + $hostGroup->services_unknown_unhandled, + array( + 'service_state' => 3, + 'service_acknowledged' => 0, + 'service_in_downtime' => 0, + 'host_problem' => 0, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'service_severity' + ), + 'List %u service that is currently in state UNKNOWN on hosts in the host group "%s"', + 'List %u services which are currently in state UNKNOWN on hosts in the host group "%s"', + array($hostGroup->services_unknown_unhandled, $hostGroup->hostgroup_alias) + ) + ->add( + StateBadges::STATE_UNKNOWN_HANDLED, + $hostGroup->services_unknown_handled, + array( + 'service_state' => 3, + 'service_handled' => 1, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'service_severity' + ), + 'List %u service that is currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"', + 'List %u services which are currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"', + array($hostGroup->services_unknown_handled, $hostGroup->hostgroup_alias) + + ) + ->add( + StateBadges::STATE_WARNING, + $hostGroup->services_warning_unhandled, + array( + 'service_state' => 1, + 'service_acknowledged' => 0, + 'service_in_downtime' => 0, + 'host_problem' => 0, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'service_severity' + ), + 'List %u service that is currently in state WARNING on hosts in the host group "%s"', + 'List %u services which are currently in state WARNING on hosts in the host group "%s"', + array($hostGroup->services_warning_unhandled, $hostGroup->hostgroup_alias) + ) + ->add( + StateBadges::STATE_WARNING_HANDLED, + $hostGroup->services_warning_handled, + array( + 'service_state' => 1, + 'service_handled' => 1, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'service_severity' + ), + 'List %u service that is currently in state WARNING (Acknowledged) on hosts in the host group "%s"', + 'List %u services which are currently in state WARNING (Acknowledged) on hosts in the host group "%s"', + array($hostGroup->services_warning_handled, $hostGroup->hostgroup_alias) + ) + ->add( + StateBadges::STATE_PENDING, + $hostGroup->services_pending, + array( + 'service_state' => 99, + 'hostgroup_name' => $hostGroup->hostgroup_name, + 'sort' => 'service_severity' + ), + 'List %u service that is currently in state PENDING on hosts in the host group "%s"', + 'List %u services which are currently in state PENDING on hosts in the host group "%s"', + array($hostGroup->services_pending, $hostGroup->hostgroup_alias) + ); + echo $stateBadges->render(); + ?> +
+hasMore()): ?> + + + diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml new file mode 100644 index 0000000..6d7674e --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -0,0 +1,106 @@ +compact): ?> +
+ tabs ?> + paginator ?> +
+ limiter ?> + sortBox ?> +
+ filterEditor ?> +
+ +
+hasResult()): ?> +

translate('No hosts found matching the filter.') ?>

+
+ + " + data-icinga-multiselect-data="host"> + + + + + addColumns as $col): ?> + + + + + + peekAhead($this->compact) as $host): + $hostStateName = Host::getStateText($host->host_state); + $hostLink = $this->href('monitoring/host/show', array('host' => $host->host_name)); + $hostCheckOverdue = $host->host_next_update < time();?> + > + + + addColumns as $col): ?> + $col && preg_match('~^_(host|service)_([a-zA-Z0-9_]+)$~', $col, $m)): ?> + + + + + + + + +
translate('State') ?>translate('Host') ?>escape($col) ?>
+
+ + icon('clock', sprintf($this->translate('Overdue %s'), DateFormatter::timeSince($host->host_next_update))) ?> + + host_state, true) ?> +
+ host_state !== 99): ?> +
+ timeSince($host->host_last_state_change, $this->compact) ?> + host_state > 0 && (int) $host->host_state_type === 0): ?> +
translate('Soft', 'Soft state') ?> host_attempt ?>
+ +
+ +
+
+ iconImage()->host($host) ?> + qlink( + $host->host_display_name, + $hostLink, + null, + array( + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $host->host_display_name + ), + 'class' => 'rowaction' + ) + ) ?> + hostFlags($host) ?> +
+

pluginOutput($this->ellipsis($host->host_output, 10000), true, $host->host_check_command) ?>

+
escape(\Icinga\Module\Monitoring\Object\MonitoredObject::protectCustomVars([$m[2] => $host->$col])[$m[2]]) ?>escape($host->$col) ?>
+hasMore()): ?> + + + +compact): ?> +
+ render('list/components/hostssummary.phtml') ?> + render('list/components/selectioninfo.phtml') ?> +
+ diff --git a/modules/monitoring/application/views/scripts/list/notifications.phtml b/modules/monitoring/application/views/scripts/list/notifications.phtml new file mode 100644 index 0000000..51ef432 --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/notifications.phtml @@ -0,0 +1,124 @@ +compact): ?> +
+ tabs ?> + paginator ?> +
+ limiter ?> + sortBox ?> +
+ filterEditor ?> +
+ +
+hasResult()): ?> +

translate('No notifications found matching the filter.') ?>

+
+ + + + peekAhead($this->compact) as $notification): + if (isset($notification->service_description)) { + $isService = true; + $stateLabel = Service::getStateText($notification->notification_state, true); + $stateName = Service::getStateText($notification->notification_state); + } else { + $isService = false; + $stateLabel = Host::getStateText($notification->notification_state, true); + $stateName = Host::getStateText($notification->notification_state); + } + ?> + + + + + + +
+
+
+ formatDateTime($notification->notification_timestamp) ?> +
+
+
+ '; + echo sprintf( + $this->translate('%s on %s', 'service on host'), + $this->qlink( + $notification->service_display_name, + 'monitoring/service/show', + [ + 'host' => $notification->host_name, + 'service' => $notification->service_description + ], + [ + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $notification->service_display_name, + $notification->host_display_name + ) + ] + ), + $this->qlink( + $notification->host_display_name, + 'monitoring/host/show', + ['host' => $notification->host_name], + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $notification->host_display_name + ) + ] + ) + ); + echo ''; + } else { + echo $this->qlink( + $notification->host_display_name, + 'monitoring/host/show', + ['host' => $notification->host_name], + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $notification->host_display_name + ) + ] + ); + } ?> + contact): ?> +
+ notification_contact_name): ?> + translate('Sent to %s'), + $this->qlink( + $notification->notification_contact_name, + 'monitoring/show/contact', + array('contact_name' => $notification->notification_contact_name) + ) + ) ?> + + translate('Not sent out to any contact') ?> + +
+ +
+

pluginOutput($this->ellipsis($notification->notification_output, 10000), true) ?>

+
+hasMore()): ?> + + + diff --git a/modules/monitoring/application/views/scripts/list/servicegrid-flipped.phtml b/modules/monitoring/application/views/scripts/list/servicegrid-flipped.phtml new file mode 100644 index 0000000..d7b4c78 --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/servicegrid-flipped.phtml @@ -0,0 +1,144 @@ +compact): ?> +
+ tabs ?> + problemToggle ?> +
+ sortBox ?> +
+ filterEditor ?> +
+ +
+ +

translate('No services found matching the filter.') ?>

+
+ $_) { + $serviceFilter->orFilter(Filter::where('service_description', $serviceDescription)); +} +?> + + + + + $hostAlias): ?> + + + + + + + + $serviceDisplayName): ?> + + + + + + compact && $this->horizontalPaginator->getPages()->pageCount > 1): ?> + + + + + compact && $this->verticalPaginator->getPages()->pageCount > 1): ?> + + + + + +
partial( + 'joystickPagination.phtml', + 'default', + array( + 'flippable' => true, + 'xAxisPaginator' => $horizontalPaginator, + 'yAxisPaginator' => $verticalPaginator + ) + ) ?>
qlink( + $this->ellipsis($hostAlias, 24), + Url::fromPath('monitoring/list/services')->addFilter( + Filter::matchAll($serviceFilter, Filter::where('host_name', $hostName)) + ), + null, + array('title' => sprintf($this->translate('List all reported services on host %s'), $hostAlias)), + false + ) ?>
$_) { + $hostFilter->orFilter(Filter::where('host_name', $hostName)); + } + echo $this->qlink( + $serviceDisplayName, + Url::fromPath('monitoring/list/services')->addFilter( + Filter::matchAll($hostFilter, Filter::where('service_description', $serviceDescription)) + ), + null, + array('title' => sprintf( + $this->translate('List all services with the name "%s" on all reported hosts'), + $serviceDisplayName + )) + ); + ?> + + + protectId($service->host_name . '_' . $service->service_description . '_desc') ?> + + escape($service->service_output) ?> + + qlink( + '', + 'monitoring/service/show', + array( + 'host' => $hostName, + 'service' => $serviceDescription + ), + array( + 'aria-describedby' => $ariaDescribedById, + 'aria-label' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $service->service_display_name, + $service->host_display_name + ), + 'class' => 'service-grid-link state-' . Service::getStateText($service->service_state) . ($service->service_handled ? ' handled' : ''), + 'title' => $service->service_output + ) + ) ?> + + qlink( + $this->translate('Load more'), + Url::fromRequest(), + array( + 'limit' => ($this->horizontalPaginator->getItemCountPerPage() + 20) + . ',' + . $this->verticalPaginator->getItemCountPerPage() + ), + array( + 'class' => 'action-link', + 'data-base-target' => '_self' + ) + ) ?> + +
+ qlink( + $this->translate('Load more'), + Url::fromRequest(), + array( + 'limit' => $this->horizontalPaginator->getItemCountPerPage() + . ',' + . ($this->verticalPaginator->getItemCountPerPage() + 20) + ), + array( + 'class' => 'action-link', + 'data-base-target' => '_self' + ) + ) ?> +
+ diff --git a/modules/monitoring/application/views/scripts/list/servicegrid.phtml b/modules/monitoring/application/views/scripts/list/servicegrid.phtml new file mode 100644 index 0000000..d0ed4bc --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/servicegrid.phtml @@ -0,0 +1,144 @@ +compact): ?> +
+ tabs ?> + problemToggle ?> +
+ sortBox ?> +
+ filterEditor ?> +
+ +
+ +

translate('No services found matching the filter.') ?>

+
+ $_) { + $hostFilter->orFilter(Filter::where('host_name', $hostName)); +} +?> + + + + + $serviceDisplayName): ?> + + + + + + + + $hostDisplayName): ?> + + + + + + compact && $this->horizontalPaginator->getPages()->pageCount > 1): ?> + + + + + compact && $this->verticalPaginator->getPages()->pageCount > 1): ?> + + + + + +
partial( + 'joystickPagination.phtml', + 'default', + array( + 'flippable' => true, + 'xAxisPaginator' => $horizontalPaginator, + 'yAxisPaginator' => $verticalPaginator + ) + ) ?>
qlink( + $this->ellipsis($serviceDisplayName, 24), + Url::fromPath('monitoring/list/services')->addFilter( + Filter::matchAll($hostFilter, Filter::where('service_description', $serviceDescription)) + ), + null, + array('title' => sprintf( + $this->translate('List all services with the name "%s" on all reported hosts'), + $serviceDisplayName + )), + false + ) ?>
$_) { + $serviceFilter->orFilter(Filter::where('service_description', $serviceName)); + } + echo $this->qlink( + $hostDisplayName, + Url::fromPath('monitoring/list/services')->addFilter( + Filter::matchAll($serviceFilter, Filter::where('host_name', $hostName)) + ), + null, + array('title' => sprintf($this->translate('List all reported services on host %s'), $hostDisplayName)) + ); + ?> + + + + protectId($service->host_name . '_' . $service->service_description . '_desc') ?> + + escape($service->service_output) ?> + + qlink( + '', + 'monitoring/service/show', + array( + 'host' => $hostName, + 'service' => $serviceDescription + ), + array( + 'aria-describedby' => $ariaDescribedById, + 'aria-label' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $service->service_display_name, + $service->host_display_name + ), + 'class' => 'service-grid-link state-' . Service::getStateText($service->service_state) . ($service->service_handled ? ' handled' : ''), + 'title' => $service->service_output + ) + ) ?> + + qlink( + $this->translate('Load more'), + Url::fromRequest(), + array( + 'limit' => ( + $this->horizontalPaginator->getItemCountPerPage() + 20) . ',' + . $this->verticalPaginator->getItemCountPerPage() + ), + array( + 'class' => 'action-link', + 'data-base-target' => '_self' + ) + ) ?> + +
+ qlink( + $this->translate('Load more'), + Url::fromRequest(), + array( + 'limit' => $this->horizontalPaginator->getItemCountPerPage() . ',' . + ($this->verticalPaginator->getItemCountPerPage() + 20) + ), + array( + 'class' => 'action-link', + 'data-base-target' => '_self' + ) + ) ?> +
+ diff --git a/modules/monitoring/application/views/scripts/list/servicegroup-grid.phtml b/modules/monitoring/application/views/scripts/list/servicegroup-grid.phtml new file mode 100644 index 0000000..5ea6d17 --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/servicegroup-grid.phtml @@ -0,0 +1,217 @@ +compact): ?> + + +
+hasResult()): ?> +

translate('No service groups found matching the filter.') ?>

+
+ +
+ +
+ services_critical_unhandled > 0): ?> + qlink( + $serviceGroup->services_critical_unhandled, + $this->url('monitoring/list/servicegrid')->addFilter($this->filterEditor->getFilter()), + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_handled' => 0, + 'service_state' => 2 + ], + [ + 'class' => 'state-critical', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state CRITICAL in service group "%s"', + 'List %s services which are currently in state CRITICAL in service group "%s"', + $serviceGroup->services_critical_unhandled + ), + $serviceGroup->services_critical_unhandled, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_warning_unhandled > 0): ?> + qlink( + $serviceGroup->services_warning_unhandled, + $this->url('monitoring/list/servicegrid')->addFilter($this->filterEditor->getFilter()), + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_handled' => 0, + 'service_state' => 1 + ], + [ + 'class' => 'state-warning', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state WARNING in service group "%s"', + 'List %s services which are currently in state WARNING in service group "%s"', + $serviceGroup->services_warning_unhandled + ), + $serviceGroup->services_warning_unhandled, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_unknown_unhandled > 0): ?> + qlink( + $serviceGroup->services_unknown_unhandled, + $this->url('monitoring/list/servicegrid')->addFilter($this->filterEditor->getFilter()), + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_handled' => 0, + 'service_state' => 3 + ], + [ + 'class' => 'state-unknown', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state UNKNOWN in service group "%s"', + 'List %s services which are currently in state UNKNOWN in service group "%s"', + $serviceGroup->services_unknown_unhandled + ), + $serviceGroup->services_unknown_unhandled, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_critical_handled > 0): ?> + qlink( + $serviceGroup->services_critical_handled, + $this->url('monitoring/list/servicegrid')->addFilter($this->filterEditor->getFilter()), + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_handled' => 1, + 'service_state' => 2 + ], + [ + 'class' => 'state-critical handled', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state CRITICAL (Acknowledged) in service group "%s"', + 'List %s services which are currently in state CRITICAL (Acknowledged) in service group "%s"', + $serviceGroup->services_critical_handled + ), + $serviceGroup->services_critical_handled, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_warning_handled > 0): ?> + qlink( + $serviceGroup->services_warning_handled, + $this->url('monitoring/list/servicegrid')->addFilter($this->filterEditor->getFilter()), + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_handled' => 1, + 'service_state' => 1 + ], + [ + 'class' => 'state-warning handled', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state WARNING (Acknowledged) in service group "%s"', + 'List %s services which are currently in state WARNING (Acknowledged) in service group "%s"', + $serviceGroup->services_warning_handled + ), + $serviceGroup->services_warning_handled, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_unknown_handled > 0): ?> + qlink( + $serviceGroup->services_unknown_handled, + $this->url('monitoring/list/servicegrid')->addFilter($this->filterEditor->getFilter()), + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_handled' => 1, + 'service_state' => 3 + ], + [ + 'class' => 'state-unknown handled', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state UNKNOWN (Acknowledged) in service group "%s"', + 'List %s services which are currently in state UNKNOWN (Acknowledged) in service group "%s"', + $serviceGroup->services_unknown_handled + ), + $serviceGroup->services_unknown_handled, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_pending > 0): ?> + qlink( + $serviceGroup->services_pending, + $this->url('monitoring/list/servicegrid')->addFilter($this->filterEditor->getFilter()), + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_state' => 99 + ], + [ + 'class' => 'state-pending', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currenlty in state PENDING in service group "%s"', + 'List %s services which are currently in state PENDING in service group "%s"', + $serviceGroup->services_pending + ), + $serviceGroup->services_pending, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + services_ok > 0): ?> + qlink( + $serviceGroup->services_ok, + $this->url('monitoring/list/servicegrid')->addFilter($this->filterEditor->getFilter()), + [ + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'service_state' => 0 + ], + [ + 'class' => 'state-ok', + 'title' => sprintf( + $this->translatePlural( + 'List %s service that is currently in state OK in service group "%s"', + 'List %s services which are currently in state OK in service group "%s"', + $serviceGroup->services_ok + ), + $serviceGroup->services_ok, + $serviceGroup->servicegroup_alias + ) + ] + ) ?> + +
+ 0 +
+ + qlink( + $serviceGroup->servicegroup_alias, + $this->url('monitoring/list/servicegrid')->addFilter($this->filterEditor->getFilter()), + ['servicegroup_name' => $serviceGroup->servicegroup_name], + [ + 'title' => sprintf( + $this->translate('List all services in the group "%s"'), + $serviceGroup->servicegroup_alias + ) + ] + ) ?> +
+ +
+ diff --git a/modules/monitoring/application/views/scripts/list/servicegroups.phtml b/modules/monitoring/application/views/scripts/list/servicegroups.phtml new file mode 100644 index 0000000..c915b30 --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/servicegroups.phtml @@ -0,0 +1,184 @@ +compact): ?> +
+ tabs ?> + paginator ?> + + filterEditor ?> +
+ +
+hasResult()): ?> +

translate('No service groups found matching the filter.') ?>

+
+ + + + + + + + + + + peekAhead($this->compact) as $serviceGroup): ?> + + + + + + + +
translate('Service Group') ?>translate('Service States') ?>
+ services_total ?> + + qlink( + $serviceGroup->servicegroup_alias, + $this + ->url('monitoring/list/services') + ->setParams(['servicegroup_name' => $serviceGroup->servicegroup_name]) + ->addFilter($this->filterEditor->getFilter()), + ['sort' => 'service_severity'], + ['title' => sprintf($this->translate('List all services in the group "%s"'), $serviceGroup->servicegroup_alias)] + ) ?> + + setUrl('monitoring/list/services') + ->setBaseFilter($this->filterEditor->getFilter()) + ->add( + StateBadges::STATE_OK, + $serviceGroup->services_ok, + array( + 'service_state' => 0, + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'sort' => 'service_severity' + ), + 'List %s service that is currently in state OK in service group "%s"', + 'List %s services which are currently in state OK in service group "%s"', + array($serviceGroup->services_ok, $serviceGroup->servicegroup_alias) + ) + ->add( + StateBadges::STATE_CRITICAL, + $serviceGroup->services_critical_unhandled, + array( + 'service_state' => 2, + 'service_acknowledged' => 0, + 'service_in_downtime' => 0, + 'host_problem' => 0, + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'sort' => 'service_severity' + ), + 'List %s service that is currently in state CRITICAL in service group "%s"', + 'List %s services which are currently in state CRITICAL in service group "%s"', + array($serviceGroup->services_critical_unhandled, $serviceGroup->servicegroup_alias) + ) + ->add( + StateBadges::STATE_CRITICAL_HANDLED, + $serviceGroup->services_critical_handled, + array( + 'service_state' => 2, + 'service_handled' => 1, + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'sort' => 'service_severity' + ), + 'List %s service that is currently in state CRITICAL (Acknowledged) in service group "%s"', + 'List %s services which are currently in state CRITICAL (Acknowledged) in service group "%s"', + array($serviceGroup->services_critical_handled, $serviceGroup->servicegroup_alias) + ) + ->add( + StateBadges::STATE_UNKNOWN, + $serviceGroup->services_unknown_unhandled, + array( + 'service_state' => 3, + 'service_acknowledged' => 0, + 'service_in_downtime' => 0, + 'host_problem' => 0, + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'sort' => 'service_severity' + ), + 'List %s service that is currently in state UNKNOWN in service group "%s"', + 'List %s services which are currently in state UNKNOWN in service group "%s"', + array($serviceGroup->services_unknown_unhandled, $serviceGroup->servicegroup_alias) + ) + ->add( + StateBadges::STATE_UNKNOWN_HANDLED, + $serviceGroup->services_unknown_handled, + array( + 'service_state' => 3, + 'service_handled' => 1, + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'sort' => 'service_severity' + ), + 'List %s service that is currently in state UNKNOWN (Acknowledged) in service group "%s"', + 'List %s services which are currently in state UNKNOWN (Acknowledged) in service group "%s"', + array($serviceGroup->services_unknown_handled, $serviceGroup->servicegroup_alias) + + ) + ->add( + StateBadges::STATE_WARNING, + $serviceGroup->services_warning_unhandled, + array( + 'service_state' => 1, + 'service_acknowledged' => 0, + 'service_in_downtime' => 0, + 'host_problem' => 0, + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'sort' => 'service_severity' + ), + 'List %s service that is currently in state WARNING in service group "%s"', + 'List %s services which are currently in state WARNING in service group "%s"', + array($serviceGroup->services_warning_unhandled, $serviceGroup->servicegroup_alias) + ) + ->add( + StateBadges::STATE_WARNING_HANDLED, + $serviceGroup->services_warning_handled, + array( + 'service_state' => 1, + 'service_handled' => 1, + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'sort' => 'service_severity' + ), + 'List %s service that is currently in state WARNING (Acknowledged) in service group "%s"', + 'List %s services which are currently in state WARNING (Acknowledged) in service group "%s"', + array($serviceGroup->services_warning_handled, $serviceGroup->servicegroup_alias) + ) + ->add( + StateBadges::STATE_PENDING, + $serviceGroup->services_pending, + array( + 'service_state' => 99, + 'servicegroup_name' => $serviceGroup->servicegroup_name, + 'sort' => 'service_severity' + ), + 'List %s service that is currenlty in state PENDING in service group "%s"', + 'List %s services which are currently in state PENDING in service group "%s"', + array($serviceGroup->services_pending, $serviceGroup->servicegroup_alias) + ); + echo $stateBadges->render(); + ?> +
+hasMore()): ?> + + + diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml new file mode 100644 index 0000000..b2088e9 --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -0,0 +1,161 @@ +compact): ?> +
+ tabs ?> + paginator ?> +
+ limiter ?> + sortBox ?> +
+ filterEditor ?> +
+ +
+hasResult()): ?> +

translate('No services found matching the filter.') ?>

+
+ + + + + + + addColumns as $col): ?> + + + + + + peekAhead($this->compact) as $service): + $serviceLink = $this->href( + 'monitoring/service/show', + array( + 'host' => $service->host_name, + 'service' => $service->service_description + ) + ); + $hostLink = $this->href( + 'monitoring/host/show', + array( + 'host' => $service->host_name, + ) + ); + $serviceStateName = Service::getStateText($service->service_state); + $serviceCheckOverdue = $service->service_next_update < time(); ?> + > + + + + addColumns as $col): ?> + $col && preg_match('~^_(host|service)_([a-zA-Z0-9_]+)$~', $col, $m)): ?> + + + + + + + + +
translate('State') ?>translate('Service') ?>escape($col) ?>
+
+ + icon('clock', sprintf($this->translate('Overdue %s'), DateFormatter::timeSince($service->service_next_update))) ?> + + service_state, true) ?> +
+ service_state !== 99): ?> +
+ timeSince($service->service_last_state_change, $this->compact) ?> + service_state > 0 && (int) $service->service_state_type === 0): ?> +
translate('Soft', 'Soft state') ?> service_attempt ?>
+ +
+ +
+
+ + iconImage()->service($service) ?> + showHost) { + echo sprintf( + $this->translate('%s on %s', 'service on host'), + $this->qlink( + $service->service_display_name, + $serviceLink, + null, + array( + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $service->service_display_name, + $service->host_display_name + ), + 'class' => 'rowaction' + ) + ), + $this->qlink( + $service->host_display_name + . ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''), + $hostLink, + null, + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $service->host_display_name + ) + ] + ) + ); + } else { + echo $this->qlink( + $service->service_display_name, + $serviceLink, + null, + array( + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $service->service_display_name, + $service->host_display_name + ), + 'class' => 'rowaction' + ) + ); + } + ?> + + serviceFlags($service) ?> +
+
+
+ perfdata($service->service_perfdata, true, 5) ?> +
+

pluginOutput($this->ellipsis($service->service_output, 10000), true, $service->service_check_command) ?>

+
+
escape(\Icinga\Module\Monitoring\Object\MonitoredObject::protectCustomVars([$m[2] => $service->$col])[$m[2]]) ?>escape($service->$col) ?>
+hasMore()): ?> + + + +compact): ?> +
+ render('list/components/servicesummary.phtml') ?> + render('list/components/selectioninfo.phtml') ?> +
+ diff --git a/modules/monitoring/application/views/scripts/object/detail-history.phtml b/modules/monitoring/application/views/scripts/object/detail-history.phtml new file mode 100644 index 0000000..692d3e4 --- /dev/null +++ b/modules/monitoring/application/views/scripts/object/detail-history.phtml @@ -0,0 +1,13 @@ +compact): ?> +
+ tabs ?> +type === 'service') { + echo $this->render('partials/object/service-header.phtml'); +} else { + echo $this->render('partials/object/host-header.phtml'); +} ?> +
+ +render('partials/event-history.phtml') ?> diff --git a/modules/monitoring/application/views/scripts/object/detail-tabhook.phtml b/modules/monitoring/application/views/scripts/object/detail-tabhook.phtml new file mode 100644 index 0000000..abcfcc1 --- /dev/null +++ b/modules/monitoring/application/views/scripts/object/detail-tabhook.phtml @@ -0,0 +1,21 @@ +compact): ?> +
+ tabs ?> +header === true) { + if ($object->type === 'service') { + echo $this->render('partials/object/service-header.phtml'); + } else { + echo $this->render('partials/object/host-header.phtml'); + } +} elseif ($this->header !== false) { + echo $this->header; +} +?> +
+ +
+ content ?> +
\ No newline at end of file diff --git a/modules/monitoring/application/views/scripts/partials/command/object-command-form.phtml b/modules/monitoring/application/views/scripts/partials/command/object-command-form.phtml new file mode 100644 index 0000000..b4e5a9c --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/command/object-command-form.phtml @@ -0,0 +1,18 @@ + +
+compact): ?> + tabs ?> + +getType() === $object::TYPE_HOST) { + echo $this->render('partials/object/host-header.phtml'); + $this->baseFilter = Filter::where('host', $object->host_name); + $this->stats = $object->stats; + echo $this->render('list/components/servicesummary.phtml'); +} else { + echo $this->render('partials/object/service-header.phtml'); +} ?> +render('partials/object/quick-actions.phtml') ?> +
+
+ +
diff --git a/modules/monitoring/application/views/scripts/partials/command/objects-command-form.phtml b/modules/monitoring/application/views/scripts/partials/command/objects-command-form.phtml new file mode 100644 index 0000000..8d241ee --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/command/objects-command-form.phtml @@ -0,0 +1,15 @@ +
+compact): ?> + + + + render('list/components/servicesummary.phtml') ?> + render('partials/service/objects-header.phtml') ?> + + render('list/components/hostssummary.phtml') ?> + render('partials/host/objects-header.phtml') ?> + +
+
+ +
diff --git a/modules/monitoring/application/views/scripts/partials/comment/comment-description.phtml b/modules/monitoring/application/views/scripts/partials/comment/comment-description.phtml new file mode 100644 index 0000000..f35680c --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/comment/comment-description.phtml @@ -0,0 +1,24 @@ +type) { + case 'flapping': + $icon = 'flapping'; + $title = $this->translate('Flapping'); + $tooltip = $this->translate('Comment was caused by a flapping host or service'); + break; + case 'comment': + $icon = 'user'; + $title = $this->translate('User Comment'); + $tooltip = $this->translate('Comment was created by an user'); + break; + case 'downtime': + $icon = 'plug'; + $title = $this->translate('Downtime'); + $tooltip = $this->translate('Comment was caused by a downtime'); + break; + case 'ack': + $icon = 'ok'; + $title = $this->translate('Acknowledgement'); + $tooltip = $this->translate('Comment was caused by an acknowledgement'); + break; +} +echo $this->icon($icon, $tooltip, array('class' => 'large-icon')); diff --git a/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml b/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml new file mode 100644 index 0000000..c603d3c --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml @@ -0,0 +1,82 @@ +
+objecttype === 'service') { + echo ''; + echo sprintf( + $this->translate('%s on %s', 'service on host'), + $this->qlink( + $comment->service_display_name, + 'monitoring/service/show', + [ + 'host' => $comment->host_name, + 'service' => $comment->service_description + ], + [ + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $comment->service_display_name, + $comment->host_display_name + ) + ] + ), + $this->qlink( + $comment->host_display_name, + 'monitoring/host/show', + ['host' => $comment->host_name], + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $comment->host_display_name + ) + ] + ) + ); + echo ''; +} else { + echo $this->qlink( + $comment->host_display_name, + 'monitoring/host/show', + array('host' => $comment->host_name), + array( + 'title' => sprintf( + $this->translate('Show detailed information for this comment about host %s'), + $comment->host_display_name + ) + ) + ); +} ?> + + translate('by') ?> + escape($comment->author) ?> + timeAgo($comment->timestamp) ?> + + + persistent ? $this->icon('attach', 'This comment is persistent') : '' ?> + expiration ? $this->icon('clock', sprintf( + $this->translate('This comment expires on %s at %s'), + $this->formatDate($comment->expiration), + $this->formatTime($comment->expiration) + )) : '' ?> + setAttrib('class', $deleteButton->getAttrib('class') . ' remove-action dont-print'); + $deleteButton->populate( + array( + 'comment_id' => $comment->id, + 'comment_is_service' => isset($comment->service_description), + 'comment_name' => $comment->name + ) + ); + $deleteButton->getElement('btn_submit') + ->setAttrib('aria-label', $this->translate('Delete comment')) + ->setAttrib('id', $buttonId) + ->setAttrib('aria-describedby', $buttonId . ' ' . $textId); + echo $deleteButton; + } ?> + +
+nl2br($this->markdownLine($comment->comment, isset($textId) ? ['id' => $textId, 'class' => 'caption'] : [ 'class' => 'caption'])) ?> diff --git a/modules/monitoring/application/views/scripts/partials/comment/comment-header.phtml b/modules/monitoring/application/views/scripts/partials/comment/comment-header.phtml new file mode 100644 index 0000000..4472479 --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/comment/comment-header.phtml @@ -0,0 +1,10 @@ + + + + + +
+ render('partials/comment/comment-description.phtml') ?> + + render('partials/comment/comment-detail.phtml') ?> +
diff --git a/modules/monitoring/application/views/scripts/partials/comment/comments-header.phtml b/modules/monitoring/application/views/scripts/partials/comment/comments-header.phtml new file mode 100644 index 0000000..c4c92da --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/comment/comments-header.phtml @@ -0,0 +1,32 @@ + + + $comment): + if ($i === 5) { + break; + } + ?> + + + + + + +
+ partial('partials/comment/comment-description.phtml', array('comment' => $comment)) ?> + + partial('partials/comment/comment-detail.phtml', array('comment' => $comment)) ?> +
+count() > 5): ?> +

+ qlink( + sprintf($this->translate('List all %d comments'), $comments->count()), + $listAllLink, + null, + array( + 'data-base-target' => '_next', + 'icon' => 'down-open' + ) + ) ?> +

+ diff --git a/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml new file mode 100644 index 0000000..dae6caa --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml @@ -0,0 +1,101 @@ + + start <= time() && ! $downtime->is_in_effect): ?> +
translate('ENDS', 'Downtime status'); ?>
+
timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact, true) ?>
+ +
is_in_effect ? $this->translate('EXPIRES', 'Downtime status') : $this->translate('STARTS', 'Downtime status'); ?>
+
timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact, true) ?>
+ + + +
+ '; + echo sprintf( + $this->translate('%s on %s', 'service on host'), + $this->qlink( + $downtime->service_display_name, + 'monitoring/service/show', + [ + 'host' => $downtime->host_name, + 'service' => $downtime->service_description + ], + [ + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $downtime->service_display_name, + $downtime->host_display_name + ) + ] + ), + $this->qlink( + $downtime->host_display_name, + 'monitoring/host/show', + ['host' => $downtime->host_name], + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $downtime->host_display_name + ) + ] + ) + ); + echo ''; + } else { + echo $this->qlink( + $downtime->host_display_name, + 'monitoring/host/show', + array('host' => $downtime->host_name, 'downtime_id' => $downtime->id), + array( + 'title' => sprintf( + $this->translate('Show detailed information for this downtime scheduled for host %s'), + $downtime->host_display_name + ) + ) + ); + } ?> + + escape(sprintf( + $downtime->is_flexible + ? $this->translate('Flexible downtime by %s') + : $this->translate('Fixed downtime by %s'), + $downtime->author_name + )) ?> + + is_in_effect && $downtime->start >= time()): ?> + translate('expires %s'), $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, false, true)) ?> + + + is_flexible): ?> + icon('magic', $this->translate('This downtime is flexible')); ?> + + + is_in_effect): ?> + icon('plug', $this->translate('This downtime is in effect')); ?> + + + setAttrib('class', $deleteButton->getAttrib('class') . ' remove-action dont-print'); + $deleteButton->populate( + array( + 'downtime_id' => $downtime->id, + 'downtime_is_service' => isset($downtime->service_description), + 'downtime_name' => $downtime->name + ) + ); + $deleteButton->getElement('btn_submit') + ->setAttrib('aria-label', $this->translate('Delete downtime')) + ->setAttrib('id', $buttonId) + ->setAttrib('aria-describedby', $buttonId . ' ' . $textId); + echo $deleteButton; + } ?> + +
+ nl2br($this->markdown($downtime->comment, isset($textId) ? ['id' => $textId] : null)) ?> + diff --git a/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml b/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml new file mode 100644 index 0000000..e2582c1 --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml @@ -0,0 +1,40 @@ + + + + downtimes as $i => $downtime): + if ($i > 5) { + break; + } + if ($downtime->objecttype === 'service') { + $this->isService = true; + $this->stateName = Service::getStateText($downtime->service_state); + } else { + $this->isService = false; + $this->stateName = Host::getStateText($downtime->host_state); + } + $this->downtime = $downtime; + $this->displayComment = false; + ?> + + render('partials/downtime/downtime-header.phtml') ?> + + + +
+count() > 5): ?> +

+ qlink( + sprintf($this->translate('List all %d downtimes'), $downtimes->count()), + $listAllLink, + null, + array( + 'data-base-target' => '_next', + 'icon' => 'down-open' + ) + ) ?> +

+ diff --git a/modules/monitoring/application/views/scripts/partials/event-history.phtml b/modules/monitoring/application/views/scripts/partials/event-history.phtml new file mode 100644 index 0000000..b81c95d --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/event-history.phtml @@ -0,0 +1,267 @@ +qlink( + $contact, + 'monitoring/show/contact', + array('contact_name' => $contact), + array('title' => sprintf($view->translate('Show detailed information about %s'), $contact)) + ); + } + return '[' . implode(', ', $links) . ']'; +} + +$self = $this; + +$url = $this->url(); +$limit = (int) $url->getParam('limit', 25); +if (! $url->hasParam('page') || ($page = (int) $url->getParam('page')) < 1) { + $page = 1; +} + +/** @var \Icinga\Module\Monitoring\DataView\EventHistory $history */ +$history->limit($limit * $page); +?> +
+translate('Flapping with a %.2f%% state change rate'); +$rowAction = Url::fromPath('monitoring/event/show'); +?> + peekAhead() as $event): ?> + + + +service_description); + $msg = $event->output; + $stateName = 'no-state'; + + $rowAction->setParams(new UrlParams())->addParams(array( + 'type' => $event->type, + 'id' => $event->id + )); + switch ($event->type) { + case substr($event->type, 0, 13) === 'notification_': + $rowAction->setParam('type', 'notify'); + $icon = 'bell'; + switch (substr($event->type, 13)) { + case 'state': + $iconTitle = $this->translate('State notification', 'tooltip'); + $label = $this->translate('NOTIFICATION'); + $stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state); + break; + case 'ack': + $iconTitle = $this->translate('Ack Notification', 'tooltip'); + $label = $this->translate('ACK NOTIFICATION'); + break; + case 'dt_start': + $iconTitle = $this->translate('Downtime start notification', 'tooltip'); + $label = $this->translate('DOWNTIME START NOTIFICATION'); + break; + case 'dt_end': + $iconTitle = $this->translate('Downtime end notification', 'tooltip'); + $label = $this->translate('DOWNTIME END NOTIFICATION'); + break; + case 'flapping': + $iconTitle = $this->translate('Flapping notification', 'tooltip'); + $label = $this->translate('FLAPPING NOTIFICATION'); + break; + case 'flapping_end': + $iconTitle = $this->translate('Flapping end notification', 'tooltip'); + $label = $this->translate('FLAPPING END NOTIFICATION'); + break; + case 'custom': + $iconTitle = $this->translate('Custom notification', 'tooltip'); + $label = $this->translate('CUSTOM NOTIFICATION'); + break; + } + $msg = $msg ? preg_replace_callback( + '/^\[([^\]]+)\]/', + function($match) use ($self) { return contactsLink($match, $self); }, + $msg + ) : $this->translate('This notification was not sent out to any contact.'); + break; + case 'comment': + $icon = 'comment-empty'; + $iconTitle = $this->translate('Comment', 'tooltip'); + $label = $this->translate('COMMENT'); + break; + case 'comment_deleted': + $icon = 'cancel'; + $iconTitle = $this->translate('Comment removed', 'tooltip'); + $label = $this->translate('COMMENT DELETED'); + break; + case 'ack': + $icon = 'ok'; + $iconTitle = $this->translate('Acknowledged', 'tooltip'); + $label = $this->translate('ACKNOWLEDGED'); + break; + case 'ack_deleted': + $icon = 'ok'; + $iconTitle = $this->translate('Acknowledgement removed', 'tooltip'); + $label = $this->translate('ACKNOWLEDGEMENT REMOVED'); + break; + case 'dt_comment': + $icon = 'plug'; + $iconTitle = $this->translate('Downtime scheduled', 'tooltip'); + $label = $this->translate('SCHEDULED DOWNTIME'); + break; + case 'dt_comment_deleted': + $icon = 'plug'; + $iconTitle = $this->translate('Downtime removed', 'tooltip'); + $label = $this->translate('DOWNTIME DELETED'); + break; + case 'flapping': + $icon = 'flapping'; + $iconTitle = $this->translate('Flapping started', 'tooltip'); + $label = $this->translate('FLAPPING'); + $msg = sprintf($flappingMsg, $msg); + break; + case 'flapping_deleted': + $icon = 'flapping'; + $iconTitle = $this->translate('Flapping stopped', 'tooltip'); + $label = $this->translate('FLAPPING STOPPED'); + $msg = sprintf($flappingMsg, $msg); + break; + case 'hard_state': + if ((int) $event->state === 0) { + $icon = 'thumbs-up'; + } else { + $icon = 'warning-empty'; + } + $iconTitle = $this->translate('Hard state', 'tooltip'); + $label = $isService ? Service::getStateText($event->state, true) : Host::getStateText($event->state, true); + $stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state); + break; + case 'soft_state': + $icon = 'spinner'; + $iconTitle = $this->translate('Soft state', 'tooltip'); + $label = $isService ? Service::getStateText($event->state, true) : Host::getStateText($event->state, true); + $stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state); + break; + case 'dt_start': + $icon = 'plug'; + $iconTitle = $this->translate('Downtime started', 'tooltip'); + $label = $this->translate('DOWNTIME START'); + break; + case 'dt_end': + $icon = 'plug'; + $iconTitle = $this->translate('Downtime ended', 'tooltip'); + $label = $this->translate('DOWNTIME END'); + break; + } ?> + format($event->timestamp); + if ($currentDate !== $lastDate): + $lastDate = $currentDate; + ?> + + + + + + + + + + + +
+ getIteratorPosition() % $limit === 0): ?> + + +
escape($label) ?>
+
formatTime($event->timestamp) ?>
+
+
+ +
+ icon($icon, $iconTitle) ?> +
+ +
+ isOverview): ?> + '; + echo sprintf( + $this->translate('%s on %s', 'service on host'), + $this->qlink( + $event->service_display_name, + 'monitoring/service/show', + [ + 'host' => $event->host_name, + 'service' => $event->service_description + ], + [ + 'title' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $event->service_display_name, + $event->host_display_name + ) + ] + ), + $this->qlink( + $event->host_display_name, + 'monitoring/host/show', + ['host' => $event->host_name], + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $event->host_display_name + ) + ] + ) + ); + echo ''; + } else { + echo $this->qlink( + $event->host_display_name, + 'monitoring/host/show', + ['host' => $event->host_name], + [ + 'title' => sprintf( + $this->translate('Show detailed information for host %s'), + $event->host_display_name + ) + ] + ); + } ?> + + nl2br($this->createTicketLinks($this->markdown($msg, ['class' => 'overview-plugin-output']))) ?> +
+
+
+ +hasMore()): ?> + + +
diff --git a/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml b/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml new file mode 100644 index 0000000..48141e2 --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml @@ -0,0 +1,41 @@ + + + + $host): /** @var Host $host */ + if ($i === 5) { + break; + } ?> + + + + + + +
+ host_state) ?> +
+ timeSince($host->host_last_state_change, $this->compact) ?> +
+
+ link()->host( + $host->host_name, + $host->host_display_name + ) ?> + hostFlags($host) ?> +
+ 5): ?> + + diff --git a/modules/monitoring/application/views/scripts/partials/object/detail-content.phtml b/modules/monitoring/application/views/scripts/partials/object/detail-content.phtml new file mode 100644 index 0000000..62bfd2c --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/object/detail-content.phtml @@ -0,0 +1,53 @@ +
+ render('show/components/output.phtml') ?> + render('show/components/grapher.phtml') ?> + render('show/components/extensions.phtml') ?> + +

translate('Problem handling') ?>

+ + + render('show/components/acknowledgement.phtml') ?> + render('show/components/comments.phtml') ?> + render('show/components/downtime.phtml') ?> + render('show/components/notes.phtml') ?> + render('show/components/actions.phtml') ?> + render('show/components/flapping.phtml') ?> + type === 'service'): ?> + render('show/components/servicegroups.phtml') ?> + + render('show/components/hostgroups.phtml') ?> + + +
+ + render('show/components/perfdata.phtml') ?> + +

translate('Notifications') ?>

+ + + render('show/components/notifications.phtml') ?> + hasPermission('*') || ! $this->hasPermission('no-monitoring/contacts')): ?> + render('show/components/contacts.phtml') ?> + + +
+ +

translate('Check execution') ?>

+ + + render('show/components/command.phtml') ?> + render('show/components/checksource.phtml') ?> + render('show/components/reachable.phtml') ?> + render('show/components/checkstatistics.phtml') ?> + render('show/components/checktimeperiod.phtml') ?> + +
+ + customvars)): ?> +

translate('Custom Variables') ?>

+
+ customvarsWithOriginalNames, $object)) ?> +
+ + render('show/components/flags.phtml') ?> +
diff --git a/modules/monitoring/application/views/scripts/partials/object/host-header.phtml b/modules/monitoring/application/views/scripts/partials/object/host-header.phtml new file mode 100644 index 0000000..4de4a01 --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/object/host-header.phtml @@ -0,0 +1,51 @@ +getPath() === 'monitoring/host/show' && $url->getParam('host') === $object->host_name); +?> + + + + + +
+
host_state, true) ?>
+
+ timeSince($object->host_last_state_change) ?> + host_state > 0 && (int) $object->host_state_type === 0): ?> +
translate('Soft', 'Soft state') ?> host_attempt ?>
+ +
+
+ iconImage()->host($object) ?> + $object->host_name)) . '">'; + } + ?> + escape($object->host_display_name) ?> + host_display_name !== $object->host_name): ?> + (escape($object->host_name) ?>) + + '; + } + ?> + host_alias !== $object->host_display_name && $object->host_alias !== $object->host_name): ?> +
+ escape($this->translate('Alias', 'host') . ': ' . $object->host_alias) ?> +
+ + hostFlags($object) ?> + host_address6 && $object->host_address6 !== $object->host_name): ?> +
escape($object->host_address6) ?>
+ + host_address && $object->host_address !== $object->host_name): ?> +
escape($object->host_address) ?>
+ +
diff --git a/modules/monitoring/application/views/scripts/partials/object/quick-actions.phtml b/modules/monitoring/application/views/scripts/partials/object/quick-actions.phtml new file mode 100644 index 0000000..fe05a84 --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/object/quick-actions.phtml @@ -0,0 +1,144 @@ +
+ +
diff --git a/modules/monitoring/application/views/scripts/partials/object/service-header.phtml b/modules/monitoring/application/views/scripts/partials/object/service-header.phtml new file mode 100644 index 0000000..318fe49 --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/object/service-header.phtml @@ -0,0 +1,72 @@ +getPath() === 'monitoring/service/show' && $url->getParam('service') === $object->service_description); +?> + + + + + + + + + +
+
host_state, true) ?>
+
+ timeSince($object->host_last_state_change) ?> + host_state > 0 && (int) $object->host_state_type === 0): ?> +
translate('Soft', 'Soft state') ?> host_attempt ?>
+ +
+
+ iconImage()->host($object) ?> + + escape($object->host_display_name) ?> + host_display_name !== $object->host_name): ?> + (escape($object->host_name) ?>) + + + hostFlags($object) ?> + host_address6 && $object->host_address6 !== $object->host_name): ?> +
escape($object->host_address6) ?>
+ + host_address && $object->host_address !== $object->host_name): ?> +
escape($object->host_address) ?>
+ +
+
service_state, true) ?>
+
+ timeSince($object->service_last_state_change) ?> + service_state > 0 && (int) $object->service_state_type === 0): ?> +
translate('Soft', 'Soft state') ?> service_attempt ?>
+ +
+
+ iconImage()->service($object) ?> + translate('Service') ?>: + $object->host_name, + 'service' => $object->service_description + )) . '">'; + } + ?> + escape($object->service_display_name) ?> + service_display_name !== $object->service_description): ?> + (escape($object->service_description) ?>) + + '; + } + ?> + serviceFlags($object) ?> +
diff --git a/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml new file mode 100644 index 0000000..d342d87 --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml @@ -0,0 +1,45 @@ + + + + $service): /** @var Service $service */ + if ($i === 5) { + break; + } ?> + + + + + + +
+ service_state) ?> +
+ timeSince($service->service_last_state_change, $this->compact) ?> +
+
+ link()->service( + $service->service_description, + $service->service_display_name, + $service->host_name, + $service->host_display_name + . ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : '') + ) ?> + serviceFlags($service) ?> +
+ 5): ?> + + diff --git a/modules/monitoring/application/views/scripts/partials/show-more.phtml b/modules/monitoring/application/views/scripts/partials/show-more.phtml new file mode 100644 index 0000000..fd6a99d --- /dev/null +++ b/modules/monitoring/application/views/scripts/partials/show-more.phtml @@ -0,0 +1,15 @@ +hasMore()): ?> +
+ qlink( + $this->translate('Show More'), + $this->url()->without(array('showCompact', 'limit')), + null, + array( + 'data-base-target' => '_next', + 'class' => 'action-link' + ) + ) ?> +
+ diff --git a/modules/monitoring/application/views/scripts/service/show.phtml b/modules/monitoring/application/views/scripts/service/show.phtml new file mode 100644 index 0000000..bc9c612 --- /dev/null +++ b/modules/monitoring/application/views/scripts/service/show.phtml @@ -0,0 +1,8 @@ +
+compact): ?> + tabs ?> + + render('partials/object/service-header.phtml') ?> + render('partials/object/quick-actions.phtml') ?> +
+render('partials/object/detail-content.phtml') ?> diff --git a/modules/monitoring/application/views/scripts/services/show.phtml b/modules/monitoring/application/views/scripts/services/show.phtml new file mode 100644 index 0000000..e9fb56f --- /dev/null +++ b/modules/monitoring/application/views/scripts/services/show.phtml @@ -0,0 +1,208 @@ +
+ + compact): ?> + + + render('list/components/servicesummary.phtml') ?> + render('partials/service/objects-header.phtml') ?> + getScheduledDowntimes()); + ?> +
+ +
+ + + translate('No services found matching the filter') ?> + + render('show/components/extensions.phtml') ?> +

translate('Problem handling') ?>

+ + + 0): ?> + + + + + + + 0): ?> + + + + + + + + + + + + getComments())) > 0): ?> + + + + + + + + + + + + 0): ?> + + + + + + + +
translate('%d unhandled problems'), $unackCount) ?> qlink( + $this->translate('Acknowledge'), + $acknowledgeLink, + null, + array( + 'class' => 'action-link', + 'icon' => 'check' + ) + ) ?>
translatePlural( + '%s acknowledgement', + '%s acknowledgements', + $acknowledgedCount + ), + '' . $acknowledgedCount . '' + ) ?> + + setLabelEnabled(true) ?> +
translate('Comments') ?> + qlink( + $this->translate('Add comments'), + $addCommentLink, + null, + array( + 'class' => 'action-link', + 'icon' => 'comment-empty' + ) + ) ?> +
+ qlink( + sprintf( + $this->translatePlural( + '%s comment', + '%s comments', + $commentCount + ), + $commentCount + ), + $commentsLink, + null, + array('data-base-target' => '_next') + ) ?> +
+ translate('Downtimes') ?> + + qlink( + $this->translate('Schedule downtimes'), + $downtimeAllLink, + null, + array( + 'icon' => 'plug', + 'class' => 'action-link' + ) + ) ?> +
+ qlink( + sprintf( + $this->translatePlural( + '%d scheduled downtime', + '%d scheduled downtimes', + $scheduledDowntimeCount + ), + $scheduledDowntimeCount + ), + $showDowntimesLink, + null, + array( + 'data-base-target' => '_next' + ) + ) ?> +
+ + hasPermission('monitoring/command/send-custom-notification')): ?> + +

translate('Notifications') ?>

+ + + + + + + + +
translate('Notifications') ?> + qlink( + $this->translate('Send notifications'), + $sendCustomNotificationLink, + null, + array( + 'class' => 'action-link', + 'icon' => 'bell' + ) + ) ?> +
+ + +

translate('Check Execution') ?>

+ + + + + + + + + + + + + + + + + + + + + + +
translate('Command') ?> + qlink( + $this->translate('Process check result'), + $processCheckResultAllLink, + null, + array( + 'class' => 'action-link', + 'icon' => 'edit' + ) + ) ?> +
translate('Schedule Check') ?>
+ qlink( + $this->translate('Reschedule'), + $rescheduleAllLink, + null, + array( + 'class' => 'action-link', + 'icon' => 'calendar-empty' + ) + ) ?> +
+

translate('Feature Commands') ?>

+ + +
diff --git a/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml b/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml new file mode 100644 index 0000000..fd7f6bb --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml @@ -0,0 +1,94 @@ +state, array(0, 99))) { + // Ignore this markup if the object is in a non-problem state or pending + return; +} + +if ($object->acknowledged): +$acknowledgement = $object->acknowledgement; +/** @var \Icinga\Module\Monitoring\Object\Acknowledgement $acknowledgement */ +?> + + translate('Acknowledged') ?> + + +
+
+ escape($acknowledgement->getAuthor()) ?> + + translate('acknowledged') ?> + timeAgo($acknowledgement->getEntryTime()) ?> + expires()): ?> + + translate('Expires %s'), + $this->timeUntil($acknowledgement->getExpirationTime()) + ) ?> + + + getSticky()): ?> + icon('pin', sprintf( + $this->translate( + 'Acknowledgement remains until the %1$s recovers even if the %1$s changes state' + ), + $object->getType(true) + )) ?> + + setAttrib('class', $removeAckForm->getAttrib('class') . ' remove-action'); + echo $removeAckForm; + } ?> +
+
+ nl2br($this->createTicketLinks($this->markdown($acknowledgement->getComment()))) ?> +
+
+ + + + + + + + translate('Not acknowledged') ?> + + hasPermission('monitoring/command/acknowledge-problem')) { + if ($object->getType() === $object::TYPE_HOST) { + $ackLink = $this->href( + 'monitoring/host/acknowledge-problem', + array('host' => $object->getName()), + null, + array('class' => 'action-link') + ); + } else { + $ackLink = $this->href( + 'monitoring/service/acknowledge-problem', + array('host' => $object->getHost()->getName(), 'service' => $object->getName()), + null, + array('class' => 'action-link') + ); + } + ?> + qlink( + $this->translate('Acknowledge'), + $ackLink, + null, + array( + 'class' => 'action-link', + 'data-base-target' => '_self', + 'icon' => 'edit', + 'title' => $this->translate( + 'Acknowledge this problem, suppress all future notifications for it and tag it as being handled' + ) + ) + ) ?> + + + + diff --git a/modules/monitoring/application/views/scripts/show/components/actions.phtml b/modules/monitoring/application/views/scripts/show/components/actions.phtml new file mode 100644 index 0000000..938ab2a --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/actions.phtml @@ -0,0 +1,43 @@ +load($object->getType() . '-action'); +foreach ($navigation as $item) { + $item->setObject($object); +} + +foreach ($object->getActionUrls() as $i => $link) { + $navigation->addItem( + + // add warning to links that open in new tabs to improve accessibility, as recommended by WCAG20 G201 + $this->icon( + 'forward', + $this->translate('Link opens in new window'), + array('aria-label' => $this->translate('Link opens in new window')) + ) . ' Action ' . ($i + 1), + array( + 'url' => $link, + 'target' => '_blank', + 'renderer' => array( + 'NavigationItemRenderer', + 'escape_label' => false + ) + ) + ); +} + +if (isset($this->actions)) { + $navigation->merge($this->actions); +} + +if ($navigation->isEmpty() || ! $navigation->hasRenderableItems()) { + return; +} + +?> + + translate('Actions'); ?> + getRenderer()->setElementTag('td')->setCssClass('actions go-ahead'); ?> + diff --git a/modules/monitoring/application/views/scripts/show/components/checksource.phtml b/modules/monitoring/application/views/scripts/show/components/checksource.phtml new file mode 100644 index 0000000..ac9799f --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/checksource.phtml @@ -0,0 +1,6 @@ +check_source !== null): ?> + + translate('Check Source') ?> + escape($object->check_source) ?> + + diff --git a/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml new file mode 100644 index 0000000..e37e30a --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml @@ -0,0 +1,85 @@ +active_checks_enabled; +?> + + + translate('Last check') : $this->translate('Last update') ?> + +state !== 99): ?> + timeAgo($object->last_check) ?> + next_update < time()): ?> + icon('circle', $this->translate('Check result is late'), array('class' => 'icon-stateful state-critical')) ?> + + + + + + + + translate('Next check') : $this->translate('Next update') ?> + + state !== 99) { + if ($activeChecksEnabled) { + echo $this->timeUntil($object->next_check); + } else { + echo sprintf($this->translate('expected %s'), $this->timeUntil($object->next_update)); + } + } ?> + hasPermission('monitoring/command/schedule-check')) { + if ($object->getType() === $object::TYPE_SERVICE) { + echo $this->qlink( + $this->translate('Reschedule'), + 'monitoring/service/reschedule-check', + array('host' => $object->getHost()->getName(), 'service' => $object->getName()), + array( + 'class' => 'action-link', + 'data-base-target' => '_self', + 'icon' => 'calendar-empty', + 'title' => $this->translate( + 'Schedule the next active check at a different time than the current one' + ) + ) + ); + } else { + echo $this->qlink( + $this->translate('Reschedule'), + 'monitoring/host/reschedule-check', + array('host' => $object->getName()), + array( + 'class' => 'action-link', + 'data-base-target' => '_self', + 'icon' => 'calendar-empty', + 'title' => $this->translate( + 'Schedule the next active check at a different time than the current one' + ) + ) + ); + } + } ?> + + + + + translate('Check attempts') ?> + + attempt ?> + (state_type === 0 ? $this->translate('soft state') : $this->translate('hard state') ?>) + + + +check_execution_time): ?> + + translate('Check execution time') ?> + check_execution_time, 3) ?>s + + + +check_latency): ?> + + translate('Check latency') ?> + check_latency ?>s + + diff --git a/modules/monitoring/application/views/scripts/show/components/checktimeperiod.phtml b/modules/monitoring/application/views/scripts/show/components/checktimeperiod.phtml new file mode 100644 index 0000000..34c4eb9 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/checktimeperiod.phtml @@ -0,0 +1,21 @@ +service_check_timeperiod)): ?> + + + translate('Check Timeperiod') ?> + + service_check_timeperiod ?> + + + + + +host_check_timeperiod)): ?> + + + translate('Check Timeperiod') ?> + + host_check_timeperiod ?> + + + + diff --git a/modules/monitoring/application/views/scripts/show/components/command.phtml b/modules/monitoring/application/views/scripts/show/components/command.phtml new file mode 100644 index 0000000..9b51458 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/command.phtml @@ -0,0 +1,52 @@ +check_command); +$command = array_shift($parts); + +if ($showInstance): ?> + + translate('Instance') ?> + escape($object->instance_name) ?> + + + + translate('Command') ?> + + escape($command) ?> + hasPermission('monitoring/command/process-check-result') && $object->passive_checks_enabled) { + $title = sprintf( + $this->translate('Submit a one time or so called passive result for the %s check'), $command + ); + if ($object->getType() === $object::TYPE_HOST) { + echo $this->qlink( + $this->translate('Process check result'), + 'monitoring/host/process-check-result', + array('host' => $object->getName()), + array( + 'class' => 'action-link', + 'data-base-target' => '_self', + 'icon' => 'edit', + 'title' => $title + ) + ); + } else { + echo $this->qlink( + $this->translate('Process check result'), + 'monitoring/service/process-check-result', + array('host' => $object->getHost()->getName(), 'service' => $object->getName()), + array( + 'class' => 'action-link', + 'data-base-target' => '_self', + 'icon' => 'edit', + 'title' => $title + ) + ); + } + } ?> + + + +\n %s\n %s\n\n"; +for ($i = 0; $i < count($parts); $i++) { + printf($row, '$ARG' . ($i + 1) . '$', $this->escape($parts[$i])); +} diff --git a/modules/monitoring/application/views/scripts/show/components/comments.phtml b/modules/monitoring/application/views/scripts/show/components/comments.phtml new file mode 100644 index 0000000..fd980ee --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/comments.phtml @@ -0,0 +1,86 @@ +hasPermission('monitoring/command/comment/add')) { + /** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */ + if ($object->getType() === $object::TYPE_HOST) { + $addLink = $this->qlink( + $this->translate('Add comment'), + 'monitoring/host/add-comment', + array('host' => $object->getName()), + array( + 'class' => 'action-link', + 'data-base-target' => '_self', + 'icon' => 'comment-empty', + 'title' => $this->translate('Add a new comment to this host') + ) + ); + } else { + $addLink = $this->qlink( + $this->translate('Add comment'), + 'monitoring/service/add-comment', + array('host' => $object->getHost()->getName(), 'service' => $object->getName()), + array( + 'class' => 'action-link', + 'data-base-target' => '_self', + 'icon' => 'comment-empty', + 'title' => $this->translate('Add a new comment to this service') + ) + ); + } +} +if (empty($object->comments) && ! $addLink) { + return; +} +?> + + translate('Comments'); + if (! empty($object->comments) && $addLink) { + echo '
' . $addLink; + } + ?> + + comments)): + echo $addLink; + else: ?> +
+ comments as $comment): ?> +
+ + escape($comment->author) ?> + + translate('commented') ?> + timeAgo($comment->timestamp) ?> + expiration): ?> + + translate('Expires %s'), + $this->timeUntil($comment->expiration) + ) ?> + + + + persistent ? $this->icon('attach', 'This comment is persistent.') : '' ?> + setAttrib('class', $deleteButton->getAttrib('class') . ' remove-action'); + $deleteButton->populate( + array( + 'comment_id' => $comment->id, + 'comment_is_service' => isset($comment->service_description), + 'comment_name' => $comment->name + ) + ); + echo $deleteButton; + } ?> +
+
+ nl2br($this->createTicketLinks($this->markdownLine($comment->comment, [ 'class' => 'caption']))) ?> +
+ +
+ + + diff --git a/modules/monitoring/application/views/scripts/show/components/contacts.phtml b/modules/monitoring/application/views/scripts/show/components/contacts.phtml new file mode 100644 index 0000000..5661c1a --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/contacts.phtml @@ -0,0 +1,38 @@ +contacts->hasResult()) { + + $list = array(); + foreach ($object->contacts as $contact) { + $list[] = $this->qlink( + $contact->contact_alias, + 'monitoring/show/contact', + array('contact_name' => $contact->contact_name), + array('title' => sprintf($this->translate('Show detailed information about %s'), $contact->contact_alias)) + ); + } + + printf( + "%s%s\n", + $this->translate('Contacts'), + implode(', ', $list) + ); +} + +if ($object->contactgroups->hasResult()) { + $list = array(); + foreach ($object->contactgroups as $contactgroup) { + $list[] = $this->qlink( + $contactgroup->contactgroup_alias, + 'monitoring/list/contactgroups', + array('contactgroup_name' => $contactgroup->contactgroup_name), + array('title' => sprintf($this->translate('List contacts in contact-group "%s"'), $contactgroup->contactgroup_alias)) + ); + } + + printf( + "%s%s\n", + $this->translate('Contactgroups'), + implode(', ', $list) + ); +} diff --git a/modules/monitoring/application/views/scripts/show/components/downtime.phtml b/modules/monitoring/application/views/scripts/show/components/downtime.phtml new file mode 100644 index 0000000..618d4d9 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/downtime.phtml @@ -0,0 +1,109 @@ +hasPermission('monitoring/command/downtime/schedule')) { + /** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */ + if ($object->getType() === $object::TYPE_HOST) { + $addLink = $this->qlink( + $this->translate('Schedule downtime'), + 'monitoring/host/schedule-downtime', + array('host' => $object->getName()), + array( + 'class' => 'action-link', + 'data-base-target' => '_self', + 'icon' => 'plug', + 'title' => $this->translate( + 'Schedule a downtime to suppress all problem notifications within a specific period of time' + ) + ) + ); + } else { + $addLink = $this->qlink( + $this->translate('Schedule downtime'), + 'monitoring/service/schedule-downtime', + array('host' => $object->getHost()->getName(), 'service' => $object->getName()), + array( + 'class' => 'action-link', + 'data-base-target' => '_self', + 'icon' => 'plug', + 'title' => $this->translate( + 'Schedule a downtime to suppress all problem notifications within a specific period of time' + ) + ) + ); + } +} +if (empty($object->downtimes) && ! $addLink) { + return; +} +?> + + translate('Downtimes'); + if (! empty($object->downtimes) && $addLink) { + echo '
' . $addLink; + } + ?> + + downtimes)): + echo $addLink; + else: ?> +
+ downtimes as $downtime): + if ((bool) $downtime->is_in_effect) { + $state = sprintf( + $this->translate('expires %s', 'Last format parameter represents the downtime expire time'), + $this->timeUntil($downtime->end, false, true) + ); + } else { + if ($downtime->start <= time()) { + $state = sprintf( + $this->translate('ends %s', 'Last format parameter represents the end time'), + $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, false, true) + ); + } else { + $state = sprintf( + $this->translate('scheduled %s', 'Last format parameter represents the time scheduled'), + $this->timeUntil($downtime->start, false, true) + ) . ' ' . sprintf( + $this->translate('expires %s', 'Last format parameter represents the downtime expire time'), + $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, false, true) + ); + } + } + ?> +
+ escape(sprintf( + $downtime->is_flexible + ? $this->translate('Flexible downtime by %s') + : $this->translate('Fixed downtime by %s'), + $downtime->author_name + )) ?> + + + + translate('created') ?> + timeAgo($downtime->entry_time) ?> + + setAttrib('class', $deleteButton->getAttrib('class') . ' remove-action'); + $deleteButton->populate( + array( + 'downtime_id' => $downtime->id, + 'downtime_is_service' => $object->getType() === $object::TYPE_SERVICE, + 'downtime_name' => $downtime->name + ) + ); + echo $deleteButton; + } ?> +
+
+ nl2br($this->createTicketLinks($this->markdown($downtime->comment))) ?> +
+ +
+ + + diff --git a/modules/monitoring/application/views/scripts/show/components/extensions.phtml b/modules/monitoring/application/views/scripts/show/components/extensions.phtml new file mode 100644 index 0000000..263b7e4 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/extensions.phtml @@ -0,0 +1,4 @@ + +

translate('Feature Commands') ?>

+ + diff --git a/modules/monitoring/application/views/scripts/show/components/flapping.phtml b/modules/monitoring/application/views/scripts/show/components/flapping.phtml new file mode 100644 index 0000000..f09b107 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/flapping.phtml @@ -0,0 +1,14 @@ +is_flapping) { + printf( + "%s%s %s\n", + 'Flapping', + $this->icon('flapping', 'Flapping'), + sprintf( + 'Currently flapping with a %.2f%% state change rate', + $object->percent_state_change + ) + ); +} + diff --git a/modules/monitoring/application/views/scripts/show/components/grapher.phtml b/modules/monitoring/application/views/scripts/show/components/grapher.phtml new file mode 100644 index 0000000..0b49e63 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/grapher.phtml @@ -0,0 +1,6 @@ +getPreviewHtml($object); + } +} ?> + diff --git a/modules/monitoring/application/views/scripts/show/components/hostgroups.phtml b/modules/monitoring/application/views/scripts/show/components/hostgroups.phtml new file mode 100644 index 0000000..377b56f --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/hostgroups.phtml @@ -0,0 +1,19 @@ +hostgroups)) return; + +$list = array(); +foreach ($object->hostgroups as $name => $alias) { + $list[] = $this->qlink( + $alias, + 'monitoring/list/hosts', + array('hostgroup_name' => $name), + array('title' => sprintf($this->translate('List all hosts in the group "%s"'), $alias)) + ); +} +printf( + "%s%s\n", + $this->translate('Hostgroups'), + implode(', ', $list) +); + diff --git a/modules/monitoring/application/views/scripts/show/components/notes.phtml b/modules/monitoring/application/views/scripts/show/components/notes.phtml new file mode 100644 index 0000000..c868c95 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/notes.phtml @@ -0,0 +1,48 @@ +notes); + +$links = $object->getNotesUrls(); +if (! empty($links)) { + foreach ($links as $link) { + $navigation->addItem( + // add warning to links that open in new tabs to improve accessibility, as recommended by WCAG20 G201 + $this->icon( + 'forward', + $this->translate('Link opens in new window'), + array('aria-label' => $this->translate('Link opens in new window')) + ) . ' ' . $this->escape($link), + array( + 'url' => $link, + 'target' => '_blank', + 'renderer' => array( + 'NavigationItemRenderer', + 'escape_label' => false + ) + ) + ); + } +} + +if (($navigation->isEmpty() || ! $navigation->hasRenderableItems()) && $notes === '') { + return; +} +?> + + translate('Notes') ?> + + getRenderer() ?> + + markdown($notes, [ + 'id' => $object->type . '-notes', + 'class' => 'collapsible', + 'data-visible-height' => 200 + ]) ?> + + + \ No newline at end of file diff --git a/modules/monitoring/application/views/scripts/show/components/notifications.phtml b/modules/monitoring/application/views/scripts/show/components/notifications.phtml new file mode 100644 index 0000000..3e8c665 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/notifications.phtml @@ -0,0 +1,68 @@ + + translate('Notifications') ?> + + hasPermission('monitoring/command/send-custom-notification')) { + if ($object->getType() === $object::TYPE_HOST) { + /** @var \Icinga\Module\Monitoring\Object\Host $object */ + echo $this->qlink( + $this->translate('Send notification'), + 'monitoring/host/send-custom-notification', + array('host' => $object->getName()), + array( + 'class' => 'action-link', + 'data-base-target' => '_self', + 'icon' => 'bell', + 'title' => $this->translate( + 'Send a custom notification to contacts responsible for this host' + ) + ) + ); + } else { + /** @var \Icinga\Module\Monitoring\Object\Service $object */ + echo $this->qlink( + $this->translate('Send notification'), + 'monitoring/service/send-custom-notification', + array('host' => $object->getHost()->getName(), 'service' => $object->getName()), + array( + 'class' => 'action-link', + 'data-base-target' => '_self', + 'icon' => 'bell', + 'title' => $this->translate( + 'Send a custom notification to contacts responsible for this service' + ) + ) + ); + } + if (! in_array((int) $object->state, array(0, 99))) { + echo '
'; + } + } elseif (in_array((int) $object->state, array(0, 99))) { + echo '-'; + } + // We are not interested in notifications for OK or pending objects + if (! in_array((int) $object->state, array(0, 99))) { + if ($object->current_notification_number > 0) { + if ((int) $object->current_notification_number === 1) { + $msg = sprintf( + $this->translate('A notification has been sent for this issue %s.'), + $this->timeAgo($object->last_notification) + ); + } else { + $msg = sprintf( + $this->translate('%d notifications have been sent for this issue.'), + $object->current_notification_number + ) . '
' . sprintf( + $this->translate('The last one was sent %s.'), + $this->timeAgo($object->last_notification) + ); + } + } else { + $msg = $this->translate('No notification has been sent for this issue.'); + } + echo $msg; + } + ?> + + diff --git a/modules/monitoring/application/views/scripts/show/components/output.phtml b/modules/monitoring/application/views/scripts/show/components/output.phtml new file mode 100644 index 0000000..34d8268 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/output.phtml @@ -0,0 +1,5 @@ +

translate('Plugin Output') ?>

+
+ pluginOutput($object->output, false, $object->check_command) ?> + pluginOutput($object->long_output, false, $object->check_command) ?> +
diff --git a/modules/monitoring/application/views/scripts/show/components/perfdata.phtml b/modules/monitoring/application/views/scripts/show/components/perfdata.phtml new file mode 100644 index 0000000..78ea6d2 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/perfdata.phtml @@ -0,0 +1,4 @@ +perfdata): ?> +

translate('Performance data') ?>

+
perfdata($object->perfdata) ?>
+ diff --git a/modules/monitoring/application/views/scripts/show/components/reachable.phtml b/modules/monitoring/application/views/scripts/show/components/reachable.phtml new file mode 100644 index 0000000..8d55e84 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/reachable.phtml @@ -0,0 +1,15 @@ +is_reachable !== null): ?> + + + translate('Reachable') ?> + + + is_reachable ? $this->translate('yes') : $this->translate('no') ?> + is_reachable) { + echo $this->icon('circle', $this->translate('Is reachable'), array('class' => 'icon-stateful state-ok')); + } else { + echo $this->icon('circle', $this->translate('Not reachable'), array('class' => 'icon-stateful state-critical')); + } ?> + + + diff --git a/modules/monitoring/application/views/scripts/show/components/servicegroups.phtml b/modules/monitoring/application/views/scripts/show/components/servicegroups.phtml new file mode 100644 index 0000000..09ff248 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/servicegroups.phtml @@ -0,0 +1,20 @@ +servicegroups)) return; + +$list = array(); +foreach ($object->servicegroups as $name => $alias) { + $list[] = $this->qlink( + $alias, + 'monitoring/list/services', + array('servicegroup_name' => $name), + array('title' => sprintf($this->translate('List all services in the group "%s"'), $alias)) + ); +} + +printf( + "%s%s\n", + $this->translate('Servicegroups'), + implode(', ', $list) +); + diff --git a/modules/monitoring/application/views/scripts/show/components/status.phtml b/modules/monitoring/application/views/scripts/show/components/status.phtml new file mode 100644 index 0000000..e69de29 diff --git a/modules/monitoring/application/views/scripts/show/contact.phtml b/modules/monitoring/application/views/scripts/show/contact.phtml new file mode 100644 index 0000000..b0fce72 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/contact.phtml @@ -0,0 +1,67 @@ +getHelper('ContactFlags') ?> +
+ compact): ?> + tabs; ?> + +

translate('Contact details') ?>

+ + + translate('No such contact') ?>: +
+ + + + + + + + +contact_email): ?> + + + + + +contact_pager): ?> + + + + + + + + + + + + + + +
escape($contact->contact_alias) ?> (contact_name ?>)
translate('Email') ?> + + escape($contact->contact_email); ?> + +
translate('Pager') ?>escape($contact->contact_pager) ?>
translate('Hosts') ?>escape($contactHelper->contactFlags($contact, 'host')) ?>
+ escape($contact->contact_notify_host_timeperiod) ?>
translate('Services') ?>escape($contactHelper->contactFlags($contact, 'service')) ?>
+ escape($contact->contact_notify_service_timeperiod) ?>
+ +

translate('Commands') ?>:

+ + +

translate('Notifications sent to this contact') ?>

+ limiter; ?> + paginator; ?> + + + +partial('list/notifications.phtml', array( + 'notifications' => $notifications, + 'compact' => true +)); ?> + +
translate('No notifications have been sent for this contact') ?>
+ 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 0000000..e6dc0be --- /dev/null +++ b/modules/monitoring/application/views/scripts/tactical/components/hostservicechecks.phtml @@ -0,0 +1,131 @@ +
+
+

translate('Host and Service Checks'); ?>

+
+
+ + + + + + + + + + + + + +
translate('Hosts'); ?>translate('Services'); ?>
+statusSummary->hosts_active): ?> +
qlink( + sprintf( + $this->translatePlural('%u Active', '%u Active', $this->statusSummary->hosts_active), + $this->statusSummary->hosts_active + ), + 'monitoring/list/hosts', + array('host_active_checks_enabled' => 1), + array('title' => sprintf( + $this->translatePlural( + 'List %u actively checked host', + 'List %u actively checked hosts', + $this->statusSummary->hosts_active + ), + $this->statusSummary->hosts_active + )) + ); ?>
+ +statusSummary->hosts_passive): ?> +
qlink( + sprintf( + $this->translatePlural('%d Passive', '%d Passive', $this->statusSummary->hosts_passive), + $this->statusSummary->hosts_passive + ), + 'monitoring/list/hosts', + array('host_active_checks_enabled' => 0, 'host_passive_checks_enabled' => 1), + array('title' => sprintf( + $this->translatePlural( + 'List %u passively checked host', + 'List %u passively checked hosts', + $this->statusSummary->hosts_passive + ), + $this->statusSummary->hosts_passive + )) + ); ?>
+ +statusSummary->hosts_not_checked): ?> +
qlink( + sprintf( + $this->translatePlural('%d Disabled', '%d Disabled', $this->statusSummary->hosts_not_checked), + $this->statusSummary->hosts_not_checked + ), + 'monitoring/list/hosts', + array('host_active_checks_enabled' => 0, 'host_passive_checks_enabled' => 0), + array('title' => sprintf( + $this->translatePlural( + 'List %u host that is not being checked at all', + 'List %u hosts which are not being checked at all', + $this->statusSummary->hosts_not_checked + ), + $this->statusSummary->hosts_not_checked + )) + ); ?>
+ +
+statusSummary->services_active): ?> +
qlink( + sprintf( + $this->translatePlural('%d Active', '%d Active', $this->statusSummary->services_active), + $this->statusSummary->services_active + ), + 'monitoring/list/services', + array('service_active_checks_enabled' => 1), + array('title' => sprintf( + $this->translatePlural( + 'List %u actively checked service', + 'List %u actively checked services', + $this->statusSummary->services_active + ), + $this->statusSummary->services_active + )) + ); ?>
+ +statusSummary->services_passive): ?> +
qlink( + sprintf( + $this->translatePlural('%d Passive', '%d Passive', $this->statusSummary->services_passive), + $this->statusSummary->services_passive + ), + 'monitoring/list/services', + array('service_active_checks_enabled' => 0, 'service_passive_checks_enabled' => 1), + array('title' => sprintf( + $this->translatePlural( + 'List %u passively checked service', + 'List %u passively checked services', + $this->statusSummary->services_passive + ), + $this->statusSummary->services_passive + )) + ); ?>
+ +statusSummary->services_not_checked): ?> +
qlink( + sprintf( + $this->translatePlural('%d Disabled', '%d Disabled', $this->statusSummary->services_not_checked), + $this->statusSummary->services_not_checked + ), + 'monitoring/list/services', + array('service_active_checks_enabled' => 0, 'service_passive_checks_enabled' => 0), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is not being checked at all', + 'List %u services which are not being checked at all', + $this->statusSummary->services_not_checked + ), + $this->statusSummary->services_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 0000000..eeeec16 --- /dev/null +++ b/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml @@ -0,0 +1,287 @@ +
+
+

translate('Monitoring Features'); ?>

+
+
+statusSummary->hosts_without_flap_detection || $this->statusSummary->services_without_flap_detection || + $this->statusSummary->hosts_flapping || $this->statusSummary->services_flapping): ?> +
translate('Flap Detection'); ?>
+ +
translate('Flap Detection'); ?>
+ + + + + + + + +
+
+statusSummary->hosts_without_flap_detection): ?> + qlink( + sprintf( + $this->translatePlural('%u Host Disabled', '%u Hosts Disabled', $this->statusSummary->hosts_without_flap_detection), + $this->statusSummary->hosts_without_flap_detection + ), + 'monitoring/list/hosts', + array('host_flap_detection_enabled' => 0), + array( + 'class' => 'feature-highlight', + 'title' => sprintf( + $this->translatePlural( + 'List %u host for which flap detection has been disabled', + 'List %u hosts for which flap detection has been disabled', + $this->statusSummary->hosts_without_flap_detection + ), + $this->statusSummary->hosts_without_flap_detection + ) + ) + ); ?> + + qlink( + $this->translate('All Hosts Enabled'), + 'monitoring/list/hosts', + array('host_flap_detection_enabled' => 1), + array('title' => $this->translate( + 'List all hosts, for which flap detection is enabled entirely' + )) + ); ?> + +statusSummary->hosts_flapping): ?> + qlink( + sprintf( + $this->translatePlural('%u Host Flapping', '%u Hosts Flapping', $this->statusSummary->hosts_flapping), + $this->statusSummary->hosts_flapping + ), + 'monitoring/list/hosts', + array('host_is_flapping' => 1), + array( + 'class' => 'feature-highlight', + 'title' => sprintf( + $this->translatePlural( + 'List %u host that is currently flapping', + 'List %u hosts which are currently flapping', + $this->statusSummary->hosts_flapping + ), + $this->statusSummary->hosts_flapping + ) + ) + ); ?> + +
+
+
+statusSummary->services_without_flap_detection): ?> + qlink( + sprintf( + $this->translatePlural('%u Service Disabled', '%u Services Disabled', $this->statusSummary->services_without_flap_detection), + $this->statusSummary->services_without_flap_detection + ), + 'monitoring/list/services', + array('service_flap_detection_enabled' => 0), + array( + 'class' => 'feature-highlight', + 'title' => sprintf( + $this->translatePlural( + 'List %u service for which flap detection has been disabled', + 'List %u services for which flap detection has been disabled', + $this->statusSummary->services_without_flap_detection + ), + $this->statusSummary->services_without_flap_detection + ) + ) + ); ?> + + qlink( + $this->translate('All Services Enabled'), + 'monitoring/list/services', + array('service_flap_detection_enabled' => 1), + array('title' => $this->translate( + 'List all services, for which flap detection is enabled entirely' + )) + ); ?> + +statusSummary->services_flapping): ?> + qlink( + sprintf( + $this->translatePlural('%u Service Flapping', '%u Services Flapping', $this->statusSummary->services_flapping), + $this->statusSummary->services_flapping + ), + 'monitoring/list/services', + array('service_is_flapping' => 1), + array( + 'class' => 'feature-highlight', + 'title' => sprintf( + $this->translatePlural( + 'List %u service that is currently flapping', + 'List %u services which are currently flapping', + $this->statusSummary->services_flapping + ), + $this->statusSummary->services_flapping + ) + ) + ); ?> + +
+
+statusSummary->hosts_not_triggering_notifications || $this->statusSummary->services_not_triggering_notifications): ?> +
translate('Notifications'); ?>
+ +
translate('Notifications'); ?>
+ + + + + + + + +
+
+statusSummary->hosts_not_triggering_notifications): ?> + qlink( + sprintf( + $this->translatePlural('%u Host Disabled', '%u Hosts Disabled', $this->statusSummary->hosts_not_triggering_notifications), + $this->statusSummary->hosts_not_triggering_notifications + ), + 'monitoring/list/hosts', + array('host_notifications_enabled' => 0), + array( + 'class' => 'feature-highlight', + 'title' => sprintf( + $this->translatePlural( + 'List %u host for which notifications are suppressed', + 'List %u hosts for which notifications are suppressed', + $this->statusSummary->hosts_not_triggering_notifications + ), + $this->statusSummary->hosts_not_triggering_notifications + ) + ) + ); ?> + + qlink( + $this->translate('All Hosts Enabled'), + 'monitoring/list/hosts', + array('host_notifications_enabled' => 1), + array('title' => $this->translate( + 'List all hosts, for which notifications are enabled entirely' + )) + ); ?> + +
+
+
+statusSummary->services_not_triggering_notifications): ?> + qlink( + sprintf( + $this->translatePlural('%u Service Disabled', '%u Services Disabled', $this->statusSummary->services_not_triggering_notifications), + $this->statusSummary->services_not_triggering_notifications + ), + 'monitoring/list/services', + array('service_notifications_enabled' => 0), + array( + 'class' => 'feature-highlight', + 'title' => sprintf( + $this->translatePlural( + 'List %u service for which notifications are suppressed', + 'List %u services for which notifications are suppressed', + $this->statusSummary->services_not_triggering_notifications + ), + $this->statusSummary->services_not_triggering_notifications + ) + ) + ); ?> + + qlink( + $this->translate('All Services Enabled'), + 'monitoring/list/services', + array('service_notifications_enabled' => 1), + array('title' => $this->translate( + 'List all services, for which notifications are enabled entirely' + )) + ); ?> + +
+
+statusSummary->hosts_not_processing_event_handlers || $this->statusSummary->services_not_processing_event_handlers): ?> +
translate('Event Handlers'); ?>
+ +
translate('Event Handlers'); ?>
+ + + + + + + + +
+
+statusSummary->hosts_not_processing_event_handlers): ?> + qlink( + sprintf( + $this->translatePlural('%u Host Disabled', '%u Hosts Disabled', $this->statusSummary->hosts_not_processing_event_handlers), + $this->statusSummary->hosts_not_processing_event_handlers + ), + 'monitoring/list/hosts', + array('host_event_handler_enabled' => 0), + array( + 'class' => 'feature-highlight', + 'title' => sprintf( + $this->translatePlural( + 'List %u host that is not processing any event handlers', + 'List %u hosts which are not processing any event handlers', + $this->statusSummary->hosts_not_processing_event_handlers + ), + $this->statusSummary->hosts_not_processing_event_handlers + ) + ) + ); ?> + + qlink( + $this->translate('All Hosts Enabled'), + 'monitoring/list/hosts', + array('host_event_handler_enabled' => 1), + array('title' => $this->translate( + 'List all hosts, which are processing event handlers entirely' + )) + ); ?> + +
+
+
+statusSummary->services_not_processing_event_handlers): ?> + qlink( + sprintf( + $this->translatePlural('%u Service Disabled', '%u Services Disabled', $this->statusSummary->services_not_processing_event_handlers), + $this->statusSummary->services_not_processing_event_handlers + ), + 'monitoring/list/services', + array('service_event_handler_enabled' => 0), + array( + 'class' => 'feature-highlight', + 'title' => sprintf( + $this->translatePlural( + 'List %u service that is not processing any event handlers', + 'List %u services which are not processing any event handlers', + $this->statusSummary->services_not_processing_event_handlers + ), + $this->statusSummary->services_not_processing_event_handlers + ) + ) + ); ?> + + qlink( + $this->translate('All Services Enabled'), + 'monitoring/list/services', + array('service_event_handler_enabled' => 1), + array('title' => $this->translate( + 'List all services, which are processing event handlers entirely' + )) + ); ?> + +
+
+
+
diff --git a/modules/monitoring/application/views/scripts/tactical/components/ok_hosts.phtml b/modules/monitoring/application/views/scripts/tactical/components/ok_hosts.phtml new file mode 100644 index 0000000..05ffd29 --- /dev/null +++ b/modules/monitoring/application/views/scripts/tactical/components/ok_hosts.phtml @@ -0,0 +1,81 @@ +statusSummary->services_warning_handled_on_ok_hosts || + $this->statusSummary->services_warning_unhandled_on_ok_hosts || + $this->statusSummary->services_critical_handled_on_ok_hosts || + $this->statusSummary->services_critical_unhandled_on_ok_hosts || + $this->statusSummary->services_unknown_handled_on_ok_hosts || + $this->statusSummary->services_unknown_unhandled_on_ok_hosts +); +?> +
+
+ statusSummary->hosts_up): ?> +

qlink( + sprintf( + $this->translatePlural('%u Host UP', '%u Hosts UP', $this->statusSummary->hosts_up), + $this->statusSummary->hosts_up + ), + 'monitoring/list/hosts', + array('host_state' => 0), + array('title' => sprintf( + $this->translatePlural( + 'List %u host that is currently in state UP', + 'List %u hosts which are currently in state UP', + $this->statusSummary->hosts_up + ), + $this->statusSummary->hosts_up + )) + ); ?>

+ + statusSummary->hosts_pending): ?> +

qlink( + sprintf( + $this->translatePlural('%u Host PENDING', '%u Hosts PENDING', $this->statusSummary->hosts_pending), + $this->statusSummary->hosts_pending + ), + 'monitoring/list/hosts', + array('host_state' => 99), + array('title' => sprintf( + $this->translatePlural( + 'List %u host that is currently in state PENDING', + 'List %u hosts which are currently in state PENDING', + $this->statusSummary->hosts_pending + ), + $this->statusSummary->hosts_pending + )) + ); ?>

+ +
+statusSummary->hosts_down || $this->statusSummary->hosts_unreachable): ?> +
+ partial( + 'tactical/components/parts/servicestatesummarybyhoststate.phtml', + array( + 'translationDomain' => $this->translationDomain, + 'host_problem' => 0, + 'services_ok' => $this->statusSummary->services_ok_on_ok_hosts, + 'services_ok_not_checked' => $this->statusSummary->services_ok_not_checked_on_ok_hosts, + 'services_pending' => $this->statusSummary->services_pending_on_ok_hosts, + 'services_pending_not_checked' => $this->statusSummary->services_pending_not_checked_on_ok_hosts, + 'services_warning_handled' => $this->statusSummary->services_warning_handled_on_ok_hosts, + 'services_warning_unhandled' => $this->statusSummary->services_warning_unhandled_on_ok_hosts, + 'services_warning_passive' => $this->statusSummary->services_warning_passive_on_ok_hosts, + 'services_warning_not_checked' => $this->statusSummary->services_warning_not_checked_on_ok_hosts, + 'services_critical_handled' => $this->statusSummary->services_critical_handled_on_ok_hosts, + 'services_critical_unhandled' => $this->statusSummary->services_critical_unhandled_on_ok_hosts, + 'services_critical_passive' => $this->statusSummary->services_critical_passive_on_ok_hosts, + 'services_critical_not_checked' => $this->statusSummary->services_critical_not_checked_on_ok_hosts, + 'services_unknown_handled' => $this->statusSummary->services_unknown_handled_on_ok_hosts, + 'services_unknown_unhandled' => $this->statusSummary->services_unknown_unhandled_on_ok_hosts, + 'services_unknown_passive' => $this->statusSummary->services_unknown_passive_on_ok_hosts, + 'services_unknown_not_checked' => $this->statusSummary->services_unknown_not_checked_on_ok_hosts + ) + ); ?> + +
+

0

+ translate('Service Problems'); ?> + +
+
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 0000000..4f32daf --- /dev/null +++ b/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml @@ -0,0 +1,394 @@ + + +
+ + qlink( + $services_critical_unhandled . ' ' . Service::getStateText(2, true), + 'monitoring/list/services', + array( + 'host_problem' => $host_problem, + 'service_state' => 2, + 'service_acknowledged' => 0, + 'service_in_downtime' => 0 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state CRITICAL', + 'List %u services which are currently in state CRITICAL', + $services_critical_unhandled + ), + $services_critical_unhandled + )) + ); ?> + + + qlink( + $services_critical_handled . ' ' . ( + $services_critical_unhandled ? $this->translate('Handled') : Service::getStateText(2, true) + ), + 'monitoring/list/services', + array( + 'host_problem' => $host_problem, + 'service_state' => 2, + 'service_handled' => 1 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state CRITICAL (Handled)', + 'List %u services which are currently in state CRITICAL (Handled)', + $services_critical_handled + ), + $services_critical_handled + )) + ); ?> + + + qlink( + sprintf( + $this->translatePlural( + '%u is passively checked', + '%u are passively checked', + $services_critical_passive + ), + $services_critical_passive + ), + 'monitoring/list/services', + array( + 'service_state' => 2, + 'host_problem' => $host_problem, + 'service_active_checks_enabled' => 0, + 'service_passive_checks_enabled' => 1 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state CRITICAL and passively checked', + 'List %u services which are currently in state CRITICAL and passively checked', + $services_critical_passive + ), + $services_critical_passive + )) + ); ?> + + + qlink( + sprintf( + $this->translatePlural( + '%u is not checked at all', + '%u are not checked at all', + $services_critical_not_checked + ), + $services_critical_not_checked + ), + 'monitoring/list/services', + array( + 'service_state' => 2, + 'host_problem' => $host_problem, + 'service_active_checks_enabled' => 0, + 'service_passive_checks_enabled' => 0 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state CRITICAL and not checked at all', + 'List %u services which are currently in state CRITICAL and not checked at all', + $services_critical_not_checked + ), + $services_critical_not_checked + )) + ); ?> + +
+ + +
+ + qlink( + $services_warning_unhandled . ' ' . Service::getStateText(1, true), + 'monitoring/list/services', + array( + 'host_problem' => $host_problem, + 'service_state' => 1, + 'service_acknowledged' => 0, + 'service_in_downtime' => 0 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state WARNING', + 'List %u services which are currently in state WARNING', + $services_warning_unhandled + ), + $services_warning_unhandled + )) + ); ?> + + + qlink( + $services_warning_handled . ' ' . ( + $services_warning_unhandled ? $this->translate('Handled') : Service::getStateText(1, true) + ), + 'monitoring/list/services', + array( + 'host_problem' => $host_problem, + 'service_state' => 1, + 'service_handled' => 1 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state WARNING (Handled)', + 'List %u services which are currently in state WARNING (Handled)', + $services_warning_handled + ), + $services_warning_handled + )) + ); ?> + + + qlink( + sprintf( + $this->translatePlural( + '%u is passively checked', + '%u are passively checked', + $services_warning_passive + ), + $services_warning_passive + ), + 'monitoring/list/services', + array( + 'service_state' => 1, + 'host_problem' => $host_problem, + 'service_active_checks_enabled' => 0, + 'service_passive_checks_enabled' => 1 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state WARNING and passively checked', + 'List %u services which are currently in state WARNING and passively checked', + $services_warning_passive + ), + $services_warning_passive + )) + ); ?> + + + qlink( + sprintf( + $this->translatePlural( + '%u is not checked at all', + '%u are not checked at all', + $services_warning_not_checked + ), + $services_warning_not_checked + ), + 'monitoring/list/services', + array( + 'service_state' => 1, + 'host_problem' => $host_problem, + 'service_active_checks_enabled' => 0, + 'service_passive_checks_enabled' => 0 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state WARNING and not checked at all', + 'List %u services which are currently in state WARNING and not checked at all', + $services_warning_not_checked + ), + $services_warning_not_checked + )) + ); ?> + +
+ + +
+ + qlink( + $services_unknown_unhandled . ' ' . Service::getStateText(3, true), + 'monitoring/list/services', + array( + 'host_problem' => $host_problem, + 'service_state' => 3, + 'service_acknowledged' => 0, + 'service_in_downtime' => 0 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state UNKNOWN', + 'List %u services which are currently in state UNKNOWN', + $services_unknown_unhandled + ), + $services_unknown_unhandled + )) + ); ?> + + + qlink( + $services_unknown_handled . ' ' . ( + $services_unknown_unhandled ? $this->translate('Handled') : Service::getStateText(3, true) + ), + 'monitoring/list/services', + array( + 'host_problem' => $host_problem, + 'service_state' => 3, + 'service_handled' => 1 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state UNKNOWN (Handled)', + 'List %u services which are currently in state UNKNOWN (Handled)', + $services_unknown_handled + ), + $services_unknown_handled + )) + ); ?> + + + qlink( + sprintf( + $this->translatePlural( + '%u is passively checked', + '%u are passively checked', + $services_unknown_passive + ), + $services_unknown_passive + ), + 'monitoring/list/services', + array( + 'service_state' => 3, + 'host_problem' => $host_problem, + 'service_active_checks_enabled' => 0, + 'service_passive_checks_enabled' => 1 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state UNKNOWN and passively checked', + 'List %u services which are currently in state UNKNOWN and passively checked', + $services_unknown_passive + ), + $services_unknown_passive + )) + ); ?> + + + qlink( + sprintf( + $this->translatePlural( + '%u is not checked at all', + '%u are not checked at all', + $services_unknown_not_checked + ), + $services_unknown_not_checked + ), + 'monitoring/list/services', + array( + 'service_state' => 3, + 'host_problem' => $host_problem, + 'service_active_checks_enabled' => 0, + 'service_passive_checks_enabled' => 0 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state UNKNOWN and not checked at all', + 'List %u services which are currently in state UNKNOWN and not checked at all', + $services_unknown_not_checked + ), + $services_unknown_not_checked + )) + ); ?> + +
+ + +
+ qlink( + $services_ok . ' ' . Service::getStateText(0, true), + 'monitoring/list/services', + array( + 'host_problem' => $host_problem, + 'service_state' => 0 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state OK', + 'List %u services which are currently in state OK', + $services_ok + ), + $services_ok + )) + ); ?> + + qlink( + sprintf( + $this->translatePlural( + '%u is not checked at all', + '%u are not checked at all', + $services_ok_not_checked + ), + $services_ok_not_checked + ), + 'monitoring/list/services', + array( + 'service_state' => 0, + 'host_problem' => $host_problem, + 'service_active_checks_enabled' => 0, + 'service_passive_checks_enabled' => 0 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state OK and not checked at all', + 'List %u services which are currently in state OK and not checked at all', + $services_ok_not_checked + ), + $services_ok_not_checked + )) + ); ?> + +
+ + +
+ qlink( + $services_pending . ' ' . Service::getStateText(99, true), + 'monitoring/list/services', + array( + 'service_state' => 99 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state PENDING', + 'List %u services which are currently in state PENDING', + $services_pending + ), + $services_pending + )) + ); ?> + + qlink( + sprintf( + $this->translatePlural( + '%u is not checked at all', + '%u are not checked at all', + $services_pending_not_checked + ), + $services_pending_not_checked + ), + 'monitoring/list/services', + array( + 'service_state' => 99, + 'service_active_checks_enabled' => 0, + 'service_passive_checks_enabled' => 0 + ), + array('title' => sprintf( + $this->translatePlural( + 'List %u service that is currently in state PENDING and not checked at all', + 'List %u services which are currently in state PENDING and not checked at all', + $services_pending_not_checked + ), + $services_pending_not_checked + )) + ); ?> + +
+ diff --git a/modules/monitoring/application/views/scripts/tactical/components/problem_hosts.phtml b/modules/monitoring/application/views/scripts/tactical/components/problem_hosts.phtml new file mode 100644 index 0000000..6374ff8 --- /dev/null +++ b/modules/monitoring/application/views/scripts/tactical/components/problem_hosts.phtml @@ -0,0 +1,74 @@ +
+
+ statusSummary->hosts_down): ?> +

qlink( + sprintf( + $this->translatePlural('%u Host DOWN', '%u Hosts DOWN', $this->statusSummary->hosts_down), + $this->statusSummary->hosts_down + ), + 'monitoring/list/hosts', + array('host_state' => 1), + array('title' => sprintf( + $this->translatePlural( + 'List %u host that is currently in state DOWN', + 'List %u hosts which are currently in state DOWN', + $this->statusSummary->hosts_down + ), + $this->statusSummary->hosts_down + )) + ); ?>

+ + statusSummary->hosts_unreachable): ?> +

qlink( + sprintf( + $this->translatePlural( + '%u Host UNREACHABLE', + '%u Hosts UNREACHABLE', + $this->statusSummary->hosts_unreachable + ), + $this->statusSummary->hosts_unreachable + ), + 'monitoring/list/hosts', + array('host_state' => 2), + array('title' => sprintf( + $this->translatePlural( + 'List %u host that is currently in state UNREACHABLE', + 'List %u hosts which are currently in state UNREACHABLE', + $this->statusSummary->hosts_unreachable + ), + $this->statusSummary->hosts_unreachable + )) + ); ?>

+ +
+
+ partial( + 'tactical/components/parts/servicestatesummarybyhoststate.phtml', + array( + 'translationDomain' => $this->translationDomain, + 'host_problem' => 1, + 'services_ok' => $this->statusSummary->services_ok_on_problem_hosts, + 'services_ok_not_checked' => $this->statusSummary->services_ok_not_checked_on_problem_hosts, + 'services_pending' => $this->statusSummary->services_pending_on_problem_hosts, + 'services_pending_not_checked' => $this->statusSummary->services_pending_not_checked_on_problem_hosts, + 'services_warning_handled' => $this->statusSummary->services_warning_handled_on_problem_hosts, + 'services_warning_unhandled' => $this->statusSummary->services_warning_unhandled_on_problem_hosts, + 'services_warning_passive' => $this->statusSummary->services_warning_passive_on_problem_hosts, + 'services_warning_not_checked' => $this->statusSummary->services_warning_not_checked_on_problem_hosts, + 'services_critical_handled' => $this->statusSummary->services_critical_handled_on_problem_hosts, + 'services_critical_unhandled' => $this->statusSummary->services_critical_unhandled_on_problem_hosts, + 'services_critical_passive' => $this->statusSummary->services_critical_passive_on_problem_hosts, + 'services_critical_not_checked' => $this->statusSummary->services_critical_not_checked_on_problem_hosts, + 'services_unknown_handled' => $this->statusSummary->services_unknown_handled_on_problem_hosts, + 'services_unknown_unhandled' => $this->statusSummary->services_unknown_unhandled_on_problem_hosts, + 'services_unknown_passive' => $this->statusSummary->services_unknown_passive_on_problem_hosts, + 'services_unknown_not_checked' => $this->statusSummary->services_unknown_not_checked_on_problem_hosts + ) + ); ?> +
+
diff --git a/modules/monitoring/application/views/scripts/tactical/index.phtml b/modules/monitoring/application/views/scripts/tactical/index.phtml new file mode 100644 index 0000000..12f4bc5 --- /dev/null +++ b/modules/monitoring/application/views/scripts/tactical/index.phtml @@ -0,0 +1,145 @@ + +compact): ?> +
+ tabs ?> + filterEditor ?> +
+ +
+ +

translate('No results found matching the filter.') ?>

+
+ +
+
+

translate('Host Summary') ?>

+
+ +
+ +
+ +
+
diff --git a/modules/monitoring/application/views/scripts/timeline/index.phtml b/modules/monitoring/application/views/scripts/timeline/index.phtml new file mode 100644 index 0000000..cab18eb --- /dev/null +++ b/modules/monitoring/application/views/scripts/timeline/index.phtml @@ -0,0 +1,196 @@ +getGroupInfo(); +$firstRow = ! $beingExtended; +$timelineStyle = (new Style()) + ->setNonce(Csp::getStyleNonce()) + ->setModule('monitoring'); + +if (! $beingExtended && !$this->compact): ?> +
+ tabs; ?> +
+ +
+
+

translate('Legend'); ?>

+ + + + + +
+
+ + +
+
+ + +
+ +getInterval()) { + case '1d': + $titleTime = sprintf( + $this->translate('on %s', 'timeline.link.title.time'), + $timeInfo[0]->end->format('d/m/Y') + ); + break; + case '1w': + $titleTime = sprintf( + $this->translate('in week %s of %s', 'timeline.link.title.week.and.year'), + $timeInfo[0]->end->format('W'), + $timeInfo[0]->end->format('Y') + ); + break; + case '1m': + $titleTime = sprintf( + $this->translate('in %s', 'timeline.link.title.month.and.year'), + $timeInfo[0]->end->format('F Y') + ); + break; + case '1y': + $titleTime = sprintf( + $this->translate('in %s', 'timeline.link.title.year'), + $timeInfo[0]->end->format('Y') + ); + break; + default: + $titleTime = sprintf( + $this->translate('between %s and %s', 'timeline.link.title.datetime.twice'), + $timeInfo[0]->end->format('d/m/Y g:i A'), + $timeInfo[0]->start->format('d/m/Y g:i A') + ); + } ?> +
+ qlink( + $timeInfo[0]->end->format($intervalFormat), + 'monitoring/list/eventhistory', + array( + 'timestamp<' => $timeInfo[0]->start->getTimestamp(), + 'timestamp>' => $timeInfo[0]->end->getTimestamp() + ), + array('title' => sprintf( + $this->translate('List all event records registered %s', 'timeline.link.title'), + $titleTime + )), + false + ); ?> + $labelAndColor): ?> + +calculateCircleWidth($timeInfo[1][$groupName], 2); +$extrapolatedCircleWidth = $timeline->getExtrapolatedCircleWidth($timeInfo[1][$groupName], 2); +?> + + add( + "#circle-box-$styleId", + ['width' => $extrapolatedCircleWidth] + ); + + $timelineStyle->add( + "#outer-circle-$styleId", + [ + 'width' => $extrapolatedCircleWidth, + 'height' => $extrapolatedCircleWidth, + 'margin-top' => sprintf( + '-%Fem', + (float)substr($extrapolatedCircleWidth, 0, -2) / 2 + ) + ] + ); + + ?> +
+
+ + add( + "#circle-box-$styleId", + ['width' => $circleWidth] + ); + + $timelineStyle->add( + "#outer-circle-$styleId", + [ + 'width' => $circleWidth, + 'height' => $circleWidth, + 'margin-top' => sprintf( + '-%Fem', + (float)substr($circleWidth, 0, -2) / 2 + ) + ] + ); + + ?> +
+
+ +add( + "#inner-circle-$styleId", + [ + 'width' => $circleWidth, + 'height' => $circleWidth, + 'margin-top' => sprintf( + '-%Fem', + (float)substr($circleWidth, 0, -2) / 2 + ), + 'margin-left' => sprintf( + '-%Fem', + (float)substr($circleWidth, 0, -2) / 2 + ), + ] +); +?> + qlink( + '', + $timeInfo[1][$groupName]->getDetailUrl(), + array( + 'type' => $groupName, + 'timestamp<' => $timeInfo[0]->start->getTimestamp(), + 'timestamp>' => $timeInfo[0]->end->getTimestamp() + ), + array( + 'title' => sprintf( + $this->translate('List %u %s registered %s', 'timeline.link.title'), + $timeInfo[1][$groupName]->getValue(), + strtolower($labelAndColor['label']), + $titleTime + ), + 'id' => "inner-circle-$styleId", + 'class' => "inner-circle " . $timeInfo[1][$groupName]->getClass() + ) + ); ?> +
+
+ + +
+ + + + +
+
+ + -- cgit v1.2.3