diff --git a/modules/monitoring/application/views/helpers/HostFlags.php b/modules/monitoring/application/views/helpers/HostFlags.php index a4c5bc7d2..81d8ebcdf 100644 --- a/modules/monitoring/application/views/helpers/HostFlags.php +++ b/modules/monitoring/application/views/helpers/HostFlags.php @@ -1,9 +1,6 @@ view->icon('eye-off', $this->view->translate('Active Checks Disabled')); } } - return $icons; + return implode(' ', $icons); } } diff --git a/modules/monitoring/application/views/helpers/ServiceFlags.php b/modules/monitoring/application/views/helpers/ServiceFlags.php index e9bfd70ba..47a351c4c 100644 --- a/modules/monitoring/application/views/helpers/ServiceFlags.php +++ b/modules/monitoring/application/views/helpers/ServiceFlags.php @@ -3,30 +3,31 @@ class Zend_View_Helper_ServiceFlags extends Zend_View_Helper_Abstract { - public function serviceFlags($service) { + public function serviceFlags($service) + { $icons = array(); - if (!$service->service_handled && $service->service_state > 0) { + if (! $service->service_handled && $service->service_state > 0) { $icons[] = $this->view->icon('attention-alt', $this->view->translate('Unhandled')); } - if ($service->service_acknowledged && !$service->service_in_downtime) { + if ($service->service_acknowledged) { $icons[] = $this->view->icon('ok', $this->view->translate('Acknowledged')); } if ($service->service_is_flapping) { $icons[] = $this->view->icon('flapping', $this->view->translate('Flapping')); } - if (!$service->service_notifications_enabled) { + if (! $service->service_notifications_enabled) { $icons[] = $this->view->icon('bell-off-empty', $this->view->translate('Notifications Disabled')); } if ($service->service_in_downtime) { $icons[] = $this->view->icon('plug', $this->view->translate('In Downtime')); } - if (!$service->service_active_checks_enabled) { - if (!$service->service_passive_checks_enabled) { + if (! $service->service_active_checks_enabled) { + if (! $service->service_passive_checks_enabled) { $icons[] = $this->view->icon('eye-off', $this->view->translate('Active And Passive Checks Disabled')); } else { - $icons[] = $this->view->icon('eye-off', $this->view->translate('Active Checks Disabled')); + $icons[] = $this->view->icon('eye-off', $this->view->translate('Active Checks Disabled')); } } - return $icons; + return implode(' ', $icons); } -} \ No newline at end of file +} diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index 6de773435..da20cb990 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -82,7 +82,7 @@ if (! $this->compact): ?> ) ) ?>) - hostFlags($host)) ?> + hostFlags($host) ?>

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

diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index d8fd5d4b5..e6793db86 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -82,7 +82,7 @@ if (! $this->compact): ?> 'class' => 'rowaction' ) ) ?> - serviceFlags($service)) ?> + serviceFlags($service) ?>
diff --git a/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml b/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml index 731ba1cf8..48141e2fd 100644 --- a/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml @@ -20,7 +20,7 @@ if (! ($hostCount = count($objects))): return; endif ?> $host->host_name, $host->host_display_name ) ?> - hostFlags($host)) ?> + hostFlags($host) ?> diff --git a/modules/monitoring/application/views/scripts/partials/host/statusicons.phtml b/modules/monitoring/application/views/scripts/partials/host/statusicons.phtml deleted file mode 100644 index 4421c301f..000000000 --- a/modules/monitoring/application/views/scripts/partials/host/statusicons.phtml +++ /dev/null @@ -1,28 +0,0 @@ -object->host_handled && $this->object->host_state > 0) { - $icons[] = $this->icon('attention-alt', $this->translate('Unhandled')); -} - -if ($this->object->host_acknowledged && !$this->object->host_in_downtime) { - $icons[] = $this->icon('ok', $this->translate('Acknowledged')); -} - -if (! $this->object->host_notifications_enabled) { - $icons[] = $this->icon('bell-off-empty', $this->translate('Notifications Disabled')); -} - -if ($this->object->host_in_downtime) { - $icons[] = $this->icon('plug', $this->translate('In Downtime')); -} - -if (! $this->object->host_active_checks_enabled) { - if ($this->object->host_passive_checks_enabled) { - $icons[] = $this->icon('eye-off', $this->translate('Active Checks Disabled')); - } else { - $icons[] = $this->icon('eye-off', $this->translate('Active And Passive Checks Disabled')); - } -} - -?> \ No newline at end of file diff --git a/modules/monitoring/application/views/scripts/partials/object/host-header.phtml b/modules/monitoring/application/views/scripts/partials/object/host-header.phtml index a77a95d58..3bfb35030 100644 --- a/modules/monitoring/application/views/scripts/partials/object/host-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/object/host-header.phtml @@ -24,7 +24,7 @@ use Icinga\Module\Monitoring\Object\Host; escape($this->translate('Alias', 'host') . ': ' . $object->host_alias) ?>
- render('partials/host/statusicons.phtml') ?> + hostFlags($object) ?> host_address6 && $object->host_address6 !== $object->host_name): ?>
escape($object->host_address6) ?> diff --git a/modules/monitoring/application/views/scripts/partials/object/service-header.phtml b/modules/monitoring/application/views/scripts/partials/object/service-header.phtml index 93eb41f94..a293ff6da 100644 --- a/modules/monitoring/application/views/scripts/partials/object/service-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/object/service-header.phtml @@ -20,7 +20,7 @@ use Icinga\Module\Monitoring\Object\Service; host_display_name !== $object->host_name): ?> (escape($object->host_name) ?>) - render('partials/host/statusicons.phtml') ?> + hostFlags($object) ?> host_address6 && $object->host_address6 !== $object->host_name): ?>
escape($object->host_address6) ?> @@ -49,7 +49,7 @@ use Icinga\Module\Monitoring\Object\Service; service_display_name !== $object->service_description): ?> (escape($object->service_description) ?>) - render('partials/service/statusicons.phtml') ?> + 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 index 7512a3042..d342d874d 100644 --- a/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml @@ -24,7 +24,7 @@ if (! ($serviceCount = count($objects))): return; endif ?> $service->host_display_name . ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : '') ) ?> - serviceFlags($service)) ?> + serviceFlags($service) ?> diff --git a/modules/monitoring/application/views/scripts/partials/service/statusicons.phtml b/modules/monitoring/application/views/scripts/partials/service/statusicons.phtml deleted file mode 100644 index 8859bf189..000000000 --- a/modules/monitoring/application/views/scripts/partials/service/statusicons.phtml +++ /dev/null @@ -1,28 +0,0 @@ -object->service_handled && $this->object->service_state > 0) { - $icons[] = $this->icon('attention-alt', $this->translate('Unhandled')); -} - -if ($this->object->service_acknowledged && !$this->object->service_in_downtime) { - $icons[] = $this->icon('ok', $this->translate('Acknowledged')); -} - -if (! $this->object->service_notifications_enabled) { - $icons[] = $this->icon('bell-off-empty', $this->translate('Notifications Disabled')); -} - -if ($this->object->service_in_downtime) { - $icons[] = $this->icon('plug', $this->translate('In Downtime')); -} - -if (! $this->object->service_active_checks_enabled) { - if ($this->object->service_passive_checks_enabled) { - $icons[] = $this->icon('eye-off', $this->translate('Active Checks Disabled')); - } else { - $icons[] = $this->icon('eye-off', $this->translate('Active And Passive Checks Disabled')); - } -} - -?> \ No newline at end of file diff --git a/modules/monitoring/library/Monitoring/Object/Service.php b/modules/monitoring/library/Monitoring/Object/Service.php index 9e60898ac..5d03b786d 100644 --- a/modules/monitoring/library/Monitoring/Object/Service.php +++ b/modules/monitoring/library/Monitoring/Object/Service.php @@ -118,6 +118,7 @@ class Service extends MonitoredObject 'host_display_name', 'host_handled', 'host_in_downtime', + 'host_is_flapping', 'host_last_state_change', 'host_name', 'host_notifications_enabled',