diff --git a/modules/monitoring/application/controllers/HostsController.php b/modules/monitoring/application/controllers/HostsController.php index 8d0fc1f734..27d26e51b1 100644 --- a/modules/monitoring/application/controllers/HostsController.php +++ b/modules/monitoring/application/controllers/HostsController.php @@ -123,7 +123,7 @@ public function showAction() } if ((bool) $host->in_downtime === true) { $objectsInDowntime[] = $host; - $downtimeFilterExpressions[] = Filter::where('downtime_host', $host->getName()); + $downtimeFilterExpressions[] = Filter::where('host_name', $host->getName()); } ++$hostStates[$host::getStateText($host->state)]; } diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index cd0a734efe..ed4f337b07 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -280,10 +280,10 @@ public function downtimesAction() 'is_fixed' => 'downtime_is_fixed', 'is_in_effect' => 'downtime_is_in_effect', 'entry_time' => 'downtime_entry_time', - 'host' => 'host_name', - 'service' => 'service_description', 'host_state' => 'downtime_host_state', 'service_state' => 'downtime_service_state', + 'host_name', + 'service_description', 'host_display_name', 'service_display_name' )); diff --git a/modules/monitoring/application/controllers/ServicesController.php b/modules/monitoring/application/controllers/ServicesController.php index efe89f4c15..b82d6f00e7 100644 --- a/modules/monitoring/application/controllers/ServicesController.php +++ b/modules/monitoring/application/controllers/ServicesController.php @@ -158,8 +158,8 @@ public function showAction() if ((bool) $service->in_downtime === true) { $objectsInDowntime[] = $service; $downtimeFilterExpressions[] = Filter::matchAll( - Filter::where('downtime_host', $service->getHost()->getName()), - Filter::where('downtime_service', $service->getName()) + Filter::where('host_name', $service->getHost()->getName()), + Filter::where('service_description', $service->getName()) ); } ++$serviceStates[$service::getStateText($service->state)]; diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index 00d9c7f905..3e15beef4e 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -30,7 +30,7 @@ use Icinga\Module\Monitoring\Object\Service; service)) { + if (isset($downtime->service_description)) { $isService = true; $stateName = Service::getStateText($downtime->service_state); } else { @@ -57,11 +57,11 @@ use Icinga\Module\Monitoring\Object\Service; icon('service', $this->translate('Service')); ?> link()->service( - $downtime->service, $downtime->service_display_name, $downtime->host, $downtime->host_display_name + $downtime->service_description, $downtime->service_display_name, $downtime->host_name, $downtime->host_display_name ) ?> icon('host', $this->translate('Host')); ?> - link()->host($downtime->host, $downtime->host_display_name) ?> + link()->host($downtime->host_name, $downtime->host_display_name) ?>
icon('comment', $this->translate('Comment')); ?> [escape($downtime->author) ?>] escape($downtime->comment) ?> @@ -70,7 +70,7 @@ use Icinga\Module\Monitoring\Object\Service; is_flexible): ?> is_in_effect): ?> service) + $isService ? $this->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.'), date('d.m.y', $downtime->start), @@ -81,7 +81,7 @@ use Icinga\Module\Monitoring\Object\Service; ); ?> service) + $isService ? $this->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.'), date('d.m.y H:i', $downtime->scheduled_start), @@ -92,7 +92,7 @@ use Icinga\Module\Monitoring\Object\Service; is_in_effect): ?> service) + $isService ? $this->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.'), date('d.m.y', $downtime->start), @@ -102,7 +102,7 @@ use Icinga\Module\Monitoring\Object\Service; ); ?> service) + $isService ? $this->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.'), date('d.m.y', $downtime->scheduled_start), @@ -119,12 +119,12 @@ use Icinga\Module\Monitoring\Object\Service; populate(array('downtime_id' => $downtime->id, 'redirect' => $this->url)); - if (! isset($downtime->service)) { - $delDowntimeForm->setAction($this->url('monitoring/host/delete-downtime', array('host_name' => $downtime->host))); + if (! $isService) { + $delDowntimeForm->setAction($this->url('monitoring/host/delete-downtime', array('host_name' => $downtime->host_name))); } else { $delDowntimeForm->setAction($this->url('monitoring/service/delete-downtime', array( - 'host_name' => $downtime->host, - 'service_description' => $downtime->service + 'host_name' => $downtime->host_name, + 'service_description' => $downtime->service_description ))); } echo $delDowntimeForm;