diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:46:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:46:43 +0000 |
commit | 3e02d5aff85babc3ffbfcf52313f2108e313aa23 (patch) | |
tree | b01f3923360c20a6a504aff42d45670c58af3ec5 /modules/monitoring/application/views/scripts/health | |
parent | Initial commit. (diff) | |
download | icingaweb2-3e02d5aff85babc3ffbfcf52313f2108e313aa23.tar.xz icingaweb2-3e02d5aff85babc3ffbfcf52313f2108e313aa23.zip |
Adding upstream version 2.12.1.upstream/2.12.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules/monitoring/application/views/scripts/health')
4 files changed, 265 insertions, 0 deletions
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 @@ +<?php if (! $this->compact): ?> +<div class="controls"> + <?= $this->tabs->showOnlyCloseButton(); ?> +</div> +<?php endif ?> +<div class="content"> + <h1><?= $title; ?></h1> + <?php if ((bool) $programStatus->notifications_enabled === false): ?> + <div> + <?= $this->translate('Host and service notifications are already disabled.') ?> + <?php if ($this->programStatus->disable_notif_expire_time): ?> + <?= sprintf( + $this->translate('Notifications will be re-enabled in <strong>%s</strong>.'), + $this->timeUntil($this->programStatus->disable_notif_expire_time)); ?> + <?php endif; ?> + </div> + <?php else: ?> + <?= $form; ?> + <?php endif ?> +</div> 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 @@ +<?php +$rv = $this->runtimeVariables()->create($this->runtimevariables); +$cp = $this->checkPerformance()->create($this->checkperformance); + +if (! $this->compact): ?> +<div class="controls"> + <?= $this->tabs; ?> +</div> +<?php endif ?> + +<div class="content processinfo"> + <div class="boxview"> + <div class="box process"> + <h2 tabindex="0"><?= $this->translate('Process Info') ?></h2> + <table class="name-value-table"> + <tbody> + <tr> + <th><?= $this->translate('Program Version') ?></th> + <td><?= $this->programStatus->program_version + ? $this->programStatus->program_version + : $this->translate('N/A') ?></td> + </tr> + <tr> + <th><?= $this->translate('Program Start Time') ?></th> + <td><?= $this->formatDateTime($this->programStatus->program_start_time) ?></td> + </tr> + <tr> + <th><?= $this->translate('Last Status Update'); ?></th> + <td><?= $this->timeAgo($this->programStatus->status_update_time); ?></td> + </tr> + <tr> + <th><?= $this->translate('Last External Command Check'); ?></th> + <td><?= $this->timeAgo($this->programStatus->last_command_check); ?></td> + </tr> + <tr> + <th><?= $this->translate('Last Log File Rotation'); ?></th> + <td><?= $this->programStatus->last_log_rotation + ? $this->timeSince($this->programStatus->last_log_rotation) + : $this->translate('N/A') ?></td> + </tr> + <tr> + <th><?= $this->translate('Global Service Event Handler'); ?></th> + <td><?= $this->programStatus->global_service_event_handler + ? $this->programStatus->global_service_event_handler + : $this->translate('N/A'); ?></td> + </tr> + <tr> + <th><?= $this->translate('Global Host Event Handler'); ?></th> + <td><?= $this->programStatus->global_host_event_handler + ? $this->programStatus->global_host_event_handler + : $this->translate('N/A'); ?></td> + </tr> + <tr> + <th><?= $this->translate('Active Endpoint'); ?></th> + <td><?= $this->programStatus->endpoint_name + ? $this->programStatus->endpoint_name + : $this->translate('N/A') ?></td> + </tr> + <tr> + <th><?= $this->translate('Active Icinga Web 2 Endpoint'); ?></th> + <td><?= gethostname() ?: $this->translate('N/A') ?></td> + </tr> + </tbody> + </table> + <?php if ((bool) $this->programStatus->is_currently_running === true): ?> + <div class="backend-running"> + <?= sprintf( + $this->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)) ?> + </div> + <?php else: ?> + <div class="backend-not-running"> + <?= sprintf($this->translate('Backend %s is not running'), $this->backendName) ?> + </div> + <?php endif ?> + </div> + <div class="box features"> + <h2 tabindex="0"><?= $this->translate('Feature Commands') ?></h2> + <?= $this->toggleFeaturesForm ?> + </div> + </div> +</div> 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 @@ +<?php if (! $this->compact): ?> +<div class="controls"> + <?= $this->tabs; ?> +</div> +<?php endif ?> +<div class="content"> + <?= sprintf($this->translate('%s is currently not up and running'), $this->backendName) ?> +</div> 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 @@ +<?php +$rv = $this->runtimeVariables()->create($this->runtimevariables); +$cp = $this->checkPerformance()->create($this->checkperformance); + +if (! $this->compact): ?> +<div class="controls"> + <?= $this->tabs ?> +</div> +<?php endif ?> + +<div class="content stats"> + <div class="boxview"> + <div class="box stats"> + <h2 tabindex="0"><?= $this->unhandledProblems ?> <?= $this->translate('Unhandled Problems:') ?></h2> + <table class="name-value-table"> + <thead> + <th></th> + <th colspan="3"></th> + </thead> + <tbody> + <tr> + <th><?= $this->translate('Service Problems:') ?></th> + <td colspan="3"> + <span class="badge state-critical"> + <?= + $this->qlink( + $this->unhandledServiceProblems, + 'monitoring/list/services?service_problem=1&service_handled=0&sort=service_severity', + null, + array('data-base-target' => '_next') + ) + ?> + </span> + </td> + </tr> + <tr> + <th><?= $this->translate('Host Problems:') ?></th> + <td colspan="3"> + <span class="badge state-critical"> + <?= + $this->qlink( + $this->unhandledhostProblems, + 'monitoring/list/hosts?host_problem=1&host_handled=0', + null, + array('data-base-target' => '_next') + ) + ?> + </span> + </td> + </tr> + </tbody> + </table> + + <h2 tabindex="0" class="tinystatesummary" data-base-target="_next"> + <?php $this->stats = $hoststats ?> + <?= $this->render('list/components/hostssummary.phtml') ?> + </h2> + <table class="name-value-table"> + <thead> + <tr> + <th><?= $this->translate('Runtime Variables') ?></th> + <th colspan="3"><?= $this->translate('Host Checks') ?></th> + </tr> + </thead> + <tbody> + <tr> + <th><?= $this->translate('Total') ?></th> + <td><?= $rv->total_scheduled_hosts ?></td> + </tr> + <tr> + <th><?= $this->translate('Scheduled') ?></th> + <td><?= $rv->total_scheduled_hosts ?></td> + </tr> + </tbody> + </table> + + <h2 class="tinystatesummary" data-base-target="_next"> + <?php $this->stats = $servicestats ?> + <?= $this->render('list/components/servicesummary.phtml') ?> + </h2> + <table class="name-value-table"> + <thead> + <tr> + <th><?= $this->translate('Runtime Variables') ?></th> + <th><?= $this->translate('Service Checks') ?></th> + <th colspan="2"><?= $this->translate('Per Host') ?></th> + </tr> + </thead> + <tbody> + <tr> + <th><?= $this->translate('Total') ?></th> + <td><?= $rv->total_services ?></td> + <td><?= sprintf('%.2f', $rv->average_services_per_host) ?></td> + </tr> + <tr> + <th><?= $this->translate('Scheduled') ?></th> + <td><?= $rv->total_scheduled_services ?></td> + <td><?= sprintf('%.2f', $rv->average_scheduled_services_per_host) ?></td> + </tr> + </tbody> + </table> + + <h2><?= $this->translate('Active checks') ?></h2> + <table class="name-value-table"> + <thead> + <tr> + <th><?= $this->translate('Check Performance') ?></th> + <th><?= $this->translate('Checks') ?></th> + <th><?= $this->translate('Latency') ?></th> + <th><?= $this->translate('Execution time') ?></th> + </tr> + </thead> + <tbody> + <tr> + <th><?= $this->translate('Host Checks') ?></th> + <td><?= $cp->host_active_count; ?></td> + <td><?= sprintf('%.3f', $cp->host_active_latency_avg) ?>s</td> + <td><?= sprintf('%.3f', $cp->host_active_execution_avg) ?>s</td> + </tr> + <tr> + <th><?= $this->translate('Service Checks') ?></th> + <td><?= $cp->service_active_count; ?></td> + <td><?= sprintf('%.3f', $cp->service_active_latency_avg) ?>s</td> + <td><?= sprintf('%.3f', $cp->service_active_execution_avg) ?>s</td> + </tr> + </tbody> + </table> + + <h2><?= $this->translate('Passive checks') ?></h2> + <table class="name-value-table"> + <thead> + <tr> + <th><?= $this->translate('Check Performance') ?></th> + <th colspan="3"><?= $this->translate('Passive Checks') ?></th> + </tr> + </thead> + <tbody> + <tr> + <th><?= $this->translate('Host Checks') ?></th> + <td><?= $cp->host_passive_count ?></td> + </tr> + <tr> + <th><?= $this->translate('Service Checks') ?></th> + <td><?= $cp->service_passive_count ?></td> + </tr> + </tbody> + </table> + </div> + </div> +</div> |