diff --git a/modules/monitoring/application/views/scripts/hosts/show.phtml b/modules/monitoring/application/views/scripts/hosts/show.phtml index 3c7dafbc5..516e1be03 100644 --- a/modules/monitoring/application/views/scripts/hosts/show.phtml +++ b/modules/monitoring/application/views/scripts/hosts/show.phtml @@ -14,7 +14,7 @@
$count) { - echo sprintf('%s: %u
', strtoupper($text), $count); + echo sprintf('%s: %u
', $this->translate(strtoupper($text)), $count); } ?>
diff --git a/modules/monitoring/application/views/scripts/list/components/servicesummary.phtml b/modules/monitoring/application/views/scripts/list/components/servicesummary.phtml index dab7071a1..c870b09b0 100644 --- a/modules/monitoring/application/views/scripts/list/components/servicesummary.phtml +++ b/modules/monitoring/application/views/scripts/list/components/servicesummary.phtml @@ -12,7 +12,7 @@ $currentUrl = Url::fromRequest()->getRelativeUrl(); $this->stats->services_ok, $selfUrl, array('service_state' => 0), - array('title' => sprintf($this->translate('Services with state %s'), strtoupper($this->translate('ok')))) + array('title' => sprintf($this->translate('Services with state %s'), $this->translate('OK'))) ) ?> @@ -44,7 +44,7 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $ $this->stats->$unhandled, $selfUrl, $paramsUnhandled, - array('title' => sprintf($this->translate('Unhandled services with state %s'), strtoupper($this->translate($state)))) + array('title' => sprintf($this->translate('Unhandled services with state %s'), $this->translate(strtoupper($state)))) ); } if ($this->stats->$handled) { @@ -61,7 +61,7 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $ $this->stats->$handled, $selfUrl, $paramsHandled, - array('title' => sprintf($this->translate('Handled services with state %s'), strtoupper($this->translate($state)))) + array('title' => sprintf($this->translate('Handled services with state %s'), $this->translate(strtoupper($state)))) ); if ($this->stats->$unhandled) { echo "\n"; @@ -77,7 +77,7 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $ $this->stats->services_pending, $selfUrl, array('service_state' => 99), - array('title' => sprintf($this->translate('Services with state %s'), strtoupper($this->translate('pending')))) + array('title' => sprintf($this->translate('Services with state %s'), $this->translate('PENDING'))) ) ?> diff --git a/modules/monitoring/application/views/scripts/list/eventhistory.phtml b/modules/monitoring/application/views/scripts/list/eventhistory.phtml index 2970675e2..0b6b9bcec 100644 --- a/modules/monitoring/application/views/scripts/list/eventhistory.phtml +++ b/modules/monitoring/application/views/scripts/list/eventhistory.phtml @@ -70,21 +70,13 @@ use Icinga\Module\Monitoring\Object\Service; $icon = $isService ? 'service' : 'host'; $msg = '[ ' . $event->attempt . '/' . $event->max_attempts . ' ] ' . $event->output; $stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state); - $title = strtoupper( - $isService - ? Service::getStateText($event->state, true) - : Host::getStateText($event->state, true) - ); + $title = $isService ? Service::getStateText($event->state, true) : Host::getStateText($event->state, true); break; case 'soft_state': $icon = 'lightbulb'; $msg = '[ ' . $event->attempt . '/' . $event->max_attempts . ' ] ' . $event->output; $stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state); - $title = strtoupper( - $isService - ? Service::getStateText($event->state, true) - : Host::getStateText($event->state, true) - ); + $title = $isService ? Service::getStateText($event->state, true) : Host::getStateText($event->state, true); break; case 'dt_start': $icon = 'starttime'; diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index 00e357aa5..ea570a389 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -80,7 +80,7 @@ if ($hosts->count() === 0) { - host_state, true)); ?>
+ host_state, true); ?>
host_state !== 99): ?> prefixedTimeSince($host->host_last_state_change, true) ?> host_state > 0 && (int) $host->host_state_type === 0): ?> diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index 0e211dfa5..45d59adf5 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -56,7 +56,7 @@ foreach ($services as $service): ?> - service_state, true)); ?>
+ service_state, true); ?>
compact): ?>prefixedTimeSince($service->service_last_state_change); ?>timeSince($service->service_last_state_change); ?> service_state > 0 && (int) $service->service_state_type === 0): ?>
@@ -106,7 +106,7 @@ foreach ($services as $service): escape($service->service_display_name) ?>showHost): ?> on escape($service->host_display_name) ?> host_state != 0): ?> - (host_state, true)); ?>) + (host_state, true); ?>)

escape($this->ellipsis($service->service_output, 10000)); ?>

diff --git a/modules/monitoring/application/views/scripts/services/show.phtml b/modules/monitoring/application/views/scripts/services/show.phtml index 93e4ae84a..522d32ce7 100644 --- a/modules/monitoring/application/views/scripts/services/show.phtml +++ b/modules/monitoring/application/views/scripts/services/show.phtml @@ -16,7 +16,7 @@
$count) { - echo sprintf(' %s: %u
', strtoupper($text), $count); + echo sprintf(' %s: %u
', $this->translate(strtoupper($text)), $count); } ?>
@@ -31,7 +31,7 @@
$count) { - echo sprintf('%s: %u
', strtoupper($text), $count); + echo sprintf('%s: %u
', $this->translate(strtoupper($text)), $count); } ?>
diff --git a/modules/monitoring/application/views/scripts/show/components/header.phtml b/modules/monitoring/application/views/scripts/show/components/header.phtml index 7f58790f4..8ba84da43 100644 --- a/modules/monitoring/application/views/scripts/show/components/header.phtml +++ b/modules/monitoring/application/views/scripts/show/components/header.phtml @@ -14,7 +14,7 @@ $isService = $object->getType() === $object::TYPE_SERVICE;
> - host_state, true)); ?>
+ host_state, true); ?>
prefixedTimeSince($object->host_last_state_change, true) ?>
@@ -31,7 +31,7 @@ $isService = $object->getType() === $object::TYPE_SERVICE;
- service_state, true)); ?>
+ service_state, true); ?>
prefixedTimeSince($object->service_last_state_change, true) ?>
diff --git a/modules/monitoring/application/views/scripts/show/components/hostservicesummary.phtml b/modules/monitoring/application/views/scripts/show/components/hostservicesummary.phtml index 3c603786a..641dd026a 100644 --- a/modules/monitoring/application/views/scripts/show/components/hostservicesummary.phtml +++ b/modules/monitoring/application/views/scripts/show/components/hostservicesummary.phtml @@ -17,7 +17,7 @@ $currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl(); $object->stats->services_ok, $selfUrl, array('service_state' => 0), - array('title' => sprintf($this->translate('Services with state %s'), strtoupper($this->translate('ok')))) + array('title' => sprintf($this->translate('Services with state %s'), $this->translate('OK'))) ) ?> 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $ $object->stats->$unhandled, $selfUrl, $paramsUnhandled, - array('title' => sprintf($this->translate('Unhandled services with state %s'), strtoupper($this->translate($state)))) + array('title' => sprintf($this->translate('Unhandled services with state %s'), $this->translate(strtoupper($state)))) ); } if ($object->stats->$handled) { @@ -65,7 +65,7 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $ $object->stats->$handled, $selfUrl, $paramsHandled, - array('title' => sprintf($this->translate('Handled services with state %s'), strtoupper($this->translate($state)))) + array('title' => sprintf($this->translate('Handled services with state %s'), $this->translate(strtoupper($state)))) ); if ($object->stats->$unhandled) { echo "\n"; @@ -81,7 +81,7 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $ $object->stats->services_pending, $selfUrl, array('service_state' => 99), - array('title' => sprintf($this->translate('Services with state %s'), strtoupper($this->translate('pending')))) + array('title' => sprintf($this->translate('Services with state %s'), $this->translate('PENDING'))) ) ?> diff --git a/modules/monitoring/application/views/scripts/show/history.phtml b/modules/monitoring/application/views/scripts/show/history.phtml index a0cc4944e..40fb15363 100644 --- a/modules/monitoring/application/views/scripts/show/history.phtml +++ b/modules/monitoring/application/views/scripts/show/history.phtml @@ -92,21 +92,13 @@ function contactsLink($match, $view) { $msg = '[ ' . $event->attempt . '/' . $event->max_attempts . ' ] ' . $this->escape($event->output); $stateClass = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state); $icon = 'attention-alt'; - $title = strtoupper( - $isService - ? Service::getStateText($event->state) - : Host::getStateText($event->state) - ); + $title = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state); break; case 'soft_state': $icon = 'spinner'; $msg = '[ ' . $event->attempt . '/' . $event->max_attempts . ' ] ' . $this->escape($event->output); $stateClass = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state); - $title = strtoupper( - $isService - ? Service::getStateText($event->state) - : Host::getStateText($event->state) - ); + $title = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state); break; case 'dt_start': $icon = 'downtime_start'; diff --git a/modules/monitoring/library/Monitoring/Object/Host.php b/modules/monitoring/library/Monitoring/Object/Host.php index eeac94cb9..8f7df07cb 100644 --- a/modules/monitoring/library/Monitoring/Object/Host.php +++ b/modules/monitoring/library/Monitoring/Object/Host.php @@ -173,16 +173,16 @@ class Host extends MonitoredObject $translate = (bool) $translate; switch ((int) $state) { case self::STATE_UP: - $text = $translate ? mt('monitoring', 'up') : 'up'; + $text = $translate ? mt('monitoring', 'UP') : 'up'; break; case self::STATE_DOWN: - $text = $translate ? mt('monitoring', 'down') : 'down'; + $text = $translate ? mt('monitoring', 'DOWN') : 'down'; break; case self::STATE_UNREACHABLE: - $text = $translate ? mt('monitoring', 'unreachable') : 'unreachable'; + $text = $translate ? mt('monitoring', 'UNREACHABLE') : 'unreachable'; break; case self::STATE_PENDING: - $text = $translate ? mt('monitoring', 'pending') : 'pending'; + $text = $translate ? mt('monitoring', 'PENDING') : 'pending'; break; default: throw new InvalidArgumentException('Invalid host state \'%s\'', $state); diff --git a/modules/monitoring/library/Monitoring/Object/Service.php b/modules/monitoring/library/Monitoring/Object/Service.php index 3b7bff4fa..870ff78ba 100644 --- a/modules/monitoring/library/Monitoring/Object/Service.php +++ b/modules/monitoring/library/Monitoring/Object/Service.php @@ -214,19 +214,19 @@ class Service extends MonitoredObject $translate = (bool) $translate; switch ((int) $state) { case self::STATE_OK: - $text = $translate ? mt('monitoring', 'ok') : 'ok'; + $text = $translate ? mt('monitoring', 'OK') : 'ok'; break; case self::STATE_WARNING: - $text = $translate ? mt('monitoring', 'warning') : 'warning'; + $text = $translate ? mt('monitoring', 'WARNING') : 'warning'; break; case self::STATE_CRITICAL: - $text = $translate ? mt('monitoring', 'critical') : 'critical'; + $text = $translate ? mt('monitoring', 'CRITICAL') : 'critical'; break; case self::STATE_UNKNOWN: - $text = $translate ? mt('monitoring', 'unknown') : 'unknown'; + $text = $translate ? mt('monitoring', 'UNKNOWN') : 'unknown'; break; case self::STATE_PENDING: - $text = $translate ? mt('monitoring', 'pending') : 'pending'; + $text = $translate ? mt('monitoring', 'PENDING') : 'pending'; break; default: throw new InvalidArgumentException('Invalid service state \'%s\'', $state);