From b55a31314614ac648dafd719b165ca9f4b7a9939 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Fri, 22 Aug 2014 10:23:12 +0200 Subject: [PATCH 001/257] Implement IcingaException refs #6931 --- library/Icinga/Exception/IcingaException.php | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 library/Icinga/Exception/IcingaException.php diff --git a/library/Icinga/Exception/IcingaException.php b/library/Icinga/Exception/IcingaException.php new file mode 100644 index 000000000..8443f9c7c --- /dev/null +++ b/library/Icinga/Exception/IcingaException.php @@ -0,0 +1,29 @@ + Date: Fri, 22 Aug 2014 10:58:28 +0200 Subject: [PATCH 002/257] Delete unnecessary menu.ini's and update puppet manifests refs #6639 --- .vagrant-puppet/manifests/default.pp | 26 ------- config/menu.ini | 34 --------- config/modules/doc/menu.ini | 5 -- config/modules/monitoring/menu.ini | 109 --------------------------- 4 files changed, 174 deletions(-) delete mode 100644 config/menu.ini delete mode 100644 config/modules/doc/menu.ini delete mode 100644 config/modules/monitoring/menu.ini diff --git a/.vagrant-puppet/manifests/default.pp b/.vagrant-puppet/manifests/default.pp index 72cb2b237..282803a83 100644 --- a/.vagrant-puppet/manifests/default.pp +++ b/.vagrant-puppet/manifests/default.pp @@ -709,13 +709,6 @@ file { '/etc/icingaweb/config.ini': group => 'apache', } -file { '/etc/icingaweb/menu.ini': - source => 'puppet:////vagrant/config/menu.ini', - owner => 'apache', - group => 'apache', - # replace => false, -} - file { '/etc/icingaweb/resources.ini': source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icingaweb/resources.ini', owner => 'apache', @@ -747,12 +740,6 @@ file { '/etc/icingaweb/modules/monitoring/instances.ini': group => 'apache', } -file { '/etc/icingaweb/modules/monitoring/menu.ini': - source => 'puppet:////vagrant/config/modules/monitoring/menu.ini', - owner => 'apache', - group => 'apache', -} - file { '/etc/icingaweb/dashboard': ensure => 'directory', owner => 'apache', @@ -791,16 +778,3 @@ file { '/etc/bash_completion.d/icingacli': mode => 755, require => Exec['install bash-completion'] } - -file { '/etc/icingaweb/modules/doc/': - ensure => 'directory', - owner => 'apache', - group => 'apache' -} - -file { '/etc/icingaweb/modules/doc/menu.ini': - source => 'puppet:////vagrant/config/modules/doc/menu.ini', - owner => 'apache', - group => 'apache', -} - diff --git a/config/menu.ini b/config/menu.ini deleted file mode 100644 index 075f4230e..000000000 --- a/config/menu.ini +++ /dev/null @@ -1,34 +0,0 @@ -[Dashboard] -title = "Dashboard" -url = "dashboard" -icon = "img/icons/dashboard.png" -priority = 10 - -[System] -icon = img/icons/configuration.png -priority = 200 - -[System.Preferences] -title = "Preferences" -url = "preference" -priority = 200 - -[System.Configuration] -title = "Configuration" -url = "config" -priority = 300 - -[System.Modules] -title = "Modules" -url = "config/modules" -priority = 400 - -[System.ApplicationLog] -title = "Application log" -url = "list/applicationlog" -priority = 500 - -[Logout] -url = "authentication/logout" -icon = img/icons/logout.png -priority = 300 diff --git a/config/modules/doc/menu.ini b/config/modules/doc/menu.ini deleted file mode 100644 index 86889b239..000000000 --- a/config/modules/doc/menu.ini +++ /dev/null @@ -1,5 +0,0 @@ -[Documentation] -title = "Documentation" -icon = "img/icons/comment.png" -url = "doc" -priority = 80 diff --git a/config/modules/monitoring/menu.ini b/config/modules/monitoring/menu.ini deleted file mode 100644 index c185fb87d..000000000 --- a/config/modules/monitoring/menu.ini +++ /dev/null @@ -1,109 +0,0 @@ - -[Problems] -priority = 20 -icon = "img/icons/error.png" - -[Problems.Unhandled Hosts] -priority = 40 -url = "monitoring/list/hosts?host_problem=1&host_handled=0" - -[Problems.Unhandled Services] -priority = 40 -url = "monitoring/list/services?service_problem=1&service_handled=0&sort=service_severity" - -[Problems.Host Problems] -priority = 50 -url = "monitoring/list/hosts?host_problem=1&sort=host_severity" - -[Problems.Service Problems] -priority = 50 -url = "monitoring/list/services?service_problem=1&sort=service_severity&dir=desc" - -[Problems.Current Downtimes] -url = "monitoring/list/downtimes?downtime_is_in_effect=1" - -[Overview] -priority = 30 -icon = "img/icons/hostgroup.png" - -[Overview.Tactical Overview] -title = "Tactical Overview" -url = "monitoring/tactical" -priority = 40 - -[Overview.Hosts] -title = "Hosts" -url = "monitoring/list/hosts" -priority = 50 - -[Overview.Services] -title = "Services" -url = "monitoring/list/services" -priority = 50 - -[Overview.Servicematrix] -title = "Servicematrix" -url = "monitoring/list/servicematrix?service_problem=1" -priority = 51 - -[Overview.Servicegroups] -title = "Servicegroups" -url = "monitoring/list/servicegroups" -priority = 60 - -[Overview.Hostgroups] -title = "Hostgroups" -url = "monitoring/list/hostgroups" -priority = 60 - -[Overview.Contactgroups] -title = "Contactgroups" -url = "monitoring/list/contactgroups" -priority = 61 - -[Overview.Downtimes] -title = "Downtimes" -url = "monitoring/list/downtimes" -priority = 70 - -[Overview.Comments] -title = "Comments" -url = "monitoring/list/comments?comment_type=(comment|ack)" -priority = 70 - -[Overview.Contacts] -title = "Contacts" -url = "monitoring/list/contacts" -priority = 70 - -[History] -icon = "img/icons/history.png" - -[History.Critical Events] -title = "Critical Events" -url = "monitoring/list/statehistorysummary" -priority = 50 - -[History.Notifications] -title = "Notifications" -url = "monitoring/list/notifications" - -[History.Events] -title = "All Events" -url = "monitoring/list/eventhistory?timestamp>=-7%20days" - -[History.Timeline] -title = "Timeline" -url = "monitoring/timeline" - -[System.Process Info] -title = "Process Info" -url = "monitoring/process/info" -priority = 120 - -[System.Performance Info] -title = "Performance Info" -url = "monitoring/process/performance" -priority = 130 - - From b764993091455da7a96554668ac0036482068345 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Fri, 22 Aug 2014 10:59:52 +0200 Subject: [PATCH 003/257] AuthenticationException: extend IcingaException refs #6931 --- .../Authentication/Backend/DbUserBackend.php | 11 +++---- .../Backend/LdapUserBackend.php | 32 +++++++------------ .../Exception/AuthenticationException.php | 4 +-- 3 files changed, 16 insertions(+), 31 deletions(-) diff --git a/library/Icinga/Authentication/Backend/DbUserBackend.php b/library/Icinga/Authentication/Backend/DbUserBackend.php index 5961028b3..95c99c346 100644 --- a/library/Icinga/Authentication/Backend/DbUserBackend.php +++ b/library/Icinga/Authentication/Backend/DbUserBackend.php @@ -73,12 +73,9 @@ class DbUserBackend extends UserBackend return ($row !== false) ? true : false; } catch (Exception $e) { throw new AuthenticationException( - sprintf( - 'Failed to authenticate user "%s" against backend "%s". An exception was thrown:', - $user->getUsername(), - $this->getName() - ), - 0, + 'Failed to authenticate user "%s" against backend "%s". An exception was thrown:', + $user->getUsername(), + $this->getName(), $e ); } @@ -125,4 +122,4 @@ class DbUserBackend extends UserBackend return ($row !== false) ? $row->count : 0; } -} \ No newline at end of file +} diff --git a/library/Icinga/Authentication/Backend/LdapUserBackend.php b/library/Icinga/Authentication/Backend/LdapUserBackend.php index fe80e900a..23a79781d 100644 --- a/library/Icinga/Authentication/Backend/LdapUserBackend.php +++ b/library/Icinga/Authentication/Backend/LdapUserBackend.php @@ -68,21 +68,17 @@ class LdapUserBackend extends UserBackend $result = $q->fetchRow(); if (! isset($result)) { throw new AuthenticationException( - sprintf( - 'No objects with objectClass="%s" in DN="%s" found.', - $this->userClass, - $this->conn->getDN() - ) + 'No objects with objectClass="%s" in DN="%s" found.', + $this->userClass, + $this->conn->getDN() ); } if (! isset($result->{$this->userNameAttribute})) { throw new AuthenticationException( - sprintf( - 'UserNameAttribute "%s" not existing in objectClass="%s"', - $this->userNameAttribute, - $this->userClass - ) + 'UserNameAttribute "%s" not existing in objectClass="%s"', + $this->userNameAttribute, + $this->userClass ); } } @@ -121,11 +117,8 @@ class LdapUserBackend extends UserBackend } catch (AuthenticationException $e) { // Authentication not possible throw new AuthenticationException( - sprintf( - 'Authentication against backend "%s" not possible: ', - $this->getName() - ), - 0, + 'Authentication against backend "%s" not possible: ', + $this->getName(), $e ); } @@ -141,12 +134,9 @@ class LdapUserBackend extends UserBackend } catch (LdapException $e) { // Error during authentication of this specific user throw new AuthenticationException( - sprintf( - 'Failed to authenticate user "%s" against backend "%s". An exception was thrown:', - $user->getUsername(), - $this->getName() - ), - 0, + 'Failed to authenticate user "%s" against backend "%s". An exception was thrown:', + $user->getUsername(), + $this->getName(), $e ); } diff --git a/library/Icinga/Exception/AuthenticationException.php b/library/Icinga/Exception/AuthenticationException.php index 91180b796..ebed296e4 100644 --- a/library/Icinga/Exception/AuthenticationException.php +++ b/library/Icinga/Exception/AuthenticationException.php @@ -4,11 +4,9 @@ namespace Icinga\Exception; -use RuntimeException; - /** * Exception thrown if an error occurs during authentication */ -class AuthenticationException extends RuntimeException +class AuthenticationException extends IcingaException { } From 968fa0a1cc3352c1769860efa357899b1b2618e8 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Fri, 22 Aug 2014 11:02:08 +0200 Subject: [PATCH 004/257] Add configuration.php to Doc Module refs #6639 --- modules/doc/configuration.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 modules/doc/configuration.php diff --git a/modules/doc/configuration.php b/modules/doc/configuration.php new file mode 100644 index 000000000..ce3f99113 --- /dev/null +++ b/modules/doc/configuration.php @@ -0,0 +1,12 @@ +menuSection($this->translate('Documentation'), array( + 'title' => 'Documentation', + 'icon' => 'img/icons/comment.png', + 'url' => 'doc', + 'priority' => 80 +)); From 49cd55eddd66321f11c7791de336f2168fd3a1f6 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 22 Aug 2014 11:06:45 +0200 Subject: [PATCH 005/257] list/hosts: cleanup, should look like list/services Quite some changes here: * Compact view should show icons too * Ignore host icons with legacy HTML hacks * Remove duplicate code * Reduce HTML * Reduce intendation for better readability * Show attempts on soft states only, even in compact view * Use the same HTML tags and styles as in list/services * Fixes nesting error on compact view --- .../views/scripts/list/hosts.phtml | 201 ++++++++---------- 1 file changed, 94 insertions(+), 107 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index a6056e149..d99df4f56 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -1,27 +1,31 @@ getHelper('MonitoringState'); -if (! $this->compact): ?> -
- tabs ?> -
- translate('Sort by') ?> sortControl->render($this) ?> - filterEditor): ?> - filterPreview ?> - -
+if ($this->compact): ?> +
+ +
+ tabs ?> +
+ translate('Sort by') ?> sortControl->render($this) ?> + filterEditor): ?> + filterPreview ?> + +
- widget('limiter')->setMaxLimit($this->hosts->count()) ?> - paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?> - selectionToolbar('multi', $this->href('monitoring/multi/host?' . $this->filter->toQueryString())) ?> -
-
- filterEditor ?> +widget('limiter')->setMaxLimit($this->hosts->count()) ?> +paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?> +selectionToolbar('multi', $this->href('monitoring/multi/host?' . $this->filter->toQueryString())) ?> +
+ +
+filterEditor ?> count() === 0) { - echo t('No hosts matching the filter'); + echo $this->translate('No hosts matching the filter'); if (! $this->compact) { echo '
'; } @@ -32,107 +36,90 @@ if ($hosts->count() === 0) { " + data-icinga-multiselect-url="href('/monitoring/multi/host') ?>" data-icinga-multiselect-data="host" > - - + util()->getHostStateName($host->host_state)); - $hostLink = $this->href('/monitoring/show/host', array('host' => $host->host_name)); + $hostStateName = strtolower($this->util()->getHostStateName($host->host_state)); + $hostLink = $this->href('/monitoring/show/host', array('host' => $host->host_name)); - if (! $this->compact) { - $icons = array(); - if (! $host->host_handled && $host->host_state > 0){ - $icons[] = $this->icon('unhandled.png', 'Unhandled'); - } + $icons = array(); + if (! $host->host_handled && $host->host_state > 0){ + $icons[] = $this->icon('unhandled.png', 'Unhandled'); + } - if ($host->host_acknowledged) { - $icons[] = $this->icon('acknowledgement.png', 'Acknowledged'); - } + if ($host->host_acknowledged) { + $icons[] = $this->icon('acknowledgement.png', 'Acknowledged'); + } - if ($host->host_is_flapping) { - $icons[] = $this->icon('flapping.png', 'Flapping'); - } + if ($host->host_is_flapping) { + $icons[] = $this->icon('flapping.png', 'Flapping'); + } - if (! $host->host_notifications_enabled) { - $icons[] = $this->icon('notification_disabled.png', 'Notifications Disabled'); - } + if (! $host->host_notifications_enabled) { + $icons[] = $this->icon('notification_disabled.png', 'Notifications Disabled'); + } - if ($host->host_in_downtime) { - $icons[] = $this->icon('in_downtime.png', 'In Downtime'); - } + if ($host->host_in_downtime) { + $icons[] = $this->icon('in_downtime.png', 'In Downtime'); + } - if (! $host->host_active_checks_enabled) { - if (! $host->host_passive_checks_enabled) { - $icons[] = $this->icon('active_passive_checks_disabled.png', 'Active And Passive Checks Disabled'); - } else { - $icons[] = $this->icon('active_checks_disabled.png', 'Active Checks Disabled'); - } - } - - if (isset($host->host_last_comment) && $host->host_last_comment !== null) { - $icons[] = $this->icon('comment.png', 'Comment: ' . $host->host_last_comment); - } + if (! $host->host_active_checks_enabled) { + if (! $host->host_passive_checks_enabled) { + $icons[] = $this->icon('active_passive_checks_disabled.png', 'Active And Passive Checks Disabled'); + } else { + $icons[] = $this->icon('active_checks_disabled.png', 'Active Checks Disabled'); } - ?> - - - + } - - - - - + if (isset($host->host_last_comment) && $host->host_last_comment !== null) { + $icons[] = $this->icon('comment.png', 'Comment: ' . $host->host_last_comment); + } + ?> + + + + + + + extraColumns as $col): ?> + + + + +
- compact): ?> -
- monitoringState($host, 'host')) ?>
-
- - prefixedTimeSince($host->host_last_state_change, true) ?> - compact): ?> - host_state > 0): ?> -
- translate( - ($host->host_state_type === '1') ? 'Hard' : 'Soft' - ) ?> host_current_check_attempt ?>/host_max_check_attempts ?> - -
-
- -
- compact): ?> - host_icon_image): ?> - img( - $this->resolveMacros($host->host_icon_image, $host), - array('align' => 'right') - ) ?> - - - - host_name ?> - host_unhandled_services) && $host->host_unhandled_services > 0): ?> - (qlink( - sprintf($this->translate('%d unhandled services'), $host->host_unhandled_services), - 'monitoring/show/services', - array( - 'host' => $host->host_name, - 'service_problem' => 1, - 'service_acknowledged' => 0, - 'service_in_downtime' => 0 - ), - array('style' => 'font-weight: normal') - ) ?>) - -
- escape(substr(strip_tags($host->host_output), 0, 10000)) ?> -
+ compact): ?> + monitoringState($host, 'host')) ?>
+ + prefixedTimeSince($host->host_last_state_change, true) ?> + host_state > 0 && (int) $host->host_state_type === 0): ?> +
+ Soft host_attempt ?> + +
+ host_icon_image && ! preg_match('/[\'"]/', $host->host_icon_image)): ?> + icon($this->resolveMacros($host->host_icon_image, $host)) ?> + + + host_name ?> + host_unhandled_services) && $host->host_unhandled_services > 0): ?> + (qlink( + sprintf($this->translate('%d unhandled services'), $host->host_unhandled_services), + 'monitoring/show/services', + array( + 'host' => $host->host_name, + 'service_problem' => 1, + 'service_acknowledged' => 0, + 'service_in_downtime' => 0 + ), + array('style' => 'font-weight: normal') + ) ?>) + +

escape(substr(strip_tags($host->host_output), 0, 10000)) ?>

+
escape($host->$col) ?>
From 7e0047d00e74a8fb7ac1a5c43cb808c27f4657f4 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Fri, 22 Aug 2014 11:07:49 +0200 Subject: [PATCH 006/257] Add Menu configuration in Monitoring Module refs #6639 --- modules/monitoring/configuration.php | 116 +++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/modules/monitoring/configuration.php b/modules/monitoring/configuration.php index 479ee525f..d4431e6e1 100644 --- a/modules/monitoring/configuration.php +++ b/modules/monitoring/configuration.php @@ -2,6 +2,8 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} +/* @var $this \Icinga\Application\Modules\Module */ + // TODO: We need to define a useful permission set for this module, the // list provided here is just an example $this->providePermission('commands/all', 'Allow to send all commands'); @@ -16,3 +18,117 @@ $this->provideConfigTab('security', array( 'title' => 'Security', 'url' => 'config/security' )); + +/* + * Problems Section + */ +$section = $this->menuSection($this->translate('Problems'), array( + 'icon' => 'img/icons/error.png', + 'priority' => 20 +)); +$section->add($this->translate('Unhandled Hosts'), array( + 'url' => 'monitoring/list/hosts?host_problem=1&host_handled=0', + 'priority' => 40 +)); +$section->add($this->translate('Unhandled Services'), array( + 'url' => 'monitoring/list/services?service_problem=1&service_handled=0&sort=service_severity', + 'priority' => 40 +)); +$section->add($this->translate('Host Problems'), array( + 'url' => 'monitoring/list/hosts?host_problem=1&sort=host_severity', + 'priority' => 50 +)); +$section->add($this->translate('Service Problems'), array( + 'url' => 'monitoring/list/services?service_problem=1&sort=service_severity&dir=desc', + 'priority' => 50 +)); +$section->add($this->translate('Current Downtimes'))->setUrl('monitoring/list/downtimes?downtime_is_in_effect=1'); + +/* + * Overview Section + */ +$section = $this->menuSection($this->translate('Overview'), array( + 'icon' => 'img/icons/hostgroup.png', + 'priority' => 30 +)); +$section->add($this->translate('Tactical Overview'), array( + 'url' => 'monitoring/tactical', + 'priority' => 40 +)); +$section->add($this->translate('Hosts'), array( + 'url' => 'monitoring/list/hosts', + 'priority' => 50 +)); +$section->add($this->translate('Services'), array( + 'url' => 'monitoring/list/services', + 'priority' => 50 +)); +$section->add($this->translate('Servicematrix'), array( + 'url' => 'monitoring/list/servicematrix?service_problem=1', + 'priority' => 51 +)); +$section->add($this->translate('Servicegroups'), array( + 'url' => 'monitoring/list/servicegroups', + 'priority' => 60 +)); +$section->add($this->translate('Hostgroups'), array( + 'url' => 'monitoring/list/hostgroups', + 'priority' => 60 +)); +$section->add($this->translate('Contactgroups'), array( + 'url' => 'monitoring/list/contactgroups', + 'priority' => 61 +)); +$section->add($this->translate('Downtimes'), array( + 'url' => 'monitoring/list/downtimes', + 'priority' => 71 +)); +$section->add($this->translate('Comments'), array( + 'url' => 'monitoring/list/comments?comment_type=(comment|ack)', + 'priority' => 70 +)); +$section->add($this->translate('Contacts'), array( + 'url' => 'monitoring/list/contacts', + 'priority' => 70 +)); + +/* + * History Section + */ +$section = $this->menuSection($this->translate('History'), array( + 'icon' => 'img/icons/history.png' +)); +$section->add($this->translate('Critical Events'), array( + 'url' => 'monitoring/list/statehistorysummary', + 'priority' => 50 +)); +$section->add($this->translate('Notifications'), array( + 'url' => 'monitoring/list/notifications' +)); +$section->add($this->translate('Events'), array( + 'title' => $this->translate('All Events'), + 'url' => 'monitoring/list/eventhistory?timestamp>=-7%20days' +)); +$section->add($this->translate('Timeline'))->setUrl('monitoring/timeline'); + +/* + * System Section + */ +$section = $this->menuSection($this->translate('System')); +$section->add($this->translate('Process Info'), array( + 'url' => 'monitoring/process/info', + 'priority' => 120 +)); +$section->add($this->translate('Performance Info'), array( + 'url' => 'monitoring/process/performance', + 'priority' => 130 +)); + +/* + +$dashboard = $this->dashboard('Current Incidents'); // Web\Widget\Dashboard\Pane +$dashboard->add('Service Problems', array( + +)); + +*/ From f757f69bd1b3beb520c7efab4882aef8e213ecf6 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Fri, 22 Aug 2014 11:10:17 +0200 Subject: [PATCH 007/257] Change Menu load from config ini files to self provided configuration refs #6639 --- application/controllers/LayoutController.php | 3 ++- application/layouts/scripts/parts/navigation.phtml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/application/controllers/LayoutController.php b/application/controllers/LayoutController.php index 8df5c2c21..952c4ee61 100644 --- a/application/controllers/LayoutController.php +++ b/application/controllers/LayoutController.php @@ -18,8 +18,9 @@ class LayoutController extends ActionController */ public function menuAction() { + $this->_helper->layout()->disableLayout(); $this->view->menuRenderer = new MenuRenderer( - Menu::fromConfig()->order(), Url::fromRequest()->without('renderLayout')->getRelativeUrl() + Menu::load(), Url::fromRequest()->without('renderLayout')->getRelativeUrl() ); } diff --git a/application/layouts/scripts/parts/navigation.phtml b/application/layouts/scripts/parts/navigation.phtml index 8b557e32f..019fba767 100644 --- a/application/layouts/scripts/parts/navigation.phtml +++ b/application/layouts/scripts/parts/navigation.phtml @@ -14,5 +14,5 @@ if (! $this->auth()->isAuthenticated()) {
-order(), Url::fromRequest()->without('renderLayout')->getRelativeUrl()); ?> +without('renderLayout')->getRelativeUrl()); ?>
From da821fd95223653e33277aeedce2f59f0f46b6eb Mon Sep 17 00:00:00 2001 From: tgelf Date: Fri, 22 Aug 2014 05:23:45 -0400 Subject: [PATCH 008/257] list/hosts: add missing host_attempt column --- modules/monitoring/application/controllers/ListController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 3e02a4757..e123cdb0f 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -87,6 +87,7 @@ class Monitoring_ListController extends Controller 'host_address', 'host_acknowledged', 'host_output', + 'host_attempt', 'host_in_downtime', 'host_is_flapping', 'host_state_type', From 18865691742e82e4b9cae0e853d1f4614c1cbcb6 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Fri, 22 Aug 2014 11:35:42 +0200 Subject: [PATCH 009/257] Implement Module self provided configuration for menus refs #6639 --- library/Icinga/Application/Modules/Module.php | 50 ++++- library/Icinga/Web/Menu.php | 183 +++++++++++++++++- 2 files changed, 230 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index 3d5e3752e..a4b87be08 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -5,6 +5,7 @@ namespace Icinga\Application\Modules; use Exception; +use Zend_Config; use Zend_Controller_Router_Route_Abstract; use Zend_Controller_Router_Route as Route; use Icinga\Application\ApplicationBootstrap; @@ -13,6 +14,7 @@ use Icinga\Application\Icinga; use Icinga\Logger\Logger; use Icinga\Util\Translator; use Icinga\Web\Hook; +use Icinga\Web\Menu; use Icinga\Web\Widget; use Icinga\Util\File; use Icinga\Exception\ProgrammingError; @@ -136,7 +138,6 @@ class Module */ private $app; - /** * Routes to add to the route chain * @@ -146,6 +147,42 @@ class Module */ protected $routes = array(); + /** + * A set of menu elements + * + * @var array + */ + protected $menuItems = array(); + + /** + * Get all Menu Items + * + * @return array + */ + public function getMenuItems() + { + $this->launchConfigScript(); + return $this->menuItems; + } + + /** + * Add a menu Section to the Sidebar menu + * + * @param $name + * @param array $properties + * @return mixed + */ + protected function menuSection($name, array $properties = array()) + { + if (array_key_exists($name, $this->menuItems)) { + $this->menuItems[$name]->setProperties($properties); + } else { + $this->menuItems[$name] = new Menu($name, new Zend_Config($properties)); + } + + return $this->menuItems[$name]; + } + /** * Create a new module object * @@ -781,4 +818,15 @@ class Module $this->routes[$name] = $route; return $this; } + + /** + * Translate a string with the global mt() + * + * @param $string + * @return mixed|string + */ + protected function translate($string) + { + return mt($this->name, $string); + } } diff --git a/library/Icinga/Web/Menu.php b/library/Icinga/Web/Menu.php index d5b7ba882..0d8cda402 100644 --- a/library/Icinga/Web/Menu.php +++ b/library/Icinga/Web/Menu.php @@ -4,6 +4,7 @@ namespace Icinga\Web; +use Icinga\Exception\ConfigurationError; use Zend_Config; use RecursiveIterator; use Icinga\Application\Config; @@ -67,20 +68,68 @@ class Menu implements RecursiveIterator public function __construct($id, Zend_Config $config = null) { $this->id = $id; + $this->setProperties($config); + } - if ($config !== null) { - foreach ($config as $key => $value) { + /** + * Set all given properties + * + * @param array|Zend_Config $props Property list + */ + public function setProperties($props = null) + { + if ($props !== null) { + foreach ($props as $key => $value) { $method = 'set' . implode('', array_map('ucfirst', explode('_', strtolower($key)))); if (method_exists($this, $method)) { $this->{$method}($value); + } else { + throw new ConfigurationError( + sprintf('Menu got invalid property "%s"', $key) + ); } } } + return $this; + } + + /** + * Get Properties + * + * @return array + */ + public function getProperties() + { + $props = array(); + $keys = array('url', 'icon', 'priority', 'title'); + foreach ($keys as $key) { + $func = 'get' . ucfirst($key); + if (null !== ($val = $this->{$func}())) { + $props[$key] = $val; + } + } + return $props; + } + + /** + * Whether this Menu conflicts with the given Menu object + * + * @param Menu $menu + * @return bool + */ + public function conflictsWith(Menu $menu) + { + if ($menu->getUrl() === null || $this->getUrl() === null) { + return false; + } + return $menu->getUrl() !== $this->getUrl(); } /** * Create menu from the application's menu config file plus the config files from all enabled modules * + * THIS IS OBSOLATE. LEFT HERE FOR FUTURE USE WITH USER-SPECIFIC MODULES + * * @return self */ public static function fromConfig() @@ -100,6 +149,63 @@ class Menu implements RecursiveIterator return $menu->loadSubMenus($menu->flattenConfigs($menuConfigs)); } + /** + * Create menu from the application's menu config plus menu entries provided by all enabled modules + * + * @return self + */ + public static function load() + { + /** @var $menu \Icinga\Web\Menu */ + $menu = new static('menu'); + $menu->addMainMenuItems(); + $manager = Icinga::app()->getModuleManager(); + foreach ($manager->getLoadedModules() as $module) { + /** @var $module \Icinga\Application\Modules\Module */ + $menu->mergeSubMenus($module->getMenuItems()); + } + return $menu->order(); + } + + /** + * Add Applications Main Menu Items + */ + protected function addMainMenuItems() + { + $this->add(t('Dashboard'), array( + 'url' => 'dashboard', + 'icon' => 'img/icons/dashboard.png', + 'priority' => 10 + )); + + $section = $this->add(t('System'), array( + 'icon' => 'img/icons/configuration.png', + 'priority' => 200 + )); + $section->add(t('Preferences'), array( + 'url' => 'preference', + 'priority' => 200 + )); + $section->add(t('Configuration'), array( + 'url' => 'config', + 'priority' => 300 + )); + $section->add(t('Modules'), array( + 'url' => 'config/modules', + 'priority' => 400 + )); + $section->add(t('ApplicationLog'), array( + 'url' => 'list/applicationlog', + 'priority' => 500 + )); + + $this->add(t('Logout'), array( + 'url' => 'authentication/logout', + 'icon' => 'img/icons/logout.png', + 'priority' => 300 + )); + } + /** * Set the id of this menu * @@ -253,6 +359,79 @@ class Menu implements RecursiveIterator return $subMenu; } + /** + * Set required Permissions + * + * @param $permission + * @return $this + */ + public function requirePermission($permission) + { + // Not implemented yet + return $this; + } + + /** + * Merge Sub Menus + * + * @param array $submenus + * @return $this + */ + public function mergeSubMenus(array $submenus) + { + foreach ($submenus as $menu) { + $this->mergeSubMenu($menu); + } + return $this; + } + + /** + * Merge Sub Menu + * + * @param Menu $menu + * @return mixed + */ + public function mergeSubMenu(Menu $menu) + { + $name = $menu->getId(); + if (array_key_exists($name, $this->subMenus)) { + /** @var $current Menu */ + $current = $this->subMenus[$name]; + if ($current->conflictsWith($menu)) { + while (array_key_exists($name, $this->subMenus)) { + if (preg_match('/_(\d+)$/', $name, $m)) { + $name = preg_replace('/_\d+$/', $m[1]++, $name); + } else { + $name .= '_2'; + } + } + $menu->setId($name); + $this->subMenus[$name] = $menu; + } else { + $current->setProperties($menu->getProperties()); + foreach ($menu->subMenus as $child) { + $current->mergeSubMenu($child); + } + } + } else { + $this->subMenus[$name] = $menu; + } + + return $this->subMenus[$name]; + } + + /** + * Add a Menu + * + * @param $name + * @param array $config + * @return Menu + */ + public function add($name, $config = array()) + { + return $this->addSubMenu($name, new Zend_Config($config)); + } + /** * Return whether a sub menu with the given id exists * From aba5b1c80d61d2120ed6373751127a145d7075fb Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Fri, 22 Aug 2014 11:40:20 +0200 Subject: [PATCH 010/257] Remove menu.ini from icingaweb2.spec refs #6639 --- icingaweb2.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/icingaweb2.spec b/icingaweb2.spec index cfdcdafc2..d7cc53ed9 100644 --- a/icingaweb2.spec +++ b/icingaweb2.spec @@ -181,9 +181,6 @@ install -D -m0644 packages/rpm/etc/httpd/conf.d/icingaweb.conf %{buildroot}/%{ap %{__cp} -r application library modules public %{buildroot}/%{sharedir}/ ## config -# use the default menu.ini for application and monitoring mobule -install -D -m0644 config/menu.ini %{buildroot}/%{_sysconfdir}/icingaweb/menu.ini -install -D -m0644 config/modules/monitoring/menu.ini %{buildroot}/%{_sysconfdir}/icingaweb/modules/monitoring/menu.ini # authentication is db only install -D -m0644 packages/rpm/etc/icingaweb/authentication.ini %{buildroot}/%{_sysconfdir}/icingaweb/authentication.ini # custom resource paths From 9c5878cbbe2516b8b17b470136cb2652f4700560 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Fri, 22 Aug 2014 11:46:11 +0200 Subject: [PATCH 011/257] ConfigurationError: extend IcingaException refs #6931 --- .../Icinga/Application/Modules/Manager.php | 16 ++++++----- library/Icinga/Authentication/AuthChain.php | 4 ++- library/Icinga/Authentication/UserBackend.php | 28 +++++++++++-------- library/Icinga/Data/Db/DbConnection.php | 5 +++- library/Icinga/Data/ResourceFactory.php | 8 ++++-- .../Icinga/Exception/ConfigurationError.php | 2 +- library/Icinga/Logger/Logger.php | 5 +++- library/Icinga/Logger/Writer/FileWriter.php | 11 ++++++-- library/Icinga/Logger/Writer/SyslogWriter.php | 3 +- .../Commandpipe/Transport/LocalPipe.php | 8 ++---- library/Icinga/Protocol/Statusdat/Reader.php | 6 ++-- .../User/Preferences/PreferencesStore.php | 3 +- library/Icinga/Web/Widget/Dashboard/Pane.php | 2 +- .../controllers/CommandController.php | 2 +- .../monitoring/library/Monitoring/Backend.php | 5 ++-- 15 files changed, 68 insertions(+), 40 deletions(-) diff --git a/library/Icinga/Application/Modules/Manager.php b/library/Icinga/Application/Modules/Manager.php index 28241adc3..366f77c30 100644 --- a/library/Icinga/Application/Modules/Manager.php +++ b/library/Icinga/Application/Modules/Manager.php @@ -206,10 +206,8 @@ class Manager { if (!$this->hasInstalled($name)) { throw new ConfigurationError( - sprintf( - 'Cannot enable module "%s". Module is not installed.', - $name - ) + 'Cannot enable module "%s". Module is not installed.', + $name ); } @@ -268,14 +266,18 @@ class Manager } $link = $this->enableDir . '/' . $name; if (!file_exists($link)) { - throw new ConfigurationError('Could not disable module. The module ' . $name . ' was not found.'); + throw new ConfigurationError( + 'Could not disable module. The module %s was not found.', + $name + ); } if (!is_link($link)) { throw new ConfigurationError( - 'Could not disable module. The module "' . $name . '" is not a symlink. ' + 'Could not disable module. The module "%s" is not a symlink. ' . 'It looks like you have installed this module manually and moved it to your module folder. ' . 'In order to dynamically enable and disable modules, you have to create a symlink to ' - . 'the enabled_modules folder.' + . 'the enabled_modules folder.', + $name ); } diff --git a/library/Icinga/Authentication/AuthChain.php b/library/Icinga/Authentication/AuthChain.php index 216344735..4ab87f7ae 100644 --- a/library/Icinga/Authentication/AuthChain.php +++ b/library/Icinga/Authentication/AuthChain.php @@ -97,7 +97,9 @@ class AuthChain implements Iterator } catch (ConfigurationError $e) { Logger::error( new ConfigurationError( - 'Cannot create authentication backend "' . $name . '". An exception was thrown:', 0, $e + 'Cannot create authentication backend "%s". An exception was thrown:', + $name, + $e ) ); $this->next(); diff --git a/library/Icinga/Authentication/UserBackend.php b/library/Icinga/Authentication/UserBackend.php index f90eef1c7..9e7abd62a 100644 --- a/library/Icinga/Authentication/UserBackend.php +++ b/library/Icinga/Authentication/UserBackend.php @@ -54,16 +54,18 @@ abstract class UserBackend implements Countable // Use a custom backend class, this is only useful for testing if (!class_exists($backendConfig->class)) { throw new ConfigurationError( - 'Authentication configuration for backend "' . $name . '" defines an invalid backend' - . ' class. Backend class "' . $backendConfig->class. '" not found' + 'Authentication configuration for backend "%s" defines an invalid backend class.' + . ' Backend class "%s" not found', + $name, + $backendConfig->class ); } return new $backendConfig->class($backendConfig); } if (($backendType = $backendConfig->backend) === null) { throw new ConfigurationError( - 'Authentication configuration for backend "' . $name - . '" is missing the backend directive' + 'Authentication configuration for backend "%s" is missing the backend directive', + $name ); } $backendType = strtolower($backendType); @@ -74,8 +76,8 @@ abstract class UserBackend implements Countable } if ($backendConfig->resource === null) { throw new ConfigurationError( - 'Authentication configuration for backend "' . $name - . '" is missing the resource directive' + 'Authentication configuration for backend "%s" is missing the resource directive', + $name ); } try { @@ -100,22 +102,24 @@ abstract class UserBackend implements Countable case 'ldap': if (($userClass = $backendConfig->user_class) === null) { throw new ConfigurationError( - 'Authentication configuration for backend "' . $name - . '" is missing the user_class directive' + 'Authentication configuration for backend "%s" is missing the user_class directive', + $name ); } if (($userNameAttribute = $backendConfig->user_name_attribute) === null) { throw new ConfigurationError( - 'Authentication configuration for backend "' . $name - . '" is missing the user_name_attribute directive' + 'Authentication configuration for backend "%s" is missing the user_name_attribute directive', + $name ); } $backend = new LdapUserBackend($resource, $userClass, $userNameAttribute); break; default: throw new ConfigurationError( - 'Authentication configuration for backend "' . $name. '" defines an invalid backend' - . ' type. Backend type "' . $backendType . '" is not supported' + 'Authentication configuration for backend "%s" defines an invalid backend type.' + . ' Backend type "%s" is not supported', + $name, + $backendType ); } $backend->setName($name); diff --git a/library/Icinga/Data/Db/DbConnection.php b/library/Icinga/Data/Db/DbConnection.php index af9cce05c..da05a429f 100644 --- a/library/Icinga/Data/Db/DbConnection.php +++ b/library/Icinga/Data/Db/DbConnection.php @@ -142,7 +142,10 @@ class DbConnection implements Selectable } break;*/ default: - throw new ConfigurationError(sprintf('Backend "%s" is not supported', $this->dbType)); + throw new ConfigurationError( + 'Backend "%s" is not supported', + $this->dbType + ); } $this->dbAdapter = Zend_Db::factory($adapter, $adapterParamaters); $this->dbAdapter->setFetchMode(Zend_Db::FETCH_OBJ); diff --git a/library/Icinga/Data/ResourceFactory.php b/library/Icinga/Data/ResourceFactory.php index 1db623e17..b7156bb50 100644 --- a/library/Icinga/Data/ResourceFactory.php +++ b/library/Icinga/Data/ResourceFactory.php @@ -39,7 +39,8 @@ class ResourceFactory implements ConfigAwareFactory self::assertResourcesExist(); if (($resourceConfig = self::$resources->get($resourceName)) === null) { throw new ConfigurationError( - 'Cannot load resource config "' . $resourceName . '". Resource does not exist' + 'Cannot load resource config "%s". Resource does not exist', + $resourceName ); } return $resourceConfig; @@ -113,7 +114,10 @@ class ResourceFactory implements ConfigAwareFactory $resource = new FileReader($config); break; default: - throw new ConfigurationError('Unsupported resource type "' . $config->type . '"'); + throw new ConfigurationError( + 'Unsupported resource type "%s"', + $config->type + ); } return $resource; } diff --git a/library/Icinga/Exception/ConfigurationError.php b/library/Icinga/Exception/ConfigurationError.php index 988246f5f..aee601a62 100644 --- a/library/Icinga/Exception/ConfigurationError.php +++ b/library/Icinga/Exception/ConfigurationError.php @@ -8,6 +8,6 @@ namespace Icinga\Exception; * Class ConfigurationError * @package Icinga\Exception */ -class ConfigurationError extends \RuntimeException +class ConfigurationError extends IcingaException { } diff --git a/library/Icinga/Logger/Logger.php b/library/Icinga/Logger/Logger.php index 31b0452d2..87811ae69 100644 --- a/library/Icinga/Logger/Logger.php +++ b/library/Icinga/Logger/Logger.php @@ -79,7 +79,10 @@ class Logger { $class = 'Icinga\\Logger\\Writer\\' . ucfirst(strtolower($config->type)) . 'Writer'; if (!class_exists($class)) { - throw new ConfigurationError('Cannot find log writer of type "' . $config->type . '"'); + throw new ConfigurationError( + 'Cannot find log writer of type "%s"', + $config->type + ); } return new $class($config); diff --git a/library/Icinga/Logger/Writer/FileWriter.php b/library/Icinga/Logger/Writer/FileWriter.php index fef2e8bc7..2795b3541 100644 --- a/library/Icinga/Logger/Writer/FileWriter.php +++ b/library/Icinga/Logger/Writer/FileWriter.php @@ -33,13 +33,20 @@ class FileWriter extends LogWriter $this->path = $config->target; if (substr($this->path, 0, 6) !== 'php://' && false === file_exists(dirname($this->path))) { - throw new ConfigurationError('Log path "' . dirname($this->path) . '" does not exist'); + throw new ConfigurationError( + 'Log path "%s" does not exist', + dirname($this->path) + ); } try { $this->write(''); // Avoid to handle such errors on every write access } catch (Exception $e) { - throw new ConfigurationError('Cannot write to log file "' . $this->path . '" (' . $e->getMessage() . ')'); + throw new ConfigurationError( + 'Cannot write to log file "%s" (%s)', + $this->path, + $e->getMessage() + ); } } diff --git a/library/Icinga/Logger/Writer/SyslogWriter.php b/library/Icinga/Logger/Writer/SyslogWriter.php index fea20b592..8f7711a8a 100644 --- a/library/Icinga/Logger/Writer/SyslogWriter.php +++ b/library/Icinga/Logger/Writer/SyslogWriter.php @@ -45,7 +45,8 @@ class SyslogWriter extends LogWriter { if (!array_key_exists($config->facility, $this->facilities)) { throw new ConfigurationError( - 'Cannot create syslog writer with unknown facility "' . $config->facility . '"' + 'Cannot create syslog writer with unknown facility "%s"', + $config->facility ); } diff --git a/library/Icinga/Protocol/Commandpipe/Transport/LocalPipe.php b/library/Icinga/Protocol/Commandpipe/Transport/LocalPipe.php index ecf1a981c..32f745565 100644 --- a/library/Icinga/Protocol/Commandpipe/Transport/LocalPipe.php +++ b/library/Icinga/Protocol/Commandpipe/Transport/LocalPipe.php @@ -49,11 +49,9 @@ class LocalPipe implements Transport $file->fflush(); } catch (Exception $e) { throw new ConfigurationError( - sprintf( - 'Could not open icinga command pipe at "%s" (%s)', - $this->path, - $e->getMessage() - ) + 'Could not open icinga command pipe at "%s" (%s)', + $this->path, + $e->getMessage() ); } diff --git a/library/Icinga/Protocol/Statusdat/Reader.php b/library/Icinga/Protocol/Statusdat/Reader.php index e9b767127..6891e7ba8 100644 --- a/library/Icinga/Protocol/Statusdat/Reader.php +++ b/library/Icinga/Protocol/Statusdat/Reader.php @@ -246,7 +246,8 @@ class Reader implements IReader, Selectable { if (!is_readable($this->config->object_file)) { throw new ConfigurationError( - 'Can\'t read object-file "' . $this->config->object_file . '", check your configuration' + 'Can\'t read object-file "%s", check your configuration', + $this->config->object_file ); } if (!$this->parser) { @@ -265,7 +266,8 @@ class Reader implements IReader, Selectable { if (!is_readable($this->config->status_file)) { throw new ConfigurationError( - "Can't read status-file {$this->config->status_file}, check your configuration" + 'Can\'t read status-file %s, check your configuration', + $this->config->status_file ); } if (!$this->parser) { diff --git a/library/Icinga/User/Preferences/PreferencesStore.php b/library/Icinga/User/Preferences/PreferencesStore.php index 81d47b394..749d054dc 100644 --- a/library/Icinga/User/Preferences/PreferencesStore.php +++ b/library/Icinga/User/Preferences/PreferencesStore.php @@ -127,7 +127,8 @@ abstract class PreferencesStore $storeClass = 'Icinga\\User\\Preferences\\Store\\' . $type . 'Store'; if (!class_exists($storeClass)) { throw new ConfigurationError( - 'Preferences configuration defines an invalid storage type. Storage type ' . $type . ' not found' + 'Preferences configuration defines an invalid storage type. Storage type %s not found', + $type ); } diff --git a/library/Icinga/Web/Widget/Dashboard/Pane.php b/library/Icinga/Web/Widget/Dashboard/Pane.php index 5e3e8ffea..05d121385 100644 --- a/library/Icinga/Web/Widget/Dashboard/Pane.php +++ b/library/Icinga/Web/Widget/Dashboard/Pane.php @@ -157,7 +157,7 @@ class Pane extends AbstractWidget } elseif (is_string($component) && $url !== null) { $this->components[$component] = new Component($component, $url, $this); } else { - throw new ConfigurationError('Invalid component added: ' . $component); + throw new ConfigurationError('Invalid component added: %s', $component); } return $this; } diff --git a/modules/monitoring/application/controllers/CommandController.php b/modules/monitoring/application/controllers/CommandController.php index bb1abcc74..f3055371a 100644 --- a/modules/monitoring/application/controllers/CommandController.php +++ b/modules/monitoring/application/controllers/CommandController.php @@ -114,7 +114,7 @@ class Monitoring_CommandController extends Controller if ($targetConfig->get($instance)) { $this->target = new CommandPipe($targetConfig->get($instance)); } else { - throw new ConfigurationError('Instance is not configured: '. $instance); + throw new ConfigurationError('Instance is not configured: %s', $instance); } } else { if ($targetConfig && $targetInfo = $targetConfig->current()) { diff --git a/modules/monitoring/library/Monitoring/Backend.php b/modules/monitoring/library/Monitoring/Backend.php index 21f2b91db..8131e7c1c 100644 --- a/modules/monitoring/library/Monitoring/Backend.php +++ b/modules/monitoring/library/Monitoring/Backend.php @@ -87,12 +87,13 @@ class Backend implements Selectable, Queryable, ConnectionInterface $backendConfig = $defaultBackend; } else { if (!array_key_exists($backendName, $allBackends)) { - throw new ConfigurationError('No configuration for backend ' . $backendName); + throw new ConfigurationError('No configuration for backend %s', $backendName); } $backendConfig = $allBackends[$backendName]; if ((bool) $backendConfig->get('disabled', false)) { throw new ConfigurationError( - 'Configuration for backend ' . $backendName . ' available but backend is disabled' + 'Configuration for backend %s available but backend is disabled', + $backendName ); } } From c31972b99c5982e521475bd56bec12ef2494b3ea Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 22 Aug 2014 17:26:20 +0200 Subject: [PATCH 012/257] translation: refresh monitoring module --- .../locale/de_DE/LC_MESSAGES/monitoring.mo | Bin 9748 -> 32307 bytes .../locale/de_DE/LC_MESSAGES/monitoring.po | 1177 ++++++++++++----- 2 files changed, 849 insertions(+), 328 deletions(-) diff --git a/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.mo b/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.mo index 2b779c0995c80bd9c61710ab6fb6ca451a5453a2..d1feb7e365179aaa04ff0aefa9b70503808dfd46 100644 GIT binary patch literal 32307 zcmdsnX_l+FlWvg&ORr@ z3_`VP(R!(PsVFK|gBA7d`?m6eRJ4V$wVDmM;Z2)-UvfA0kk1^))rI6e=m-hT!mW$-j8y8H+{ z4}2Cx(D;^t$AedcM}RxP!@<3v`akS&(%~(j>ia`b<=+9Sy^nw@{|Og=7}U7G2wnz$ z4ZIXQ=3GmM_24Svb#OKKAyE0AaPcM2vGMCb(czUY{z*{v{0LO}^BIij`a&##EP!tS)vpIY(eojYCW9}5bTRlTsCrL2KM0nCn?R-_sDYx(TS1NY zP8Yw&;a`BN?~|bD{5eqdJpn!mJ_8;CK6!zq_fw$e`In%|9ktAk;|x%Iw9Vl#D1MoC z@wbEGzmI^T*DOfY!LPs`Fr?ELf!jf)-|XTa0G~_z3t%sJFwCR;eIWmWgg+O9?*p#| zzW^Q%9z$i~x06Bj|1wbNYe4bGdQft=0~B3e1~N6l1gL)B4vIfN2CAMww)b131FoSg_N{bEq^)dyRWJc(z;A&^gD-_R$AD!}^K&zJD0n-laoz!Hd>;po1iu6x z20j6bo=<_|$E7f<#$5uB0;}L+@D-ryf1|@Y!IOx81XTYX0*?hBb@9hQ@!7XQwfA#S z{W%!s75$C?rT?A-qN0Mepyd2zp!!t(Z%7+7br%HR{=55VhS)*`qDVOM|e0@dzELG|lChmU|7$K#;r z`Yll7{~f4t9riri|8u}4#Fv9Ae>JH3c7T%C>mADsvs;Cyb)CX2SDZf2B`WExx&uddEl|cF9k){eo*te4OITU4qpk1-X8+RKlg&- zzehpots~Z0`P&G>a={dMF!&)*@^TM&8u)QgeD(!U@4pYK-5-F;_X|+;I_OG^iySTi zHIHY2%6~2>e!CF70K5W(g@Oo#RfD&J8rQ=P|H0w6LDBhVpy)1TtMM)Y)o$qG%fVBK zuLe&7w}WbL1QfqFK$U+jDE_>|y}uuXg@V6z>AwcmpHm@{+T9GQUxT3ZYwY5;fs*e# zK#lKV@HFsIQ1w3rnt6lh#}Plz;cADQK$Y7Is{SER^Ob<7gRgS&_d5J2sPR4kYJ3la z%J+3p?feW>eJ5UP+dmUj|E~fy{*9pezXw!*ra|%j8$i|fR`5*l9&jW0Sy1#_yw>vZ zS)kgx7F4isCVn=kcFqMwzjdJaXD6uqF(|z<0V@AAsC=&gRqq=?<$IUI zKLN#`_kg0y!=TDP4T^q021WlvH(R=&2dduZI$RCD5IS7}o=o~%ue0O&2&njHz-RIP zaZvN}->Ij1^56c`aKPb zZodQ7&trF3J~<6kJfl^p)ag@MaLz8+;DD1UwWWSP5PMq6&f=9Nq)M z0>O7dSSPr2kiLVrf*R*vflI(gK+*9DQ2jc5x25}Pa24@sQ1tpJsCoDrD0+MgJRJP7 z!{2}>5I+PVJRUq1>;YGR&w)R$2M;0sdwcBsy#^HDzaKmf{4^-O`64JjTl7MUOF_-| zT2ONNVo>E?0d57~4PFL*2NZvu`68>wUjnM%ZvvkS{w1jK{BMvc2*SNKej})SA9VOd zQ2OLQLGk0d>uq}jp!#11HSQZh&G!tr72>gO@O_~A{Z&x&_HA$)`~~{*vsv@aRMlQxClHGTn&ccAgJ*+ zK=IjaAX6IL4$}4D-@s>q8zNipb)e|C2NYk8I@||}pI!@!-tPvF1wZKG_kzm*DNyA< z530S#LDB1J@GS7)A!~1)1B%Xlpz3=GsQDWKHP3ZW`CkcY9`17K_k+?av!L|)BjDBG zm%vGI@i1i%q8#{6;y)|e^f$%WR>Xe?p3M7wBg_%;H;>x(ehI4mL&hvUj|a~nz8q9L z8(e$!A4I2pU!VN>F-Y9J~g6kHg0to_2%P zCoclUPj3XT03QHXgFgW!XBUp!`d$uRK>RJB=H(Nh`uT{9e-%`F-vtZcsb$;GjiBaX zFL)i8fSbTigKF=v39B!A!GnoUgNwjdfG2{tfhzxA_x?Um^m+h10(=Nm{?CDjga72> z{{m_r{~eUv{SXxY`~o~5JhWoxwE$j4d>qucKJ4%ThmV44=P~dk@F`IA|1GHY7FR7_ zp8{$=mx9W-4%B?T2ozsWfEv&5gOZ;+-23~$HN+ov>Cc|D`sg{J#x(}2UkMn3uK~rc zcZ27Fp8}QdUqSKne>gnqMyo$B0vD6M#o_g!%8!Gh?vFuK zPjE_N`*{<1A@R3>8t*4T&F7P#==vQ{^!_a#p4cEod`QP$<5_l0P{?_kN3uZm8 z@Vw2%1rNLDUuM$Y%kx_5_!xLP_!xL3sNY71%fZKqzmzaQ&|GT%t|z>Rpx@UBZy%|e+L!`>j{5P@V}FJxP}0`n)Uy9@NWrk zA$*81LHH|zc>fCO`4{jkf_~D|zcEkt&szb+H2q!Ro-U`H|6RaymB>cIKNGGcJ_`Pj za2(G!f%=_B_yFN2gkwlQK}a~4XGA{u2;tL&PZ3TeZ5iQCo-ZW)FM@uEeEPdJeXi3|9;AwC*;X8yf;V%h`U7pYK zyoBf1fYO!v{S)CN^Mq~f@Ggha~O8P0`*~HHytWg5L=UNC3C#^tuG4Wpzp2zba zf@iq*!{A!NYYDF>EaLsC;LixtgufvKq&)@nfd2PQ9!_)dQ+VD$_yXaN39CszmC(oY zUla7Zk#IBNI#=ciCGz{Q1>@5`pLeIb_#r$W!SgEc-@t-PzX5#6J#XTje%c2eO<3XL zN|SBa1O5ZyPn5t<`}scyKWSq2&$+-kgf|kdwMj;A%ZG9z@kwIP1U5Hgv&NXm0~$AF3+d#u8if=cg3}RrQtYNVDm^g zU2TL@)!KMCRjQAL)%sXm3!~yhsZvVnwWwaLB__*6G#!qVD#fr=4;x85(kO@ZYM6{g zwKyzQMyj=ms9vg8!f2@4sE1KFM&H6}Elg~yVSOyBhovMOi}sZ&qv2$&I#iA)lCU%q zPE@Ib_m!|(iNmVxlG+=JP0y5{noISba9cDUhe?C{>ULbItFz%ytrU-h#W)$Rl_pIu zsANhFDwld#tWrr&5blU8MO9}g*Nl471mW&VEsloAB0ASj-VQIbRL;KkHD+h0^ZRTK zd!kxJ-Ro4k{avQy(xU5a-}XHNK^oi9KhU>%U}H03_rT8n-u0V$*KO_3B<|3&$W*D; z!{M=bcswS~ESAgu&194$rG0UE+P~Kern7SiUUV$b@I2|+A_LvGZPpjVx66~JCe*Ww|?qtR;6J3Jgu)_o5xrs35I;I_A>w^6y7s}|qbh!fgv&8lYW%&>!Sz1V=nVlf=9PS~ayM*lt< zC7DOt@wg&cp*m9h+)$!2QW`}}ixONjfy$lFl$LDN$C&12FJd;sfoLLL9;~ZXqvCKx ziS;`-4{l!HyEQQV3AZ=ulMPbUxo~HkG|E1*i_*ifdox&?@Q?9L@o>ZFgnBcv9M$8> z@U+Vfv3V+$i{bX68<>>;L&c57#fAtzSApa}O2nE{I;%wlWxvqjbSXB^ct*<6B$~PonYCIhw6QM5=4ouA zS}C!BNu#pfu=KgnLB@JitD`rVcstdtlO>fhl4_-ecC&M-d3sqLO6Zw7xzJ|XOU%=R zQ^uBKQDKss=1fOM>2+tRxl7lu1(G=m$2DUdRECj|s2=&5IFRv9E})M2D3G21WDFCf zhy`V4AMW=EXO`hjD_oL_IrOI(M_Hy=afTz2ARL;;7*V}aH9cvitvSTZlN!HtVn*|K zErC_lTy4~7OHND{tt4u`BIB%pcZ`5iUmJCb{ zgRG6DUY#(Dte1$qv~$Q^6I>`!* z!`K+QtUFYcs|*_fOUSX)iZHHosm54UeQ_C^bReS`g7&0DX|PaAKOc`mi8xlJ=MSVE zds{;(6|tjb&tp5Y0QcE-B(&>sXx2Kab*W|n4z0;wOH(&^mg@7WHGP%saI=~n8IkHk zEYs}ywJo*346Cw4V1+krFbLy%)umL`tf$?wq5q9K7_CJUg{e{z!!Jro++Fgu=9U;| z3$i5`t3t+P8Y^aE?!4HItvyI(uek=LV_ZPqdApot%fxh{3NK=zI-b zayQ4_TnpySn$zQuWor)l@*U!m*M1ZP{RyY1PNpnoDNm4kj`@3si1OU%or zOY9(;?oD1YU1FPHy7Vp*)T-7y%8a0O%4K*>nl3N8F6%->vU}F~ zy1PJeat$m%nq1C>3X{)n?T-VNC8Qx7)W(GemiS`2D)$@T2hJM192Oh+YGhGsy@S#| zV~<-^t!)`KSjox9!q38Njh$TfFdC6d#jLw#*^FD1OPaF~420FMZ4}+cp)EHJiWKZ`h2mm>pHytCpR9 zza68cym?N74cg~nrii?DTZXN{ZZwo(Ar&`P8XnV1-e4zb&5@!k6KB@s%C{-g1=n#C z8Vi*&iW^VES?(il046>eHq8L3pXP>3xiis}UP_ipYTg^$6q|2y(zF%dRAPtE8~YIU zIaUic7-P)XC-%7*Y%EuY*kEZAY{Hm>%8KEd ztBhilZo)fRtxX4;)RObLkg6DKMm@HVS>e|LR;m`wivosn(RAn;o*qgv-=eF4hlh zjhSg#&}=&}mctRx7-`L>Ec?qbUzhU%v#*ecA;K!C6t-`1Q@SjvPQ*r$EWG^^?rzh$ zGEO3DOu}*%5d_uuoHCU0pE`?s!olqOky2bPCVq|(0kd7H;pi6C{CLv2OzEoi&g@E7 zuk(d@<~?NbLnu=70Z z_oq@@dBrbhmEGtXa#iA+T(7LEl3&-kNTm7w8G$%h-EL)J*tF=j0a~n@guoZ!^gwH&h29b4}Bu(33`X;pu2V3J&G(fNwg&S@k33oLnC#yBN z8=U7Xv9GWw(ubyV+uQovN|i<(wY{zBk=uaN0uOO64Mi?5T`(YyG~5vkRK1=~LQEI7 z5XiY`G*T*~P4wPTYmWEE1=97sm-DU}IDpV%6Gr>k0hptq)a0=PR4;rclpI;RbT!Rn z+~{3%X&JL?(Og-&_BShrc~?#AfeQW3X6{;}m)*HLl`h|1MxQh=kT@HVLkg0yyfocf zMU#-k=0)myRbm>!s*wj~nPaAKLk+joKy_+)J{PKuT{1$F8VUHM-s9@`_7uB9!HExfgs{Au;uw*=e0uetdYN*P;=%`P*oul(Hm zx8uR~3JXXyZ4e)Oeat*zI@nj!aa0SoQ|rD`JQeJSMiJ8;_WaPJ_iDLhw-Q*#baU#G z#?VBmE`Mw;pY^L)!^b$7Qqp)&cF#f!RBip_Z}o>|6E<_coy&n@jFf=4ii4zj=Fw^Lwdw$YH`WF(tI@WrM#wJmMr&4 z&OYu|q0^r}w^xT$5ROR145d3tK#wnjg{tHHtUzbG+~svs8(EfBb^d@W^JtkRn_w&! zYdw^pa8b5#d0IK*de~cMKQ?5R8=EjuEuuqMv7+>iY-@>fF&>FH3o#8FR}&?S;oE+6 zq}t6ZEj|bQx+mC0e`W18m*OmNHLc-JT|vF?uFa!_*f;Q)cl6Wy>ojT z7ehnWN;mmxlk@>m!cLV1V0K=+I4M!@It@5|*M%UvFcUbF2zD8&*^_lG-d>j1+Y@H{ z+U&ILW9ox(CDXXoR2jL4sH!_-sxuI!2uj1_(`_8Ti(M^=I{)w372am1wp2;#lFFWt zvuV`QKCCnDyqNKD4JI0uWoAS~BBZ@ixm4lc$F!1myCvFb6h_bG2@}F@I^Eu7{M^By z{C~J@!c?yg#uFG~QLQ9Tj!;nK^T`rzVsr**$O0 zYIhrN#~MR18p|ET$X3f$j5X?|*f>BkM>9R9i<1!^e-0{Y;me&haDm-(+}Mz_i9A%X z-Kh2p5_>QeZgLxb^Ujl-Z06vNS;?3Zt>Q{r<`FFDIKQ89I?Sjb-1PLh`4&eUeayj7^3Ebjc0nNij$IV zW$oNbFpaA8`ZqUC{zjHRHtSxSpUrefY!tWYj^EWKJ@N~A+uWUaWCSz6QKla{tt++= z+T0v7#8%HEu|*-1&i5YE_ODp{9=K5{ww0FILDb>` zcXk?XXJ~G|$cq3Oj3+_94d;}ZqiGQvX6kU1Yq`6fx5C}_mY+7C6LF1A;BYB+P93#b ziJ=HwX-Lc7NLL2o&Jl=VZ)-sjIY7h{k=Lpeu?KeWr?J8NUXGGK0~ z72~MP`9BM0W(b&jhzW!ek6ZU(%UheMDvfHc^S31jYDuNB3!Q=4{=V&9-er}sp;NAA zJa*~IG;BDR7h;c0vTLuUPTgZLHHb*f&YL>A531cgm~PFQVx0EPy8v0V3Whv%jF)Cn z)4Zj$YOi*#?y0=pHc+wkOYwjhrS*w@SZs2-*{W9wKlf(aU*cKRde7HLrBU`cPz7se z_rR6`-NDS>wA{TT*j+(KaBZubi#xr`8E%r6C%-+@NWIib(srN%rdL#h-ID=g8un+7 zD~Q+9jmMteoddc6>MoB4d)!?$bc)*+>O^B{!WU#*zN^Gj>3Y+gq;wM|Ew{9YDA(eE zo3_>-F^+u0%t2bD)~J|ktj3nyvAIvB0>{+uT~Hklsuk^rbmOkDxmb9CxV>6g6K-qz zh_+RY#k}m2o|Qc-Z;i^6W6`C{7wwGYfhufEMoY!Qy2fZy7_6?rl;5|uWN(mEYom*H zY#%JF*Top>Ec7ARYr;!buDZ0a^76tZmxQZUuUU2ZMJq2^xsr^9o$3xjbq zu_oNwJFszg@5cV{s;yhsmP;nlAUPDotuHKnex-op3OIt zpU}DT%)!}u%JVNZaCwIqu_rS*f9Xn^=vtdwI!flR$&FeP}hW$Ht z_Vci=cW3hrs*qe$ag8|)D~4WX-lw2^J@d-0_?9P{?@F8lb}Xb99gAd#5T{HOp#0at zuJD7pz*S{KkEw>~*2wIGHMUe(2#IIMPzM%pKV3}HT66_{SG^%#4*JDstyPAdYBG($ ze_G4nJDI3BJ$uJzv?oQnQe#J?w5|{CTerXV^R?b?qv38V=uc8g-Gp81ERy+x@*qDh$xQoB}>A+cEv4w zMydo_n+xe~teWl#^FADRx7U?}L3_EgHTYPVsf1e<++XiQ*Rzk%YSqm6_ijImITCNrp0_cohcj2dyxrEg_ztIPz~#q}9X zMky%6P$JNNIX_{&@vTVW*0F$Exlx7+NLzJ#TQm?-cptftPTirEWOL} zX82THY-_{vw(rye3iRt-#oY$+#TGD@PQ~UOitbD>h2yM`hH*8f1+>+v*t~5?OqzC4 z0a2c@x7lg)1~c;z$J*u+>W;*0)lRUs)58nsb@#&a_8r5HE5K5*vI-VNqt+txw&6F3 zd4`F+*2Eq$D^54kbSXZB>XTmZgz8qDlK}Q6#(}RR(+Z1)wM;sVd7iG!UspIWkD;ooJfTk0m+l=GF=X*+ zZS=KE+lDbw2O|l0Ta6uTTm5YZdK{ts0=}MaDoDyQP0R`Z0})A zXF0YU=Y|mH--cu+O1d^eEN1CLe$g4P8>OBOKY@pAGaNnejir{Dd{`x zV7W285s*uUFS9o>yMOjBv%G5kzHh7|FSi7DZ zK^={qxHdBd!^;Hk#}$NaHM_quZc;F@#Rz*@&63HeBI_Nq$)%bdq^OkDp6$jIWxTqI z*ky#Q>wMY+{kRJ)gS2&EGTCNk@58c}M(ji||2Ab!%kj*vWqGb3YM}g?iOX3Q)>cT; zRUM*JqcMy0s3^a=uP1MrWClc~W|1k_t8Unr=?crMmNg;wu0!8*?^_i{zUIDWGk&Gd z8;%(p)rp#BCNU$==Y-A&P?>e$k85_arMO~M8aJErWD0HwliB?fb;Fvjd#Sxuu)193 zohgE3X?agcXsv5DaHA136xx%LdGlMl-r7d_&cX0uW+u$4p0(f?T1NNCvV+XE(k_8; zPHPD}DP|62t#ihSmS{>(u0rip+Pd9ZVS9Ye8GaPC> zEbZgXcCQ|6i_jHjo5y_=cqD7gRsu<@`6KUl`k>DSGO=~>XsOc7CVz@n;L5Ce!whL>_m*-Y;VVgcO=*`*We!=%T#M`%-^bFgo$;_J$ z>Lc?uGd0F?$(HQRb)qQ<-P8oG884`~OuCi!dSQ;tQDusipK(|fk*&3p0>}zlqWsn|hX(K@KG@};iuy?2| zx1SSFDZKRNDlLS5eU`e=!ke~SkO<3XVCDN6Ugq7l*#Hr)+1pA%!!jxuX4A*bjB!m0+e5avl-fk94KXWKen}e2=X(? zfeay%(A2I&Jh>a>*P4pU!($-cR5vBwIpeLYgwHlxr!RX6%Ib^%o0V_iLJBgaPaEW? zNk46HB(R@0G}BV%iTMc;`B6O_lU@x*3t)vAY<%w(YWaZI|-7fo`(kPt@Jp!t874qdY)# zz}|c)*-sj@^*8?UK%FSq?Dn};$rxFvMU4sj+F0DKZKhuTxr3_k8yY<)fp=#j*&Hi5 z+rO!R`Eb^p1|YcUh$JEVtn?w2;+nwkAjXXalg*h7wOHcvwQG}iLyS3CE-_wqn09Mr z{tFPj(@}oHSG^gt*QyBD!Jf21X%yG#b2+>`H#DA0m9?IStioY_k#VZmF@SW5^Kn8_ z4wnqIvii^RlQE2Y7<|d>4fs;Pef-e8VU2%Pwg+;TZ7tDvG4g$2b(CW66@|-6I#Vz5 zVF>3Z2iBM6rg7&#*M}5)<@>>GcSjG5*KDuE&zRUcK82G+1U@#N2siN2LwK&?_H)hl z9kn3cY$x3+@zK%{Cm9@>$``J4;8as{mLs3JCweDFF~>jLrg1`4_bNv0P_ep*4n{*` zY!F9FI*ggnh@3N!ELwHMxn>xVZVeY9ljA zYA~C*p^5Jp&Cf^fv-@=dL>C5}Kh2yJITh)@qR?8D`bSudvTe;TEUj`%W5yX%#COa8 zykli(ML5KPsn|t=d9l|jW^>P0zbgNU7qbI8nKPmQ``M$p=CNGoGdZNwD2A3ZIJM{% zkxu{I+1m=-2uOHRmGaUR;dIXMM=-(IT_kd33H993ot=;c9@-gQ0T0!}L35soe&IhZ zaTdl*!`T?~%?HJsvu>En*d9^?Zr?AR&~hxnsOqt_1g%dNVUsg@5)y)A6^tXe0bp<%E5r+e?N@9XlHRZO2d3^VRuTE&}#N{CBp+~kHO~7 zpORf>;{r?AwP2z7y*Vi>e?bk{4>H_J(6r6|-zc70zZcqJE6pi!Hgq`Zv<^tWcIO>u zG~*5|JI}OZj8+x5(B3(QayH2Umdea|9|Duv9(a?2`&fvUe1>)na|ia4ZF@h$C1{XH zUC=s=wuA)3$9fTE1-TDXaBmFRLmB=fs}^%7Um)W^cW0e>Y9rvS6`*;{3e)LDbGzDo zi|$>hsZWk|q(d7AP?cZs=Bp^(LLYD!T1#eHt+p;xj-acS=IRF|TcTLyo1r;N!%zRhUt>(W4^{m*TjQLIhsQ<}E1!IpB&|F1fl-|@Hh$L_)=;xYa^R)6SDy+(2B`WAx6 z=1iN^85l+XvjqFiZ4EBdbANGotXzs`??N2xtvst;WG^!}_+@a4xyvF{0GImH{GN>N z$71)(LVn0i3G?I5XYHm>&8;-{Ih<9)T>c{*Ja%##I2WN=5$tz3v-?|)^w<=J{6}Ee z?y{MFaMhTCS828~Qlq~x+p;EuNE zZ_BG!=jk!M_udA+iq?HPyL>P+c*xK8MhIA^>x^JcfOL&`v-E*z!0pO37^#< zNvt~+^QqT(y~(_e3m93}E!1oW*0-01Ekj6JT&r?SXd|B`Un|jQP>wM62h}m$bXp~? z$~E^Eyb~&IEwPtSwf)C=k%XIacV~=;s<}9t`RZ++|IR%Dxan|+(4VFZ+htu#(OgsE zM(ey-e#N({j_QmWE!i!Q^J?zJRbtOYAReFd;Ad*@TU?vq!h}R!zP}ab0~Cy6>!CoA zb)ckavlGu-KD5fHCmcwxe=}ul%$syYpxvnS*9#BquKnY8ELoy~NsF{HR$ zt0F;8!&%v3Vbg&yzEwC!LxN@UC=E)o&nj3(qWxmtdJ+Q8S zOYgwIAWxZV{pQ1_A-{ElO?_47-iEU?mg>``Y$l^Fg6(|XiNWbDYqvj&P2O>)g#QS{ zDx&mr3VrP)12=!pYi`pSM~S(;H|`z!fxdm>;{@~V6ZR+HKFO*wbK;hGZ!z*eOiJR} zrm*g(%X#a*U2I{#UEm9sS{#hKi+|bseiF-|JiEU!Qa2Q^-#+;iBMSQPNxA+HDI)yD literal 9748 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, YEAR. # msgid "" msgstr "" -"Project-Id-Version: Icinga Web 2 (0.1)\n" +"Project-Id-Version: Monitoring Module (2.0.0~alpha4)\n" "Report-Msgid-Bugs-To: dev@icinga.org\n" -"POT-Creation-Date: 2014-05-27 21:24+0000\n" -"PO-Revision-Date: 2014-05-27 23:25+0100\n" +"POT-Creation-Date: 2014-08-22 16:18+0200\n" +"PO-Revision-Date: 2014-08-22 17:21+0100\n" "Last-Translator: Thomas Gelf \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:66 -msgid " If you work with other administrators you may find it useful to share information about a host or service that is having problems if more than one of you may be working on it. Make sure you enter a brief description of what you are doing." +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:235 +msgid " Down Hosts (Handled)" +msgstr "Hosts Down (bestätigt)" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:236 +msgid " Down Hosts (Unhandled)" +msgstr "Hosts Down (unbestätigt)" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:257 +msgid " Down Services (Handled)" +msgstr "Hosts Down (bestätigt)" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:258 +msgid " Down Services (Unhandled)" msgstr "" +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:41 +msgid " If you work with other administrators you may find it useful to share information about a host or service that is having problems if more than one of you may be working on it. Make sure you enter a brief description of what you are doing." +msgstr "Wenn du mit anderen Administratoren zusammenarbeitest wirst du es als nützlich empfinden, Informationen über Probleme auf Hosts oder Services an denen du arbeitest zu teilen. Stell sicher eine kurze Beschreibung von dem was du gerade machst zu hinterlassen." + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:239 +msgid " Pending Hosts" +msgstr "Ungeprüfte Hosts" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:261 +msgid " Pending Services" +msgstr "Ungeprüfte Services" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:237 +msgid " Unreachable Hosts (Handled)" +msgstr "Nicht erreichbare Hosts (bestätigt)" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:238 +msgid " Unreachable Hosts (Unhandled)" +msgstr "Nicht erreichbare Hosts (unbestätigt)" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:259 +msgid " Unreachable Services (Handled)" +msgstr "Nicht erreichbare Services (bestätigt)" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:260 +msgid " Unreachable Services (Unhandled)" +msgstr "Nicht erreichbare Services (unbestätigt)" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:255 +msgid " Warning Services (Handled)" +msgstr "Service-Warnungen (bestätigt)" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:256 +msgid " Warning Services (Unhandled)" +msgstr "Service-Warnungen (unbestätigt)" + #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/problem_hosts.phtml:10 #, php-format msgid "%d Hosts DOWN" -msgstr "" +msgstr "%d Hosts DOWN" #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/ok_hosts.phtml:22 #, php-format msgid "%d Hosts PENDING" -msgstr "" +msgstr "%d Hosts UNGEPRÜFT" #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/problem_hosts.phtml:17 #, php-format msgid "%d Hosts UNREACHABLE" -msgstr "" +msgstr "%d Hosts NICHT ERREICHBAR" #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/ok_hosts.phtml:15 #, php-format msgid "%d Hosts UP" -msgstr "" +msgstr "%d Hosts UP" #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:57 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:127 @@ -46,14 +94,14 @@ msgstr "" #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:267 #, php-format msgid "%d are not checked at all" -msgstr "" +msgstr "%d werden nicht überwacht" #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:32 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:102 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:172 #, php-format msgid "%d are passively checked" -msgstr "" +msgstr "%d werden passiv überwacht" #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:62 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:132 @@ -62,21 +110,31 @@ msgstr "" #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:272 #, php-format msgid "%d is not checked at all" -msgstr "" +msgstr "%d wird nicht überwacht" #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:37 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:107 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:177 #, php-format msgid "%d is passively checked" -msgstr "" +msgstr "%d wird passiv überwacht" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hosts.phtml:105 +#, php-format +msgid "%d unhandled services" +msgstr "%d unbestätigte Services" #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/notifications.phtml:22 #, php-format msgid "%s notications have been sent for this issue" msgstr "%s Benachrichtigungen wurden für dieses Problem versandt" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:101 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/components/servicesummary.phtml:3 +#, php-format +msgid "%s services:" +msgstr "%s Services:" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:91 msgid "4 Hours" msgstr "4 Stunden" @@ -85,39 +143,61 @@ msgstr "4 Stunden" msgid "A notication has been sent for this issue %s ago" msgstr "Eine Benachrichtigung für dieses Problem wurde vor %s gesendet" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:93 +msgid "Accept passive host checks" +msgstr "Akzeptiere passive Host Checks" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:71 +msgid "Accept passive service checks" +msgstr "Akzeptiere passive Service-Checks" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:43 +msgid "Ack removed" +msgstr "Bestätigung entfernt" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:38 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml:37 msgid "Acknowledge" msgstr "Bestätigen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:141 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:116 msgid "Acknowledge Problem" msgstr "Problem bestätigen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:50 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:80 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:146 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:180 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:214 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:53 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:83 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:149 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:183 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:217 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/multi/components/comments.phtml:14 +msgid "Acknowledge all problems on the selected hosts or services" +msgstr "Bestätige alle Probleme auf den ausgewählten Hosts oder Services" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:59 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:89 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:155 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:189 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:223 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:56 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:86 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:152 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:186 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:220 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:16 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:86 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:156 msgid "Acknowledged" msgstr "Bestätigt" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:972 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:45 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/eventhistory.phtml:37 +msgid "Acknowledgement" +msgstr "Bestätigung" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:945 msgid "Acknowledgement has been sent" msgstr "Bestätigung wurde gesendet" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:994 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:967 msgid "Acknowledgement removal has been requested" msgstr "Löschung der Bestätigung wurde angefragt" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:63 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:53 msgid "Acknowledgements" msgstr "Bestätigungen" @@ -130,10 +210,14 @@ msgstr "Aktiv" msgid "Active Checks" msgstr "Aktive Checks" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/comments.phtml:45 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/comments.phtml:47 msgid "Add comment" msgstr "Kommentar hinzufügen" +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:109 +msgid "All Events" +msgstr "Alle Ereignisse" + #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml:28 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml:95 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml:146 @@ -150,23 +234,23 @@ msgstr "Alle auf diesem Host konfigurierten Services" msgid "All services enabled" msgstr "Alle Services aktiviert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommandForm.php:118 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommandForm.php:93 msgid "Author (Your Name)" msgstr "Autor (Dein Name)" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:88 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:63 msgid "Broadcast" msgstr "Broadcast" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:78 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:53 msgid "CRITICAL" msgstr "KRITISCH" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:165 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:140 msgid "Check Output" msgstr "Check Ausgabe" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:141 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:116 msgid "Check Result" msgstr "Check-Ergebnis" @@ -174,7 +258,7 @@ msgstr "Check-Ergebnis" msgid "Check Source" msgstr "Check-Quelle" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:58 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:33 msgid "Check Time" msgstr "Ausführungszeit" @@ -190,7 +274,7 @@ msgstr "Check-Latenz" msgid "Check now" msgstr "Jetzt prüfen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:277 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:253 msgid "Child Objects" msgstr "Kind-Objekte" @@ -198,309 +282,383 @@ msgstr "Kind-Objekte" msgid "Command" msgstr "Befehl" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:317 -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:748 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:290 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:721 msgid "Command has been sent, active checks will be disabled" msgstr "Befehl wurde gesendet, aktive Checks werden deaktiviert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:342 -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:768 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:315 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:741 msgid "Command has been sent, active checks will be enabled" msgstr "Befehl wurde gesendet, aktive Checks werden aktiviert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:361 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:334 msgid "Command has been sent, check will be rescheduled" msgstr "Befehl wurde gesendet, Check wird neu geplant" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:728 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:701 msgid "Command has been sent, checks will be rescheduled" msgstr "Befehl wurde gesendet, Checks werden neu geplant" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:799 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:772 msgid "Command has been sent, event handlers will be disabled" msgstr "Befehl wurde gesendet, Eventhandler werden deaktiviert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:831 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:804 msgid "Command has been sent, event handlers will be enabled" msgstr "Befehl wurde gesendet, Eventhandler werden aktiviert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:864 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:837 msgid "Command has been sent, flap detection will be disabled" msgstr "Befehl wurde gesendet, Flap-Erkennung wird deaktiviert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:897 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:870 msgid "Command has been sent, flap detection will be enabled" msgstr "Befehl wurde gesendet, Flap-Erkennung wird aktiviert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1074 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1047 msgid "Command has been sent, monitoring process will restart now" msgstr "Befehl wurde gesendet, der Monitoring-Prozess wird jetzt neustarten" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:537 -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:565 -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:688 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:510 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:538 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:661 msgid "Command has been sent, notifications will be disabled" msgstr "Befehl wurde gesendet, Benachrichtigungen werden deaktiviert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:595 -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:709 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:568 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:682 msgid "Command has been sent, notifications will be enabled" msgstr "Befehl wurde gesendet, Benachrichtigungen werden aktiviert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:418 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:391 msgid "Command has been sent, obsessing will be disabled" msgstr "Befehl wurde gesendet, Verfolgung wird deaktiviert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:452 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:425 msgid "Command has been sent, obsessing will be enabled" msgstr "Befehl wurde gesendet, Verfolgung wird aktiviert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:519 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:492 msgid "Command has been sent, passive check results will be accepted" msgstr "Befehl wurde gesendet, passive Checks werden akzeptiert werden" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:486 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:459 msgid "Command has been sent, passive check results will be refused" msgstr "Befehl wurde gesendet, passive Checks werden abgewiesen werden" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1096 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1069 msgid "Command has been sent, performance data processing will be disabled" msgstr "Befehl wurde gesendet, Performancedatenverarbeitung wird deaktiviert werden" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1118 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1091 msgid "Command has been sent, performance data processing will be enabled" msgstr "Befehl wurde gesendet, Performancedatenverarbeitung wird aktiviert werden" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1053 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1026 msgid "Command has been sent, process will shut down" msgstr "Befehl wurde gesendet, der Monitoringprozess wird herunterfahren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:61 -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommentForm.php:55 -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:59 -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:158 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/eventhistory.phtml:32 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:28 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:36 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommentForm.php:30 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:34 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:134 msgid "Comment" msgstr "Kommentar" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:936 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:33 +msgid "Comment deleted" +msgstr "Kommentar gelöscht" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:909 msgid "Comment removal has been requested" msgstr "Löschung des Kommentars wurde angefordert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:58 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/comments.phtml:43 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:42 +msgid "Comment was caused by a downtime." +msgstr "Kommentar wurde durch eine Downtime erstellt." + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:32 +msgid "Comment was caused by a flapping host or service." +msgstr "Kommentar wurde durch einen flappenden Host oder service erstellt." + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:46 +msgid "Comment was caused by an acknowledgement." +msgstr "Kommentar wurde durch eine Bestätigung erstellt." + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:37 +msgid "Comment was created by an user." +msgstr "Kommentar wurde von einem Benutzer erstellt." + +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:86 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:48 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/comments.phtml:45 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/multi/components/comments.phtml:6 msgid "Comments" msgstr "Kommentare" +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:78 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/contacts.phtml:33 msgid "Contactgroups" msgstr "Kontaktgruppen" +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:90 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/contacts.phtml:14 msgid "Contacts" msgstr "Kontakte" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:611 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:160 +msgid "Critical" +msgstr "Kritisch" + +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:101 +msgid "Critical Events" +msgstr "Kritische Ereignisse" + +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:45 +msgid "Current Downtimes" +msgstr "Aktuelle Downtimes" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:584 msgid "Custom notification has been sent" msgstr "Benutzerdefinierte Bestätigung wurde gesendet" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:77 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:52 msgid "Custom notifications normally follow the regular notification logic in Icinga. Selecting this option will force the notification to be sent out, regardless of time restrictions, whether or not notifications are enabled, etc." -msgstr "" +msgstr "Benutzeredefinierte Benachrichtigungen verhalten sich gemäß der gewöhnlichen Benachrichtigungslogik in Icinga. Wenn du diese Option wählst wird eine Benachrichtigung erzwungen. Einschränkungen durch Zeitspannen und durch eventuell deaktivierte Benachrichtigungen werden dabei ignoriert." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:72 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:47 msgid "DOWN" msgstr "DOWN" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/DelayNotificationForm.php:76 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/DelayNotificationForm.php:51 msgid "Delay Notification" msgstr "Benachrichtigung verzögern" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1024 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/multi/components/comments.phtml:13 +msgid "Delay Notifications" +msgstr "Benachrichtigungen verzögern" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:997 msgid "Delete Downtime" msgstr "Downtime löschen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1026 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:999 msgid "Delete a single downtime with the id shown above" -msgstr "" +msgstr "Lösche eine einzelne Downtime mit der oben gezeigten ID." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:305 -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:740 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:278 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:713 msgid "Disable Active Checks" msgstr "Aktive Checks deaktivieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:780 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:753 msgid "Disable Event Handler" msgstr "Event-Handler deaktivieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:843 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:816 msgid "Disable Flapping Detection" msgstr "Flap-Erkennung deaktivieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:550 -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:679 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:523 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:652 msgid "Disable Notifications" msgstr "Benachrichtigungen deaktivieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1087 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1060 msgid "Disable Performance Data" msgstr "Performancedaten deaktivieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:741 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:714 msgid "Disable active checks for this host and its services." -msgstr "" +msgstr "Deaktiviere aktive Service-Checks für diesen Host und seine Service-Checks." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:310 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:283 msgid "Disable active checks for this object." -msgstr "" +msgstr "Deaktiviere aktive Service-Checks für dieses Objekt." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:308 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:281 msgid "Disable active checks on a program-wide basis." -msgstr "" +msgstr "Deaktiviere applikationsweit sämtliche aktiven Service-Checks." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:783 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:756 msgid "Disable event handler for the whole system." -msgstr "" +msgstr "Dektiviere Event-Handler für das ganze System." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:785 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:758 msgid "Disable event handler for this object." -msgstr "" +msgstr "Dektiviere Event-Handler für dieses Objekt." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:848 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:821 msgid "Disable flapping detection for this object." -msgstr "" +msgstr "Deaktiviere die Flap-Erkennnung für dieses Objekt." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:846 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:819 msgid "Disable flapping detection on a program-wide basis." -msgstr "" +msgstr "Deaktiviere die Flap-Erkennnung applikationsweit." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:553 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:49 +msgid "Disable notifications for a specific time on a program-wide basis" +msgstr "Deaktivieren Benachrichtigungen applikationsweit für eine bestimmte Zeitspanne." + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:526 msgid "Disable notifications on a program-wide basis." -msgstr "" +msgstr "Deaktiviere die Flap-Erkennnung applikationsweit." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:399 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:372 msgid "Disable obsessing on a program-wide basis." -msgstr "" +msgstr "Deaktiviere die Verfolgung applikationsweit." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:467 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:440 msgid "Disable passive checks on a program-wide basis." -msgstr "" +msgstr "Deaktiviere Passive Checks applikationsweit." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1088 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1061 msgid "Disable processing of performance data on a program-wide basis." -msgstr "" +msgstr "Deaktiviere die Verarbeitung von Performance-Daten applikationsweit." #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/hostservicechecks.phtml:40 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/hostservicechecks.phtml:72 msgid "Disabled" msgstr "Deaktiviert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:280 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:256 msgid "Do nothing with child objects" -msgstr "" +msgstr "Mach nichts mit Kind-Objekten" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:209 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:205 +msgid "Down" +msgstr "Down" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:41 +msgid "Downtime" +msgstr "Downtime" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/eventhistory.phtml:77 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:93 +msgid "Downtime End" +msgstr "Downtime Ende" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/eventhistory.phtml:72 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:88 +msgid "Downtime Start" +msgstr "Downtime Beginn" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:185 msgid "Downtime Type" msgstr "Downtime-Typ" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1033 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1006 msgid "Downtime removal has been requested" -msgstr "" +msgstr "Entfernung dieser Downtime wurde angefordert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:667 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:640 msgid "Downtime removal requested" -msgstr "" +msgstr "Entfernung dieser Downtime wurde angefordert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:630 -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:648 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:53 +msgid "Downtime removed" +msgstr "Downtime entfernt" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:603 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:621 msgid "Downtime scheduling requested" -msgstr "" +msgstr "Die Planung dieser Downtime wurde angefordert" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/downtime.phtml:48 +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:82 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/downtime.phtml:55 msgid "Downtimes" msgstr "Downtimes" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:332 -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:760 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/contacts.phtml:28 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/contact.phtml:18 +msgid "Email" +msgstr "E-Mail" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:305 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:733 msgid "Enable Active Checks" msgstr "Aktive Checks aktivieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:812 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:785 msgid "Enable Event Handler" msgstr "Eventhandler aktivieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:876 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:849 msgid "Enable Flapping Detection" msgstr "Flap-Erkennung aktivieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:580 -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:700 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:553 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:673 msgid "Enable Notifications" msgstr "Benachrichtigungen aktivieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1109 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1082 msgid "Enable Performance Data" msgstr "Performancedaten aktivieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:761 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:734 msgid "Enable active checks for this host and its services." -msgstr "" +msgstr "Aktive Checks für diesen Host und seine Services aktivieren." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:336 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:309 msgid "Enable active checks for this object." -msgstr "" +msgstr "Aktive Checks für dieses Objekt aktivieren." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:334 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:307 msgid "Enable active checks on a program-wide basis." -msgstr "" +msgstr "Aktive Checks anwendungsweit aktivieren." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:817 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:790 msgid "Enable event handler for this object." -msgstr "" +msgstr "Event-Handler für dieses Objekt aktivieren." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:815 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:788 msgid "Enable event handlers on the whole system." -msgstr "" +msgstr "Event-Handler für das gesamte System aktivieren." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:881 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:854 msgid "Enable flapping detection for this object." -msgstr "" +msgstr "Flap-Erkennung für dieses Objekt aktivieren." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:879 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:852 msgid "Enable flapping detection on a program-wide basis." -msgstr "" +msgstr "Flap-Erkennung anwendungsweit aktivieren." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:583 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:556 msgid "Enable notifications on a program-wide basis." -msgstr "" +msgstr "Benachrichtigungen anwendungsweit aktivieren." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:433 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:406 msgid "Enable obsessing on a program-wide basis." -msgstr "" +msgstr "Verfolgung anwendungsweit aktivieren." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:501 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:474 msgid "Enable passive checks on a program-wide basis." -msgstr "" +msgstr "Passive Checks anwendungsweit aktivieren." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1110 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1083 msgid "Enable processing of performance data on a program-wide basis." -msgstr "" +msgstr "Performancedaten-Verarbeitung anwendungsweit aktivieren." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:197 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:173 msgid "End Time" msgstr "Endzeitpunkt" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:73 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:63 msgid "Ended downtimes" -msgstr "" +msgstr "Beendete Downtimes" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:262 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:238 msgid "Enter here the duration of the downtime. Icinga will automatically delete the downtime after this time expired." -msgstr "" +msgstr "Die gewünschte Dauer der Downtime hier eintragen. Icinga wird die Downtime nach Ablauf dieser Zeit automatisch löschen." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:106 -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/DisableNotificationWithExpireForm.php:57 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:81 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/DisableNotificationWithExpireForm.php:32 msgid "Enter the expire date/time for this acknowledgement here. Icinga will delete the acknowledgement after this date expired." -msgstr "" +msgstr "Den gewünschten Verfallszeitpunkt der Downtime hier eintragen. Icinga wird die Downtime bei Überschreitung dieses Zeitpunkts löschen." #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/flags.phtml:46 msgid "Event Handler" @@ -511,23 +669,51 @@ msgstr "Eventhandler" msgid "Event handlers" msgstr "Eventhandler" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:102 -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/DisableNotificationWithExpireForm.php:53 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:104 +msgid "Eventhandlers enabled" +msgstr "Eventhandler aktiviert" + +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:108 +msgid "Events" +msgstr "Ereignisse" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:82 +msgid "Execute active host checks" +msgstr "Aktiven Host Check ausführen" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:60 +msgid "Execute active service checks" +msgstr "Aktive Service-Checks ausführen" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:77 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/DisableNotificationWithExpireForm.php:28 msgid "Expire Time" msgstr "Verfallszeitpunkt" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:169 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/downtimes.phtml:34 +msgid "Expires" +msgstr "Verfällt" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:144 msgid "Fill in the check output string which should be send to Icinga." -msgstr "" +msgstr "Ausgabetext des Checkergebnisses welches an Icinga gesendet werden soll hier eintragen." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:180 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:155 msgid "Fill in the performance data string which should be send to Icinga." -msgstr "" +msgstr "Performancedaten des Checkergebnisses welches an Icinga gesendet werden soll hier eintragen." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:76 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:52 msgid "Fixed" msgstr "Fix" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/contact.phtml:35 +msgid "Flags (host)" +msgstr "Flags (Host)" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/contact.phtml:31 +msgid "Flags (service)" +msgstr "Flags (Service)" + #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/flags.phtml:57 msgid "Flap Detection" msgstr "Flap-Erkennung" @@ -537,86 +723,145 @@ msgstr "Flap-Erkennung" msgid "Flap detection" msgstr "Flap-Erkennung" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:77 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:137 +msgid "Flap detection enabled" +msgstr "Flap-Erkennung aktiv" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:31 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/eventhistory.phtml:47 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:58 +msgid "Flapping" +msgstr "Flapping" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:63 +msgid "Flapping stopped" +msgstr "Flapping beendet" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:53 msgid "Flexible" msgstr "Flexibel" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:233 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:209 msgid "Flexible Duration" msgstr "Flexible Dauer" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:71 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:46 msgid "Force Check" msgstr "Check erzwingen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:75 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:50 msgid "Forced" msgstr "Erzwungen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hosts.phtml:84 -msgid "Hard" -msgstr "" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:31 +msgid "Global host event handler" +msgstr "Globaler Host Event Handler" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:53 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:35 +msgid "Global service event handler" +msgstr "Globaler Service Event Handler" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/components/servicesummary.phtml:34 +#, php-format +msgid "Handled services with state %s" +msgstr "Bestätigte Services mit Status %s" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:43 msgid "Hard state changes" -msgstr "" +msgstr "Harte Status-Änderungen" + +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:98 +msgid "History" +msgstr "Historie" + +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:37 +msgid "Host Problems" +msgstr "Host-Probleme" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/MultiController.php:60 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/MultiController.php:128 +msgid "Host State" +msgstr "Host-Status" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/contacts.phtml:44 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/contact.phtml:43 +msgid "Host notification period" +msgstr "Host-Benachrichtigungszeitraum" #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/hostservicechecks.phtml:2 msgid "Host- and Servicechecks" -msgstr "" +msgstr "Host- und Servicechecks" +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:74 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/hostgroups.phtml:13 msgid "Hostgroups" msgstr "Hostgruppen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:19 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:22 +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:58 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:194 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:28 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:25 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/hostservicechecks.phtml:7 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/multi/components/objectlist.phtml:37 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/multi/components/summary.phtml:5 msgid "Hosts" msgstr "Hosts" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:241 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:217 msgid "Hours" msgstr "Stunden" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:91 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:66 msgid "If the acknowledgement should expire, check this option." -msgstr "" +msgstr "Diese Option aktivieren, wenn die Bestätigung verfallen soll" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:135 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:110 msgid "If you do not want an acknowledgement notification to be sent out to the appropriate contacts, uncheck this option." -msgstr "" +msgstr "Wenn du keine Bestätigungsbenachrichtigung zu den jeweiligen Kontakten senden willst, deaktiviere diese Option." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:222 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:198 msgid "If you select the fixed option, the downtime will be in effect between the start and end times you specify whereas a flexible downtime starts when the service enters a non-OK state (sometime between the start and end times you specified) and lasts as long as the duration of time you enter. The duration fields do not apply for fixed downtime." -msgstr "" +msgstr "Wenn du die Option \"fix\" wählst, wird die Downtime zwischen dem gewählten Start- und Endzeitpunkt aktiv sein. Bei einer flexiblen Downtime beginnt die Downtime sobald der Dienst (irgendwann zwischen dem gewählten Start- und Endzeitpunkt) einen nicht-OK Zustand erreicht, und dauert so lange, wie im Feld \"Dauer\" angegeben. Diese Dauer gibt es für fixe Downtimes nicht." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:74 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:49 msgid "If you select this option, Icinga will force a check regardless of both what time the scheduled check occurs and whether or not checks are enabled." -msgstr "" +msgstr "Wenn diese Option aktiviert wird, erzwingt Icinga einen Check unabhängig vom eingeplanten zeitraum und auch dann, wenn aktive Checks nicht aktiv sind." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommentForm.php:74 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommentForm.php:49 msgid "If you uncheck this option, the comment will automatically be deleted the next time Icinga is restarted." -msgstr "" +msgstr "Wenn diese Option deaktiviert wird, wird der Kommentar beim nächsten Neustart von Icinga automatisch gelöscht." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:122 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:97 msgid "If you want the acknowledgement to disable notifications until the host/service recovers, check this option." -msgstr "" +msgstr "Diese Option aktivieren, wenn die Bestätigung Benachrichtigungen unterdrücken soll, bis der Host/Service sich erholt." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommentForm.php:60 -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:64 -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:163 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommentForm.php:35 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:39 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:139 msgid "If you work with other administrators, you may find it useful to share information about a host or service that is having problems if more than one of you may be working on it. Make sure you enter a brief description of what you are doing." -msgstr "" +msgstr "Wenn du mit anderen Administratoren zusammenarbeitest, wirst du es nützlich finden, Informationen zu Hosts oder Services mit Problemen zu teilen, insbesondere dann, wenn gemeinsam daran gearbeitet wird. Stell sicher eine kurze Beschreibung zu deiner Tätigkeit hier einzutragen." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:80 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:55 msgid "If you would like the comment to remain even when the acknowledgement is removed, check this option." -msgstr "" +msgstr "Diese Option aktivieren, wenn der Kommentar auch nach dem Löschen der Bestätigung bestehen bleiben soll" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/eventhistory.phtml:42 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:48 +msgid "In Downtime" +msgstr "In Downtime" #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml:6 msgid "Last check" msgstr "Letzter Check" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:27 +msgid "Last check command" +msgstr "Letztes Check-Kommando" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:23 +msgid "Last status update" +msgstr "Letzer Status-Aktualisierung" + #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/timeline/index.phtml:15 msgid "Legend" msgstr "Legende" @@ -625,8 +870,16 @@ msgstr "Legende" msgid "List Of Supported Commands" msgstr "Liste unterstützter Befehle" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:246 -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:255 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/multi/components/objectlist.phtml:49 +msgid "List all" +msgstr "Alle anzeigen" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/multi/components/objectlist.phtml:52 +msgid "List all selected objects" +msgstr "Alle gewählten Objekte anzeigen" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:222 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:231 msgid "Minutes" msgstr "Minuten" @@ -634,62 +887,125 @@ msgstr "Minuten" msgid "Monitoring Features" msgstr "Monitoring-Features" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:159 +msgid "Monitoring Process" +msgstr "Monitoring-Prozess" + #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml:21 msgid "Next check" msgstr "Nächster Check" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:41 -msgid "No History Available For This Object" -msgstr "" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicematrix.phtml:26 +msgid "No Services matching the filter" +msgstr "Zu diesem Filter wurden keine Services gefunden" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/eventhistory.phtml:11 -msgid "No entries found" -msgstr "Keine Einträge gefunden" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:20 +msgid "No comments matching the filter" +msgstr "Zu diesem Filter wurden keine Kommentare gefunden" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hosts.phtml:18 -msgid "No host found" -msgstr "Kein Host gefunden" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/contactgroups.phtml:11 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/contacts.phtml:16 +msgid "No contacts matching the filter" +msgstr "Zu diesem Filter wurden keine Kontakte gefunden" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/downtimes.phtml:18 +msgid "No downtimes matching the filter" +msgstr "Zu diesem Filter wurden keine Downtimes gefunden" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:10 +msgid "No history available for this object" +msgstr "Zu diesem Filter wurden keine historischen Ereignisse gefunden" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/statehistorysummary.phtml:12 +msgid "No history entry matching the filter" +msgstr "Zu diesem Filter wurden keine historischen Ereignisse gefunden" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/eventhistory.phtml:14 +msgid "No history events matching the filter" +msgstr "Zu diesem Filter wurden keine historischen Ereignisse gefunden" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:11 +msgid "No host groups matching the filter" +msgstr "Zu diesem Filter wurden keine Hostgruppen gefunden" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hosts.phtml:28 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/multi/host.phtml:13 +msgid "No hosts matching the filter" +msgstr "Zu diesem Filter wurden keine Hosts gefunden" #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/notifications.phtml:31 msgid "No notification has been sent for this issue" msgstr "Für dieses Problem wurde keine Benachrichtigung gesendet" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/notifications.phtml:29 +msgid "No notifications matching the filter" +msgstr "Zu diesem Filter wurde keine Benachrichtigung gefunden" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:11 +msgid "No service groups matching the filter" +msgstr "Zu diesem Filter wurden keine Servicegruppen gefunden" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/services.phtml:40 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/multi/service.phtml:17 +msgid "No services matching the filter" +msgstr "Zu diesem Filter wurden keine Services gefunden" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/contact.phtml:53 +msgid "No such contact" +msgstr "Der gewünschte Kontakt existiert nicht" + #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml:32 msgid "Not acknowledged" msgstr "Nicht bestätigt" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/DelayNotificationForm.php:55 -msgid "Notification Delay (Minutes From Now)" -msgstr "" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:32 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:36 +msgid "Not set" +msgstr "Nicht gesetzt" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1011 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/eventhistory.phtml:27 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:23 +msgid "Notification" +msgstr "Benachrichtigung" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/DelayNotificationForm.php:30 +msgid "Notification Delay (Minutes From Now)" +msgstr "Benachrichtigungsverzögerung (Minuten ab jetzt)" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:984 msgid "Notification delay has been requested" msgstr "Benachrichtigungsverzögerung wurde angefragt" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:48 +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:105 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:38 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/flags.phtml:35 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/notifications.phtml:10 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml:73 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml:75 msgid "Notifications" msgstr "Benachrichtigungen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:680 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:39 +msgid "Notifications enabled" +msgstr "Benachrichtigungen aktiv" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:653 msgid "Notifications for this host and its services will be disabled." -msgstr "" +msgstr "Benachrichtigungen für diesen Host und seine Services werden deaktiviert." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:701 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:674 msgid "Notifications for this host and its services will be enabled." -msgstr "" +msgstr "Benachrichtigungen für diesen Host und seine Services werden aktiviert." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:555 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:528 msgid "Notifications for this object will be disabled." -msgstr "" +msgstr "Benachrichtigungen für dieses Objekt werden deaktiviert." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:585 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:558 msgid "Notifications for this object will be enabled." -msgstr "" +msgstr "Benachrichtigungen für dieses Objekt werden aktiviert." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:76 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:51 msgid "OK" msgstr "OK" @@ -697,22 +1013,43 @@ msgstr "OK" msgid "Obsessing" msgstr "Verfolgung" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:102 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:115 +msgid "Obsessing over host checks" +msgstr "Host-Checks verfolgen" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:126 +msgid "Obsessing over service checks" +msgstr "Service-Checks verfolgen" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:148 +msgid "Ok" +msgstr "Ok" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:92 msgid "One day" msgstr "Ein Tag" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:104 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:94 msgid "One month" msgstr "Ein Monat" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:103 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:93 msgid "One week" msgstr "Eine Woche" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:105 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:95 msgid "One year" msgstr "Ein Jahr" +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:50 +msgid "Overview" +msgstr "Übersicht" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/contacts.phtml:33 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/contact.phtml:26 +msgid "Pager" +msgstr "Pager" + #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/hostservicechecks.phtml:30 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/hostservicechecks.phtml:62 msgid "Passive" @@ -722,71 +1059,95 @@ msgstr "Passiv" msgid "Passive Checks" msgstr "Passive Checks" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:384 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:357 msgid "Passive check result has been submitted" -msgstr "" +msgstr "Passives Check-Ergebnis wurde gesendet" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:503 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:476 msgid "Passive checks for this object will be accepted." -msgstr "" +msgstr "Passives Check-Ergebnis für dieses Objekt werden akzeptiert." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:469 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:442 msgid "Passive checks for this object will be omitted." -msgstr "" +msgstr "Passives Check-Ergebnis für dieses Objekt werden ignoriert." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:177 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:152 msgid "Performance Data" msgstr "Performancedaten" +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:122 +msgid "Performance Info" +msgstr "Performance-Info" + #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/perfdata.phtml:3 msgid "Performance data" msgstr "Performancedaten" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommentForm.php:71 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommentForm.php:46 msgid "Persistent" msgstr "Persisten" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:77 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:52 msgid "Persistent Comment" msgstr "Persistenter Kommentar" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommentForm.php:80 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommentForm.php:55 msgid "Post Comment" msgstr "Kommentar absenden" +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:25 +msgid "Problems" +msgstr "Probleme" + +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:118 +msgid "Process Info" +msgstr "Prozess Info" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:148 +msgid "Process performance data" +msgstr "Performancedaten verarbeiten" + #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml:25 msgid "Remove Acknowledgement" msgstr "Bestätigung entfernen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:660 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:104 +msgid "Remove Comment" +msgstr "Kommentar entfernen" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/multi/components/comments.phtml:10 +msgid "Remove Comments" +msgstr "Kommentare entfernen" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:633 msgid "Remove Downtime(s)" msgstr "Downtime(s) entfernen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:987 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:960 msgid "Remove Problem Acknowledgement" msgstr "Problembestätigung entfernen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:930 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:903 msgid "Remove comment" msgstr "Kommentar entfernen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:661 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:634 msgid "Remove downtime(s) from this host and its services." -msgstr "" +msgstr "Downtime(s) für diesen Host und seine Services entfernen." #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml:26 msgid "Remove problem acknowledgement" msgstr "Problembestätigung entfernen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:988 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:961 msgid "Remove problem acknowledgement for this object." -msgstr "" +msgstr "Problembestätigungen für diesen Host und seine Services entfernen." #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml:28 msgid "Reschedule" msgstr "Neu planen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:89 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:64 msgid "Reschedule Check" msgstr "Check neu planen" @@ -794,47 +1155,55 @@ msgstr "Check neu planen" msgid "Reschedule next check immediately" msgstr "Nächsten Check sofort einplanen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:948 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:921 msgid "Reset Attributes" msgstr "Attribute zurücksetzen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:949 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:922 msgid "Reset modified attributes to its default." -msgstr "" +msgstr "Veränderte Attribute zurücksetzen." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1066 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:161 +msgid "Restart" +msgstr "Neustarten" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1039 msgid "Restart monitoring process" msgstr "Monitoring-Prozess neu starten" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1067 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:162 +msgid "Restart the monitoring process" +msgstr "Monitoring-Prozess neu starten" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1040 msgid "Restart the monitoring process." msgstr "Monitoring-Prozess neu starten." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:302 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:278 msgid "Schedule Downtime" msgstr "Downtime planen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/downtime.phtml:50 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/downtime.phtml:57 msgid "Schedule downtime" msgstr "Downtime planen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:282 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:258 msgid "Schedule non-triggered downtime for all child objects" msgstr "" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:281 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:257 msgid "Schedule triggered downtime for all child objects" msgstr "" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:90 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:65 msgid "Selecting this option causes the notification to be sent out to all normal (non-escalated) and escalated contacts. These options allow you to override the normal notification logic if you need to get an important message out." msgstr "" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:97 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:72 msgid "Send Custom Notification" msgstr "" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:132 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:107 msgid "Send Notification" msgstr "Benachrichtigung senden" @@ -842,193 +1211,345 @@ msgstr "Benachrichtigung senden" msgid "Service" msgstr "Service" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/ok_hosts.phtml:54 +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:41 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/ok_hosts.phtml:55 msgid "Service Problems" msgstr "Service-Probleme" +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/MultiController.php:123 +msgid "Service State" +msgstr "Service-Zustand" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/contacts.phtml:40 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/contact.phtml:39 +msgid "Service notification period" +msgstr "Benachrichtigungzeitraum des Services" + +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:70 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/servicegroups.phtml:14 msgid "Servicegroups" msgstr "Servicegruppen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:20 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:23 +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:66 +msgid "Servicematrix" +msgstr "Service-Matrix" + +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:62 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:142 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicegroups.phtml:29 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hostgroups.phtml:26 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/hostservicechecks.phtml:8 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/ok_hosts.phtml:28 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/problem_hosts.phtml:22 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/multi/components/objectlist.phtml:30 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/multi/components/summary.phtml:5 msgid "Services" msgstr "Services" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:62 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/components/servicesummary.phtml:8 +#, php-format +msgid "Services with state %s" +msgstr "Service im Zustand %s" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:37 msgid "Set the date/time when this check should be executed." msgstr "" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:200 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:176 msgid "Set the end date/time for the downtime." msgstr "" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:189 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:165 msgid "Set the start date/time for the downtime." msgstr "" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:157 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:132 msgid "Set the state which should be send to Icinga for this objects." msgstr "" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1046 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1019 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:168 msgid "Shutdown monitoring process" -msgstr "" +msgstr "Monitoring-Prozess herunterefahren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/services.phtml:44 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hosts.phtml:81 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/header.phtml:9 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/header.phtml:21 -msgid "Since" -msgstr "Seit" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:169 +msgid "Shutdown the monitoring process" +msgstr "Monitoring-Prozess herunterfahren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hosts.phtml:84 -msgid "Soft" -msgstr "" - -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/notifications.phtml:4 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/eventhistory.phtml:4 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/notifications.phtml:6 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/servicematrix.phtml:5 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/services.phtml:8 -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hosts.phtml:7 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:11 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/downtimes.phtml:9 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/eventhistory.phtml:5 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hosts.phtml:10 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/services.phtml:10 msgid "Sort by" msgstr "Sortiere nach" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:498 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:471 msgid "Start Accepting Passive Checks" -msgstr "" +msgstr "Passive Checks akzepzieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:186 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:162 msgid "Start Time" -msgstr "" +msgstr "Anfangszeit" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:430 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:403 msgid "Start obsessing" -msgstr "" +msgstr "Verfolgung beginnen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:435 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:408 msgid "Start obsessing over this object." -msgstr "" +msgstr "Verfolgung dieses Objekts beginnen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:68 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TimelineController.php:58 msgid "Started downtimes" -msgstr "" +msgstr "Begonnene Downtimes" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:119 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/downtimes.phtml:34 +msgid "Starts" +msgstr "Beginnt" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:94 msgid "Sticky Acknowledgement" -msgstr "" +msgstr "Klebrige Bestätigung" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:464 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:437 msgid "Stop Accepting Passive Checks" -msgstr "" +msgstr "Passive Checks nicht mehr akzeptieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1047 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1020 msgid "Stop monitoring instance. You have to start it again from command line." -msgstr "" +msgstr "Überwachungsinstanz stoppen. Muss anschließen von der Kommandozeile aus neu gestartet werden." -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:396 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:369 msgid "Stop obsessing" -msgstr "" +msgstr "Verfolgung deaktivieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:401 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:374 msgid "Stop obsessing over this object." -msgstr "" +msgstr "Verfolgung für dieses Objekt deaktivieren" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:184 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:159 msgid "Submit Passive Check Result" -msgstr "" +msgstr "Passives Check-Ergebnis übermitteln" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:86 -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:299 +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:117 +msgid "System" +msgstr "System" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:61 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:275 msgid "TODO: Help message when with children is disabled" msgstr "" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:84 -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:271 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:59 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:247 msgid "TODO: Help message when with children is enabled" msgstr "" +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:54 +msgid "Tactical Overview" +msgstr "Taktische Übersicht" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:51 +msgid "Temporarily disable" +msgstr "Temporär deaktivieren" + #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/components/notifications.phtml:25 #, php-format msgid "The last one occured %s ago" msgstr "Die letzte geschah vor %s" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/DelayNotificationForm.php:70 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/DelayNotificationForm.php:45 msgid "The notification delay will be disregarded if the host/service changes state before the next notification is scheduled to be sent out." -msgstr "" +msgstr "Die Benachrichtigungsverzögerung wird ignoriert wenn der Host/Service vor der nächsten zu versendenden Benachrichtigung seinen Status ändert." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:49 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ShowController.php:111 +msgid "The parameter `contact' is required" +msgstr "Der Parameter `contact' ist erforderlich" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:3 +msgid "This Object's Event History" +msgstr "Historie dieses Objekts" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:24 msgid "This command is used to acknowledge host or service problems. When a problem is acknowledged, future notifications about problems are temporarily disabled until the host/service changes from its current state." -msgstr "" +msgstr "Dieses Kommando wird benutzt um Host- oder Service-Probleme zu bestätigen. Wenn ein Problem bestätigt ist, werden zukünftige Benachrichtigungen temporär deaktiviert, bis der Host/Service seinen Zustand wieder ändert." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommentForm.php:47 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CommentForm.php:22 msgid "This command is used to add a comment to hosts or services." -msgstr "" +msgstr "Dieses Kommando wird benutzt um Kommentare zu Hosts oder Services hinzuzufügen." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/DelayNotificationForm.php:49 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/DelayNotificationForm.php:24 msgid "This command is used to delay the next problem notification that is sent out." -msgstr "" +msgstr "Dieses Kommando wird benutzt um den Versand der nächsten Benachrichtigung zu diesem Problem zu verzögern." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:145 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:121 msgid "This command is used to schedule downtime for hosts/services. During the specified downtime, Icinga will not send notifications out about the affected objects. When the scheduled downtime expires, Icinga will send out notifications as it normally would. Scheduled downtimes are preserved across program shutdowns and restarts." -msgstr "" +msgstr "Dieses Kommando wird benutzt um Downtimes für Hosts/Services einzuplanen. Während der angegebenen Downtime wird Icinga keine Benachrichtigungen zum entsprechenden Objekt versenden. Wenn die eingeplante Downtime vorüber ist, wird Icinga mit dem Versand der Benachrichtigungen wie gewohnt fortfahren. Eingeplante Downtimes übersteh das Herunterfahren und Neustarten der Applikation." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:49 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:24 msgid "This command is used to schedule the next check of hosts/services. Icinga will re-queue the check at the time you specify." -msgstr "" +msgstr "Dieses Kommando wird benutzt, um den nächsten Check des Hosts/Services einzuplanen. Icinga wird den Check für den von dir gewählten Zeitpunkt vormerken." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:47 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:22 msgid "This command is used to send a custom notification about hosts or services. Useful in emergencies when you need to notify admins of an issue regarding a monitored system or service." -msgstr "" +msgstr "Dieses Kommando ermöglicht es, personalisierte Benachrichtigungen für Hosts oder Services zu versenden. Nützlich ist das vor allem im Notfall, wenn man andere Administratoren über Probleme zu einem bestimmten System oder Dienst informieren möchte." -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:131 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:106 msgid "This command is used to submit a passive check result for particular hosts/services. It is particularly useful for resetting security-related objects to OK states once they have been dealt with." -msgstr "" +msgstr "Dieses Kommando erlaubt es, ein passives Check-Ergebnis für einen bestimmten Host oder Service einzuliefern. Das ist for allem dann nützlich, wenn man sicherheitsrelevante Objekte zurück auf einen OK-Status setzen möchte, sobald man sich darum gekümmert hat." -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/host.phtml:3 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:90 +msgid "This comment does not expire." +msgstr "Dieser Kommentar verfällt nicht." + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:87 +#, php-format +msgid "This comment expires on %s at %s." +msgstr "Dieser Kommentar verfällt am %s um %s." + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:83 +msgid "This comment is not persistent." +msgstr "Dieser Kommentar ist nicht persistent." + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:82 +msgid "This comment is persistent." +msgstr "Dieser Kommentar ist persistent." + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/downtimes.phtml:89 +#, php-format +msgid "This fixed downtime has been scheduled to start on %s at %s and to end on %s at %s." +msgstr "Diese fixe Downtime wurde eingeplant um am %s um %s zu starten und am %s um %s zu enden." + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/downtimes.phtml:81 +#, php-format +msgid "This fixed downtime was started on %s at %s and expires on %s at %s." +msgstr "Diese fixe Downtime begann am %s um %s und endet am %s um %s." + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/downtimes.phtml:72 +#, php-format +msgid "This flexible downtime has been scheduled to start between %s - %s and to last for %s." +msgstr "Diese flexible Downtime wurde für den Zeitraum von %s - %s eingeplant und wird %s dauern." + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/downtimes.phtml:63 +#, php-format +msgid "This flexible downtime was started on %s at %s and lasts for %s until %s at %s." +msgstr "Diese flexible Downtime begann am %s um %s und dauert %s bis %s am %s." + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/host.phtml:4 msgid "This host's current state" msgstr "Aktueller Zustand dieses Host" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:36 -msgid "This object's event history" -msgstr "Historie dieses Objekts" - -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/service.phtml:3 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/service.phtml:4 msgid "This service's current state" msgstr "Aktueller Zustand dieses Services" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:174 +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:112 +msgid "Timeline" +msgstr "Zeitleiste" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:150 msgid "Triggered by" msgstr "Ausgelöst von" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:79 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:54 msgid "UNKNOWN" msgstr "UNBEKANNT" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:73 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:48 msgid "UNREACHABLE" msgstr "UNERREICHBAR" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:71 +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:46 msgid "UP" msgstr "UP" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:90 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/components/servicesummary.phtml:23 +#, php-format +msgid "Unandled services with state %s" +msgstr "Unbestätigte Services mit Status %s" + +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:29 +msgid "Unhandled Hosts" +msgstr "Unbestätigte Hosts" + +#: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:33 +msgid "Unhandled Services" +msgstr "Offene Service-Probleme" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:166 +msgid "Unknown" +msgstr "Unbekannt" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:211 +msgid "Unreachable" +msgstr "Nicht erreichbar" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:199 +msgid "Up" +msgstr "Up" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:65 msgid "Use Expire Time" msgstr "Verfallszeitpunkt nutzen" -#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:77 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:36 +msgid "User Comment" +msgstr "Benutzerkommentar" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:52 msgid "WARNING" msgstr "WARNUNG" -#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:915 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:154 +msgid "Warning" +msgstr "Warnung" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:54 +#, php-format +msgid "Will be re-enabled in %s" +msgstr "Wird in %s wieder aktiviert" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:888 msgid "Your new comment has been submitted" msgstr "Dein neuer Kommentar wurde gesendet" -#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/statehistorysummary.phtml:14 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/multi/components/objectlist.phtml:60 +#, php-format +msgid "and %d more" +msgstr "und %d weitere" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/statehistorysummary.phtml:18 msgid "critical events on " msgstr "kritische Ereignisse auf" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:15 +#, php-format +msgid "has been running with PID %d " +msgstr "läuft mit PID %d" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:18 +msgid "is not running" +msgstr "läuft nicht" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/components/servicesummary.phtml:8 +msgid "ok" +msgstr "ok" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/comments.phtml:66 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/downtimes.phtml:47 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/eventhistory.phtml:97 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/show/history.phtml:114 +msgid "on" +msgstr "auf" + +#~ msgid "No entries found" +#~ msgstr "Keine Einträge gefunden" + +#~ msgid "No host found" +#~ msgstr "Kein Host gefunden" + +#~ msgid "Since" +#~ msgstr "Seit" From 5c463554741a83b73f161b2356a114d2e6842599 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 22 Aug 2014 17:58:53 +0200 Subject: [PATCH 013/257] translation: refresh de_DE --- .../locale/de_DE/LC_MESSAGES/icinga.mo | Bin 5165 -> 13357 bytes .../locale/de_DE/LC_MESSAGES/icinga.po | 514 +++++++++++------- .../locale/de_DE/LC_MESSAGES/monitoring.mo | Bin 32307 -> 33411 bytes .../locale/de_DE/LC_MESSAGES/monitoring.po | 16 +- 4 files changed, 336 insertions(+), 194 deletions(-) diff --git a/application/locale/de_DE/LC_MESSAGES/icinga.mo b/application/locale/de_DE/LC_MESSAGES/icinga.mo index 4b6e03d32680b5a10fd80cc62ba6e62b1c5994cb..00ecf88895ca91883a74e7d09a2e340627d5b666 100644 GIT binary patch literal 13357 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

r^ba(Ku0dlXm0auv<1x z=W}T9`tAOJFq;?MT`MO~Hx4QDWtzqUfqTy0u>Zg-8~bl=+;D?EaMRq4`>)@B!~Xqr zY@CYM6D_x6zgOLG{r&^=TO#FZoGzlQOjT%@v!{D`AHz8sryY9>MGkIm?{YJn#nr8J z_h;M2={V}o*`@jAqi5!i9=5kEE#00bBJtK;Cl*f}9&h!)?EYPca`NAdb#P2`&Oly) zsU+EJT(Vcj)oah3KGL{(+)wn7>NO5?C~Kp_bN1$DQthe>Qca9!Z`-cpetk(wnS47Y zKRO;~86_!d1ms+tU(XLaTaR|*tUem|#*adoDz_aD;C!QG&EQNr= zsHmm_Cw`2%?V1W;aW*3=kQ8elaixpK{IF~nL$Yc{Ig0zXK75h;BF>ROx6L!u8LJni z&3dc#z%ncm_^c#)a-!oCw74ZRdpb^1HeUv+N>P(;J%Y^9q~ntg(`!5I|x%p>GL&tZdB#^0+8)uh{rP~;a3O<_7y8485<+dr+vuj(AIQ~+1>%`e^ za|A<<3sbAyxbU_jH(gc}MsQeR3?_R!nU-6q#5s048k0dMqJ}7YvrEiF!r+uUGe=3- zRiUFW$4Al)f-{pw7#HW2TA*m!%n?p6E_2)%!e|TU@|3Wo699Zd0&Pxk_&IdDoGR7P z0WNZuq;rM-7Iu}4iIUg`bzqfEI?iFnmaTQ8W;{`_o6q`jDuX9+$TDwDoR(X?LK@=r z#I4@yK`8``IE%$(TaU0YPIfHr6mG2=N;~apQk|EHsAR_jnUpGxXb*?9HpPCa_#sJA z%H@oWdbR3EZk~g_URQ=$yaT3~EFDY=GQWdyHmuIql{*cqogg)y?$)CzWKrZB9S28M zJa0$twow=Fyknl6(sx%OZ>?I>AqT0-dDnf+3PN{$_I5R0%^N%Z3;X#qi7VwzbgF%) zbDXNnHKs~=3Z!PfDKTO8lq9^!(3$$-=*y(a?Dk4oJ6rf46-@=7Om#krdho}IVY~67 zMfg4`pR#_GOWu}%*y<(nNdJd{Io-$OCQ5*3T^KaSo&VWRK?uT9yxM!%W2zUmrASHN zE{2L98lP>Cv~JcNyjt*{)oo_6e_e^8iF&mc&SG5&NGdlR! z{?hkR^+*iQ#--0%P0fiR{-EHeDCHB5-sNGxk0SHk`F)h!z3V2#ICaQI>L&;3G~r;3 zbQn*%#AjQlaZdrcDaGlF=Qd-$%0(!#83(H$JEfVhH^nDUJ_;a9^=T42&JTc4?l$*BZ& zCa8jo6>hhqm?8?O_eV|n1@DlZWKd>XN7lxw53RHIctkJ|i)zJpg?}6^e4S>7%Y`9^ zGpCH*=LpjLP^yHj$YyUT{*t%oXFlsq#=lYA2(QTUr<47OqUDgHr>|NnQii-5UzzW; z9aki4jDA~_+SJZooQKF%Y{Zp_1(gdbEIYA$U?9WgSCp(cSxQJgxI{yKfer*unV3T7L|*2` zp=8>ve!_D*)$}7GmG4cwb7vK?e{rQT?@FJTDN%i5yQPZ|N+`DPWJjv~QNUG0$q78! z!sVz+#oLu;$7x_@NShcy zJj1Ri(>Cxu{Jd$ssn7VMbs#b$y|0V3uC9SeHVMG2Iwi88^lo-{Fbw1SBky%F9@Wvj zRseTuQ1Fs6O^M#>N2#5jyK3*&Lmay6v&D=v@>+RU2Z~;}Pjr>Cud6eRs1NHosS^%- z30NlS_&XK9nL+`Pmp|NhKs-s~PWl^u?DE0IZ^!p^2IuAG^YoCFQlStp>gh%?%RNPm zZGws%{MZx=bO-Ma>+yn_|-A;FGt>H%MbACp0aidJ!4_EC(=@ za|6-njH3Uj&|y{X0^eVs97DxY(VLBWOZI0MtBj8^p?KaGmZ(5MLP18;~(u`iaKR&`iET2FgG)iV@SGc&ngbGUSy^a)^p z>ya*{4*q4s{fsriCLQ11A#3H>O5-rZuqTy->>l;p6B5V?zGzm*n+xj+?f^e&CCVkk z_qtBsC9nEkN0G)nMesXYWrJ{x)Z3@*v7k1-Y)s2fVe@spup{Y z`S?E-&^LE%o)sAr<>&toS_b#K+V>8$`0Dq?X$j?^(J4L@T6CH)IslszZ85_>ite16 F`CoIfoRt6o delta 2151 zcmY+^TWl0n9LMofK#*SOmU1mE478;!m$KVRu?2+ET7nV^qGCmiOd>}FL5+5{8d@{i_#%TQhwo|Mp`#+yKXJ^jk zKWF#i@Ws~g9~aMi%~19d^~8g7jB)YQJSs|TzA=li1{b3f*@>032XFx%#wt9Dz35>B zUcl9O9S`7S^!+v-sx@ZZoZvzaz7qK+-a-33#_$q0;TKW=FL)>I-%xA36}A6FjWdTY z)gOyoiW;vDH=={pxF08&-#o^JR`@qoVEw}B9krr%7)K4f6IbBc8;5GIq*rdWHK*gPuQzH5i~4@?sVF*Fdk*!Nogjzs1@-e%pHsK&@$0t!6cmZ|ascQ1C44kGzJ2`_|(7UJ< zeiGgIIVNa-iJEu{FJJ}RYr+qaO`Gpg3z>}k16iw?!?u;tn#csU&^|QIg$6i*n)obg zN9Rxrdk;16XOUl_c5pNDC)C0xkz-)~LG5%Q2TJ`h)cxyG{abJqcHu`j{s0%+X$9NT z#4*%DR-*=7k6K6~`hGhqb^A~Q4@N$MaoR4f$J5w|ALB~=0hO64)cEr_5FFxhQ^|!E z&=}c@oSjl>rKVX*-A?Q(^-fp30mFY)DSKO@ejUQQ3H_0&Y#?-?6KYVjK`m0nAv*N? zuTzWCOl&5!>y5-(LObat$ZF{z^`nXor^*1K-Ki+OdR5xBQrtt#lx{BC2xV?7(MhP( zGJmP)RI4bZD!U2Jj%g=Ul%biT*P#@u=y2(8R)0)0WiJ=oi55aC8RxRG=eNoUf;3mDSS2$q?ysRx%BW_{X4CI2Ob^3-~KV$Qkr>a+$Rqylj1vi^Dkzskw z*>Ixf=$ZrWsFx{?Zw}b8f;s4BtmEejPC8fgQ|)0}Z9JT+ohTnQOh4-7iurJIN!$Ej z)JxiY_;OvUFK?ZGn|6!Yg0r6qiws~M%G?&Il<;k\n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: /usr/local/src/bugfix.master/application/views/scripts/mixedPagination.phtml:15 -#, php-format -msgid "%d to %d of %d" -msgstr "%d bis %d von %d" - #: /usr/local/src/bugfix.master/application/views/scripts/pivottablePagination.phtml:9 #, php-format msgid "%s: %d to %d of %d" msgstr "%s: %d bis %d von %d" -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:117 +#: /usr/local/src/bugfix.master/application/forms/Authentication/LoginForm.php:36 +msgid "...and your password" +msgstr "...und dein Kennwort ein" + +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/FilterEditor.php:132 +msgid "Add" +msgstr "Hinzufügen" + +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/FilterWidget.php:81 +msgid "Add filter..." +msgstr "Filter hinzufügen..." + +#: /usr/local/src/bugfix.master/application/controllers/AuthenticationController.php:118 +msgid "All configured authentication methods failed. Please check the system log or Icinga Web 2 log for more information." +msgstr "Alle konfigurierten Authentifizierungsmethoden sind fehlgeschlagen. Bitte überprüfe das Systemlog oder jenes von Icinga Web 2 für weitere Details." + +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:91 msgid "Application Prefix" msgstr "Anwendungspräfix" -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/DbBackendForm.php:78 -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:80 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Menu.php:197 +msgid "ApplicationLog" +msgstr "Anwendungslog" + +#: /usr/local/src/bugfix.master/library/Icinga/Web/Form/notyet_FormWizard.php:31 +msgid "Back" +msgstr "Zurück" + +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/DbBackendForm.php:53 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:55 msgid "Backend Name" msgstr "Backend-Name" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:282 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:257 msgid "Bind DN" msgstr "Bind DN" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:294 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:269 msgid "Bind Password" msgstr "Bind Kennwort" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:358 -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/BaseBackendForm.php:139 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:333 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/BaseBackendForm.php:114 msgid "Check this box to enforce changes without connectivity validation" msgstr "Aktiviere dieses Häkchen um die Änderungen ohne Validierung der Verbindung zu speichern" -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:73 +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:47 msgid "Check this to enable logging." msgstr "Aktiviere dieses Häkchen um das Logging zu aktivieren." -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:187 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/FilterEditor.php:108 +msgid "Click to add a filter expression to this operator" +msgstr "Hier klicken, um einen Filter-Ausdruck zu diesem Operator hinzuzufügen" + +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/FilterEditor.php:105 +msgid "Click to add another operator below this one" +msgstr "Hier klicken, um unterhalb dieses Operators einen weiteren hinzuzufügen" + +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/FilterEditor.php:97 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/FilterWidget.php:69 +msgid "Click to remove this part of your filter" +msgstr "Klicken, um diesen Teil des Filters zu löschen" + +#: /usr/local/src/bugfix.master/library/Icinga/Web/Menu.php:189 +msgid "Configuration" +msgstr "Konfiguration" + +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:165 msgid "Connection Validation Failed: " msgstr "Überprüfung der Verbindung fehlgeschlagen: " -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:477 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:452 msgid "Connectivity validation failed, connection to the given resource not possible." msgstr "Überprüfung fehlgeschlagen, konnte keine Verbindung zu der angegebenen Ressource herstellen." -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:454 -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:470 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:429 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:445 msgid "Connectivity validation failed, the provided file does not exist." msgstr "Überprüfung fehlgeschlagen, die angegebene Datei existiert nicht." -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/DbBackendForm.php:90 +#: /usr/local/src/bugfix.master/application/controllers/AuthenticationController.php:59 +msgid "Could not read your authentiction.ini, no authentication methods are available." +msgstr "Deine authentication.ini konnte nicht gelesen werden, darum sind keine Authentifizierungsmethoden verfügbar." + +#: /usr/local/src/bugfix.master/application/layouts/scripts/body.phtml:31 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Menu.php:175 +msgid "Dashboard" +msgstr "Dashboard" + +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/DbBackendForm.php:65 msgid "Database Connection" msgstr "Datenbankverbindung" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:183 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:158 msgid "Database Name" msgstr "Datenbankname" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:144 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:119 msgid "Database Type" msgstr "Datenbanktyp" -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:89 +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:63 msgid "Debug" msgstr "Debug" -#: /usr/local/src/bugfix.master/application/forms/Config/GeneralForm.php:185 +#: /usr/local/src/bugfix.master/application/forms/Config/GeneralForm.php:101 msgid "Default Language" msgstr "Standardsprache" -#: /usr/local/src/bugfix.master/application/controllers/ErrorController.php:62 +#: /usr/local/src/bugfix.master/application/controllers/ErrorController.php:36 #, php-format msgid "Enabling the \"%s\" module might help!" msgstr "Das Modul \"%s\" zu aktivieren könnte helfen!" -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:86 +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:60 msgid "Error" msgstr "Fehler" -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:139 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/FilterEditor.php:109 +msgid "Expression" +msgstr "Ausdruck" + +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:113 msgid "Facility" msgstr "Facility" -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:102 -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:383 +#: /usr/local/src/bugfix.master/application/controllers/PreferenceController.php:55 +#, php-format +msgid "Failed to persist preferences. (%s)" +msgstr "Persistierung der Einstellungen fehlgeschlagen. (%s)" + +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:76 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:358 msgid "File" msgstr "Datei" -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:155 -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:220 -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:231 -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:308 +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:129 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:195 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:206 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:283 msgid "Filepath" msgstr "Dateipfad" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:357 -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/BaseBackendForm.php:138 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/FilterWidget.php:90 +msgid "Filter this list" +msgstr "Diese Liste filtern" + +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/FilterWidget.php:94 +msgid "Filtered" +msgstr "Gefiltert" + +#: /usr/local/src/bugfix.master/library/Icinga/Web/Form/notyet_FormWizard.php:32 +msgid "Finish" +msgstr "Fertigstellen" + +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:332 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/BaseBackendForm.php:113 msgid "Force Changes" msgstr "Änderungen erzwingen" +#: /usr/local/src/bugfix.master/library/Icinga/Web/Form/notyet_QuickForm.php:147 +msgid "Form has successfully been sent" +msgstr "Das Formular wurde erfolgreich versendet" + #: /usr/local/src/bugfix.master/application/views/scripts/search/hint.phtml:7 msgid "Hint" msgstr "Hinweis" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:160 -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:260 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:135 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:235 msgid "Host" msgstr "Host" @@ -132,165 +202,183 @@ msgstr "Hosts" msgid "I'm ready to search, waiting for your input" msgstr "Ich bin bereit zur Suche, warte auf deine Eingabe" -#: /usr/local/src/bugfix.master/application/controllers/AuthenticationController.php:63 +#: /usr/local/src/bugfix.master/application/controllers/AuthenticationController.php:40 #: /usr/local/src/bugfix.master/application/views/scripts/authentication/login.phtml:8 msgid "Icingaweb Login" msgstr "Icingaweb Anmeldung" -#: /usr/local/src/bugfix.master/application/views/scripts/authentication/logout.phtml:17 +#: /usr/local/src/bugfix.master/application/views/scripts/authentication/logout.phtml:14 msgid "If this message does not disappear, it might be necessary to quit the current session manually by clearing the cache, or by closing the current browser session." msgstr "Wenn diese Nachricht nicht verschwindet könnte es nötig sein die aktuelle Sitzung manuell zu beenden indem der Cache gelöscht order die Browsersitzung geschlossen wird." -#: /usr/local/src/bugfix.master/application/controllers/AuthenticationController.php:118 +#: /usr/local/src/bugfix.master/application/controllers/AuthenticationController.php:131 msgid "Incorrect username or password" msgstr "Benutzername oder Kennwort ungültig" -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:88 +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:62 msgid "Information" msgstr "Information" -#: /usr/local/src/bugfix.master/library/Icinga/Web/Wizard/Wizard.php:337 -#: /usr/local/src/bugfix.master/library/Icinga/Web/Wizard/Wizard.php:380 -msgid "Install" -msgstr "Installieren" - -#: /usr/local/src/bugfix.master/application/views/scripts/install/index.phtml:29 -msgid "Installation" -msgstr "Installation" - -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:92 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:67 msgid "LDAP Resource" msgstr "LDAP Ressource" -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:115 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:90 msgid "LDAP User Name Attribute" msgstr "LDAP-Attribut für Benutzername" -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:104 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:79 msgid "LDAP User Object Class" msgstr "LDAP Objektklasse für Benutzer" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:232 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:207 msgid "Location of your icinga objects.cache file" msgstr "Pfad zur Datei objects.cache von Icinga" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:221 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:196 msgid "Location of your icinga status.dat file" msgstr "Pfad zur Datei status.dat von Icinga" -#: /usr/local/src/bugfix.master/application/controllers/InstallController.php:69 -msgid "Logging" -msgstr "Logging" - -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:72 +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:46 msgid "Logging Enabled" msgstr "Logging aktiv" -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:82 +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:56 msgid "Logging Level" msgstr "Log-Level" -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:98 +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:72 msgid "Logging Type" msgstr "Logging-Typ" -#: /usr/local/src/bugfix.master/application/views/scripts/authentication/logout.phtml:15 +#: /usr/local/src/bugfix.master/application/views/scripts/authentication/logout.phtml:12 msgid "Logging out..." msgstr "Abmelden..." -#: /usr/local/src/bugfix.master/application/views/scripts/authentication/logout.phtml:28 +#: /usr/local/src/bugfix.master/application/views/scripts/authentication/logout.phtml:21 msgid "Login" msgstr "Anmelden" -#: /usr/local/src/bugfix.master/application/layouts/scripts/body.phtml:39 #: /usr/local/src/bugfix.master/application/layouts/scripts/parts/topbar.phtml:35 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Menu.php:202 msgid "Logout" msgstr "Abmelden" -#: /usr/local/src/bugfix.master/application/views/scripts/authentication/logout.phtml:64 -msgid "Logout not possible, it may be necessary to quit the session manually by clearing the cache, or closing the current browser session. Error: " -msgstr "" - -#: /usr/local/src/bugfix.master/application/views/scripts/authentication/logout.phtml:69 +#: /usr/local/src/bugfix.master/application/views/scripts/authentication/logout.phtml:43 msgid "Logout successful!" msgstr "Abmelden erfolgreich!" -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/ReorderForm.php:137 -msgid "Move down in authentication order" -msgstr "" +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/FilterEditor.php:235 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/FilterWidget.php:95 +msgid "Modify this filter" +msgstr "Diesen Filter bearbeiten" -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/ReorderForm.php:111 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Menu.php:193 +msgid "Modules" +msgstr "Module" + +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/ReorderForm.php:112 +msgid "Move down in authentication order" +msgstr "In der Authentifizierungsreihenfolge nach unten schieben" + +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/ReorderForm.php:86 msgid "Move up in authentication order" -msgstr "" +msgstr "In der Authentifizierungsreihenfolge nach oben schieben" #: /usr/local/src/bugfix.master/application/views/scripts/pivottablePagination.phtml:16 msgid "Navigation" msgstr "Navigation" -#: /usr/local/src/bugfix.master/application/views/scripts/mixedPagination.phtml:83 #: /usr/local/src/bugfix.master/application/views/scripts/mixedPagination.phtml:86 -#: /usr/local/src/bugfix.master/library/Icinga/Web/Wizard/Wizard.php:337 -#: /usr/local/src/bugfix.master/library/Icinga/Web/Wizard/Wizard.php:380 +#: /usr/local/src/bugfix.master/application/views/scripts/mixedPagination.phtml:89 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Form/notyet_FormWizard.php:30 msgid "Next" msgstr "Weiter" -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/DbBackendForm.php:144 -msgid "No users found under the specified database backend" -msgstr "" +#: /usr/local/src/bugfix.master/application/controllers/AuthenticationController.php:110 +msgid "No authentication methods available. Did you create authentication.ini when installing Icinga Web 2?" +msgstr "Keine Authentifizierungsmethode verfügbar. Hast du beim Installieren von Icinga Web 2 eine authentication.ini erstellt?" -#: /usr/local/src/bugfix.master/application/controllers/ErrorController.php:59 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/DbBackendForm.php:119 +msgid "No users found under the specified database backend" +msgstr "Im konfigurierten Datenbankbackend wurden keine Benutzer gefunden" + +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/FilterEditor.php:106 +msgid "Operator" +msgstr "Operator" + +#: /usr/local/src/bugfix.master/application/views/scripts/mixedPagination.phtml:33 +msgid "Page" +msgstr "Seite" + +#: /usr/local/src/bugfix.master/application/controllers/ErrorController.php:33 msgid "Page not found." msgstr "Seite nicht gefunden." -#: /usr/local/src/bugfix.master/application/forms/Authentication/LoginForm.php:65 -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:206 +#: /usr/local/src/bugfix.master/application/views/scripts/mixedPagination.phtml:12 +msgid "Pagination" +msgstr "Seitennavigation" + +#: /usr/local/src/bugfix.master/application/forms/Authentication/LoginForm.php:35 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:181 msgid "Password" msgstr "Kennwort" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:319 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:294 msgid "Pattern" msgstr "Muster" -#: /usr/local/src/bugfix.master/library/Icinga/Web/Form/Element/Number.php:61 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Form/Element/Number.php:36 msgid "Please enter a number." msgstr "Bitte eine Nummer eingeben." +#: /usr/local/src/bugfix.master/application/forms/Authentication/LoginForm.php:25 +msgid "Please enter your username..." +msgstr "Bitte gib deinen Benutzernamen..." + +#: /usr/local/src/bugfix.master/application/controllers/AuthenticationController.php:126 +msgid "Please note that not all authentication methods where available. Check the system log or Icinga Web 2 log for more information." +msgstr "Beachte bitte dass nicht alle Authentifizierungsmethoden verfügbar waren. Überprüfe das Systemlog oder jenes von Icinga Web 2 für weitere Informationen." + #: /usr/local/src/bugfix.master/application/views/scripts/search/hint.phtml:8 msgid "Please use the asterisk (*) as a placeholder for wildcard searches. For convenience I'll always add a wildcard after the last character you typed." msgstr "Bitte benutze das Sternchen (*) als Jokerzeichen für eine Suche mit Platzhaltern. Der Einfachheit halber hänge ich immer einen Platzhalter hinter das letzte von dir getippte Zeichen." -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:171 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:146 msgid "Port" msgstr "Port" -#: /usr/local/src/bugfix.master/application/layouts/scripts/body.phtml:38 #: /usr/local/src/bugfix.master/application/layouts/scripts/parts/topbar.phtml:32 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Menu.php:185 msgid "Preferences" msgstr "Einstellungen" -#: /usr/local/src/bugfix.master/application/views/scripts/mixedPagination.phtml:45 +#: /usr/local/src/bugfix.master/application/controllers/PreferenceController.php:48 +msgid "Preferences updated successfully" +msgstr "Einstellungen erfolgreich aktualisiert" + #: /usr/local/src/bugfix.master/application/views/scripts/mixedPagination.phtml:48 +#: /usr/local/src/bugfix.master/application/views/scripts/mixedPagination.phtml:51 msgid "Prev" msgstr "Zurück" -#: /usr/local/src/bugfix.master/library/Icinga/Web/Wizard/Wizard.php:326 -#: /usr/local/src/bugfix.master/library/Icinga/Web/Wizard/Wizard.php:367 -msgid "Previous" -msgstr "Vorheriges" +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/FilterWidget.php:99 +msgid "Remove this filter" +msgstr "Diesen Filter entfernen" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:333 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:308 msgid "Resource Name" -msgstr "" +msgstr "Ressourcename" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:375 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:350 msgid "Resource Type" -msgstr "" +msgstr "Ressourcetyp" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:271 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:246 msgid "Root DN" msgstr "Wurzel-DN" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:379 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:354 msgid "SQL Database" msgstr "SQL Datenbank" @@ -301,187 +389,241 @@ msgstr "SQL Datenbank" msgid "Search" msgstr "Suche" -#: /usr/local/src/bugfix.master/application/layouts/scripts/parts/navigation.phtml:17 +#: /usr/local/src/bugfix.master/application/layouts/scripts/parts/navigation.phtml:15 msgid "Search..." msgstr "Suche..." -#: /usr/local/src/bugfix.master/application/forms/Config/GeneralForm.php:189 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Form/Validator/notyet_CsrfTokenValidator.php:20 +msgid "Security check failed, please submit your form again" +msgstr "Sicherheitscheck fehlgeschlagen, bitte sende das Formular erneut ab" + +#: /usr/local/src/bugfix.master/application/forms/Config/GeneralForm.php:105 msgid "Select the language to use by default. Can be overwritten by a user in his preferences." -msgstr "" +msgstr "Die zu benutzende Standard-Sprache. Kann von Benutzern in deren Einstellungen überschrieben werden." #: /usr/local/src/bugfix.master/application/controllers/SearchController.php:41 #: /usr/local/src/bugfix.master/application/views/scripts/pivottablePagination.phtml:34 msgid "Services" msgstr "Services" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:245 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/Limiter.php:84 +#, php-format +msgid "Show %s rows on one page" +msgstr "Zeige %s Zeilen pro Seite" + +#: /usr/local/src/bugfix.master/application/views/scripts/mixedPagination.phtml:16 +#, php-format +msgid "Show rows %d to %d of %d" +msgstr "Zeige die Zeilen %d bis %d von %d" + +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:220 msgid "Socket" -msgstr "" +msgstr "Socket" -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:140 +#: /usr/local/src/bugfix.master/application/views/scripts/config/module.phtml:22 +msgid "State" +msgstr "Status" + +#: /usr/local/src/bugfix.master/library/Icinga/Web/Menu.php:181 +msgid "System" +msgstr "System" + +#: /usr/local/src/bugfix.master/application/views/scripts/authentication/login.phtml:4 +msgid "The Icinga logo" +msgstr "Das Icinga Logo" + +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:114 msgid "The Syslog facility to utilize." -msgstr "" +msgstr "Die zu benutzende Syslog-Facility" -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:116 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:91 msgid "The attribute name used for storing the user name on the ldap server" -msgstr "" +msgstr "Der Attributname welcher benutzt wird, um Benutzernamen auf dem LDAP-Server abzulegen" -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/DbBackendForm.php:91 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/DbBackendForm.php:66 msgid "The database connection to use for authenticating with this provider" -msgstr "" +msgstr "Die Datenbankverbindung, welche zur Authentifizierung mit diesem Provider genutzt werden soll" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:309 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:284 msgid "The filename to fetch information from" -msgstr "" +msgstr "Die Datei aus welcher Informationen gelesen werden sollen" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:161 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:136 msgid "The hostname of the database." -msgstr "" +msgstr "Der Hostname der Datenbank." -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:261 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:236 msgid "The hostname or address of the LDAP server to use for authentication" -msgstr "" +msgstr "Der Hostname oder die IP-Adresse des LDAP-Servers der zur Authentifizierung genutzt werden soll" -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:156 +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:130 msgid "The logfile to write messages to." -msgstr "" +msgstr "Das Logfile in welches Nachrichten geschrieben werden sollen." -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:83 +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:57 msgid "The maximum loglevel to emit." -msgstr "" +msgstr "Loglevel bis zu welchem Nachrichten ausgegeben werden sollen." -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:118 +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:92 msgid "The name of the application by which to prefix syslog messages." -msgstr "" +msgstr "Der Anwendungsname welcher Syslog-Nachrichten vorangestellt werden soll." -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:184 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:159 msgid "The name of the database to use" -msgstr "" +msgstr "Der Name der zu benutzenden Datenbank" -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:81 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:56 msgid "The name of this authentication backend" -msgstr "" +msgstr "Der Name dieses Authentifizierungsbackends" -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/DbBackendForm.php:79 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/DbBackendForm.php:54 msgid "The name of this authentication provider" -msgstr "" +msgstr "Der Name dieses Authentifizierungsproviders" -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:105 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:80 msgid "The object class used for storing users on the ldap server" -msgstr "" +msgstr "Die Objekt-Klasse welche benutzt wird, um Benutzer auf diesem LDAP-Server abzulegen" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:207 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:182 msgid "The password to use for authentication" -msgstr "" +msgstr "Das Kennwort welche zur Authentifizierung benutzt werden soll" + +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:270 +msgid "The password to use for querying the ldap server" +msgstr "Das Kennwort welches zum Abfragen des LDAP-Servers benutzt werden soll" + +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:221 +msgid "The path to your livestatus socket used for querying monitoring data" +msgstr "Der Pfad zu deinem Live-Status Socket, über welchen Monitoring-Daten abgefragt werden sollen" + +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:247 +msgid "The path where users can be found on the ldap server" +msgstr "Der Pfad unter welchem Benutzer auf diesem LDAP-Server gefunden werden können." + +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:147 +msgid "The port to use." +msgstr "Der zu benutzende Port." #: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:295 -msgid "The password to use for querying the ldap server" -msgstr "" - -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:246 -msgid "The path to your livestatus socket used for querying monitoring data" -msgstr "" - -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:272 -msgid "The path where users can be found on the ldap server" -msgstr "" - -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:172 -msgid "The port to use." -msgstr "" - -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:320 msgid "The regular expression by which to identify columns" -msgstr "" +msgstr "Der zu benutzende reguläre Ausdruck, mit welchem Spalten identifiziert werden können" -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:93 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:68 msgid "The resource to use for authenticating with this provider" -msgstr "" +msgstr "Die Resource die zum Authentifizieren mit diesem Provider genutzt werden soll" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:145 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:120 msgid "The type of SQL database you want to create." -msgstr "" +msgstr "Der Typ der zu benutzenden SQL Datenbank." -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:99 +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:73 msgid "The type of logging to utilize." -msgstr "" +msgstr "Der Typ des zu benutzenden Loggings." -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:376 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:351 msgid "The type of resource" -msgstr "" +msgstr "Der Typ der Ressource" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:334 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:309 msgid "The unique name of this resource" -msgstr "" +msgstr "Der eindeutige Name dieser Resource" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:283 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:258 msgid "The user dn to use for querying the ldap server" -msgstr "" +msgstr "Die DN des Benutzers mit welchem dieser LDAP-Server befragt werden soll" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:195 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:170 msgid "The user name to use for authentication." -msgstr "" +msgstr "Der zur Authentifizierung zu benutzende Benutzername." #: /usr/local/src/bugfix.master/application/views/scripts/config/module.phtml:6 msgid "There is no such module installed." msgstr "Gegenwärtig ist kein solches Modul installiert." -#: /usr/local/src/bugfix.master/application/views/scripts/config/module.phtml:32 +#: /usr/local/src/bugfix.master/application/views/scripts/config/module.phtml:46 msgid "This module has no dependencies" msgstr "Dieses Modul hat keine Abhängigkeiten" -#: /usr/local/src/bugfix.master/library/Icinga/Application/Modules/Module.php:383 +#: /usr/local/src/bugfix.master/library/Icinga/Application/Modules/Module.php:435 msgid "This module has no description" msgstr "Dieses Modul hat keine Beschreibung" -#: /usr/local/src/bugfix.master/application/forms/Preference/GeneralForm.php:100 +#: /usr/local/src/bugfix.master/application/views/scripts/config/devtools.phtml:5 +msgid "UI Debug" +msgstr "UI Debug" + +#: /usr/local/src/bugfix.master/application/forms/Preference/GeneralForm.php:43 msgid "Use Default Language" msgstr "Standardsprache verwenden" -#: /usr/local/src/bugfix.master/application/forms/Preference/GeneralForm.php:109 +#: /usr/local/src/bugfix.master/application/forms/Preference/GeneralForm.php:52 msgid "Use the following language to display texts and messages" -msgstr "" +msgstr "Die folgende Sprache benutzen, um Texte und Nachrichten anzuzeigen" -#: /usr/local/src/bugfix.master/application/forms/Authentication/LoginForm.php:57 -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:194 +#: /usr/local/src/bugfix.master/application/forms/Authentication/LoginForm.php:24 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:169 msgid "Username" msgstr "Benutzername" -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:169 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/LdapBackendForm.php:144 msgid "Using ldap is not possible, the php extension \"ldap\" is not installed." -msgstr "" +msgstr "Es ist nicht möglich, LDAP zu benutzen, da die PHP-Erweiterung \"LDAP\" nicht installiert ist." -#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/DbBackendForm.php:148 +#: /usr/local/src/bugfix.master/application/forms/Config/Authentication/DbBackendForm.php:123 #, php-format msgid "Using the specified backend failed: %s" -msgstr "" +msgstr "Die angegebene Datenbank zu benutzen war nicht möglich: %s" -#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:87 +#: /usr/local/src/bugfix.master/application/forms/Config/LoggingForm.php:61 msgid "Warning" msgstr "Warnung" -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:435 +#: /usr/local/src/bugfix.master/application/views/scripts/dashboard/index.phtml:13 +msgid "We tried to load a dashboard configuration with no success. Please have look that the configuration does exist:" +msgstr "Der Versuch die Dashboard-Konfiguration zu laden war nicht erfolgreich. Bitte stelle sicher, dass die folgende Konfigurationsdatei existiert:" + +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:410 msgid "You need to install the php extension \"mysql\" and the Zend_Pdo_Mysql classes to use MySQL database resources." -msgstr "" +msgstr "Um MySQL Datenbank-Ressourcen nutzen zu können müssen die PHP-Erweiterung \"mysql\" sowie die Zend_Pdo_Mysql Klassen installiert sein." -#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:442 +#: /usr/local/src/bugfix.master/application/forms/Config/ResourceForm.php:417 msgid "You need to install the php extension \"pgsql\" and the Zend_Pdo_Pgsql classes to use PostgreSQL database resources." -msgstr "" +msgstr "Um PostgreSQL Datenbank-Ressourcen nutzen zu können müssen die PHP-Erweiterung \"pqsql\" sowie die Zend_Pdo_Pgsql Klassen installiert sein." -#: /usr/local/src/bugfix.master/application/forms/Preference/GeneralForm.php:106 +#: /usr/local/src/bugfix.master/application/forms/Preference/GeneralForm.php:49 msgid "Your Current Language" msgstr "Deine aktuelle Sprache" -#: /usr/local/src/bugfix.master/library/Icinga/Util/Format.php:108 -#: /usr/local/src/bugfix.master/library/Icinga/Util/Format.php:114 +#: /usr/local/src/bugfix.master/library/Icinga/Web/Widget/Limiter.php:58 +msgid "all" +msgstr "alle" + +#: /usr/local/src/bugfix.master/library/Icinga/Util/Format.php:83 +#: /usr/local/src/bugfix.master/library/Icinga/Util/Format.php:89 msgid "for" msgstr "für" -#: /usr/local/src/bugfix.master/library/Icinga/Util/Format.php:112 -#: /usr/local/src/bugfix.master/library/Icinga/Util/Format.php:131 -#: /usr/local/src/bugfix.master/library/Icinga/Util/Format.php:133 +#: /usr/local/src/bugfix.master/library/Icinga/Util/Format.php:87 +#: /usr/local/src/bugfix.master/library/Icinga/Util/Format.php:106 +#: /usr/local/src/bugfix.master/library/Icinga/Util/Format.php:108 msgid "since" msgstr "seit" +#: /usr/local/src/bugfix.master/application/views/scripts/config/devtools.phtml:5 +msgid "toggle" +msgstr "umschalten" + +#~ msgid "%d to %d of %d" +#~ msgstr "%d bis %d von %d" + +#~ msgid "Installation" +#~ msgstr "Installation" + +#~ msgid "Logging" +#~ msgstr "Logging" + +#~ msgid "Previous" +#~ msgstr "Vorheriges" + #~ msgid "Icinga Users Login" #~ msgstr "Icinga Benutzeranmeldung" diff --git a/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.mo b/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.mo index d1feb7e365179aaa04ff0aefa9b70503808dfd46..e7c3f0b15ca2130e20f8c27b66c24dfd219db8e4 100644 GIT binary patch delta 8365 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 DPVYTp diff --git a/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.po b/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.po index 7ddc1ef17..29a28d632 100644 --- a/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.po +++ b/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Monitoring Module (2.0.0~alpha4)\n" "Report-Msgid-Bugs-To: dev@icinga.org\n" "POT-Creation-Date: 2014-08-22 16:18+0200\n" -"PO-Revision-Date: 2014-08-22 17:21+0100\n" +"PO-Revision-Date: 2014-08-22 17:57+0100\n" "Last-Translator: Thomas Gelf \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" @@ -1197,11 +1197,11 @@ msgstr "" #: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:65 msgid "Selecting this option causes the notification to be sent out to all normal (non-escalated) and escalated contacts. These options allow you to override the normal notification logic if you need to get an important message out." -msgstr "" +msgstr "Das Aktivieren diese Option verursacht, dass die Benachrichtigung an alle normalen (nicht-eskalierten) sowie eskalierten Kontakte gesendet wird. Die erlaubt es, die normale Benachrichtigungslogik zu übergehen, wenn eine dringende Nachricht versendet werden muss." #: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/CustomNotificationForm.php:72 msgid "Send Custom Notification" -msgstr "" +msgstr "Benutzerdefinierte Benachrichtigung senden" #: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/AcknowledgeForm.php:107 msgid "Send Notification" @@ -1253,19 +1253,19 @@ msgstr "Service im Zustand %s" #: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/RescheduleNextCheckForm.php:37 msgid "Set the date/time when this check should be executed." -msgstr "" +msgstr "Setze den Zeitpunkt zu welchem dieser Check ausgeführt werden soll." #: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:176 msgid "Set the end date/time for the downtime." -msgstr "" +msgstr "Setze den Endzeitpunkt für diese Downtime." #: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php:165 msgid "Set the start date/time for the downtime." -msgstr "" +msgstr "Setze den Startzeitpunkt für diese Downtime." #: /usr/local/src/bugfix.master/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php:132 msgid "Set the state which should be send to Icinga for this objects." -msgstr "" +msgstr "Setze den Status welcher für dieses Objekt an Icinga gesendet werden soll." #: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/CommandController.php:1019 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/process/info.phtml:168 @@ -1477,7 +1477,7 @@ msgstr "Unbestätigte Hosts" #: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:33 msgid "Unhandled Services" -msgstr "Offene Service-Probleme" +msgstr "Unbestätigte Services" #: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/ChartController.php:166 msgid "Unknown" From 70fe22dfad30772cf799396e5aabaf60ae3e5d0a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 22 Aug 2014 18:08:20 +0200 Subject: [PATCH 014/257] monitoring/tactical: fix missing translations --- .../controllers/TacticalController.php | 2 +- .../locale/de_DE/LC_MESSAGES/monitoring.mo | Bin 33411 -> 33663 bytes .../locale/de_DE/LC_MESSAGES/monitoring.po | 29 ++++++++++++++++-- .../components/monitoringfeatures.phtml | 16 +++++----- 4 files changed, 36 insertions(+), 11 deletions(-) diff --git a/modules/monitoring/application/controllers/TacticalController.php b/modules/monitoring/application/controllers/TacticalController.php index 2c99e6d65..a48e053ca 100644 --- a/modules/monitoring/application/controllers/TacticalController.php +++ b/modules/monitoring/application/controllers/TacticalController.php @@ -12,7 +12,7 @@ class Monitoring_TacticalController extends MonitoringController $this->getTabs()->add( 'tactical_overview', array( - 'title' => 'Tactical Overview', + 'title' => $this->translate('Tactical Overview'), 'url' => Url::fromRequest() ) )->activate('tactical_overview'); diff --git a/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.mo b/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.mo index e7c3f0b15ca2130e20f8c27b66c24dfd219db8e4..96f79202619eba3272c65c527b898a1340f47f10 100644 GIT binary patch delta 7737 zcmY+}2Yip$9>?*Mh@A)_gM|D;ge)^lg4i={NX*zIYE?qaD1YN}jk>L-MX6eKY28v% zx+vYXuX0O=N|mBTjb1g{>wdm@PD;x?i2LKPF=&>OtA)ixW`y&A}*KiyF{DEQjBq z26_(l-0N70_Ra5PG@|l#jS0t^s1dYAKg`66I1(#h9;)H#)&UXlH`Yasq#0^6jj&Ef z?U`q6`8Cug-H)1~uaLeQUp7P|Ou%T&LDesF+lsfbITh!zEe3IwZpcEa%pz=zZ(=H* zM~yg~Ev-!#iyA<8RDBQh#{Q_|ITAH9laW<4^H3dkZziK%`XTB;C$J*kz_NHBwV6Cv z9~po;j?uQ<5q0dcP-{OCSzfal`Dc#U@_p1m!WflI!)7}FQ_1MU*O1vVr;&fgli{|; zrl=9+p)XFyTwH_&co%(e66;e1=c1Nq8J5G%sF7|%4e$U~#*0{T{%?`dl-@_}$`rP~ zM(##$oR7Zv9IAm0)*To?c|WRyr?4s(+wu*pM)@A9L2rhu4h5lRFcd@Bf2IW)-ioFV z`r%|Oj|)*FdloC<%c#xuDr(9X$s*%-34ImM#V=C(YOw{v6 zVkk~XV*Qm_W-E4}i}G>gU1Dxp16w$oswL`uFdX$mWbSZk`9@MGXhqdqk zYO|fU-+S`fQ^RFZ*ZH7kEYNK;E^8!eEt{ckNJ4G8HrN2uk$q~WA{*aqL5=LR^|JLI zYN{*KYfXIsYQ&MKh7)Yrok}K%iZs-2&OtT!6l&KmK|NqKYLjlW-ycEtllj)xS7n;i zp~k3&hoCw(2KB0)Vasb!$9x+yK({$fMpIUdb?`oxtX-;ee3Gqcc#iJ}qdMHSjq`mL zYNp1a8k~e$!uc4Cg|@uix)(JAhcJNl%}FvG0P{0yioXzLs1f_Ob7stiVU(Mo&VL5#v}B`Zcr4b&x!9TZ%{nrg@=NH#-%t$(@ix+pai|BS zppMgHsPBj20-TBU(5r(}-w=;e?tm#6(2;vE13P)p9u`o(*opbyMP_(sUM3jS#p&5M zs1e*njX1cg^WYTBq}&&Iw%Lk(@H(br=WfpVUx6W%cc7;FC~EVaLe1QH)En_iH|F1y z%pEG!(0$aV3-0c0x@go5tx-30LS3JMx~@0s!8xewCRz(ndt@$ZW>#Zm+=rUML#QP< z+nxE>)c-++9_*dw=!^ZBDnAUQek}7>6X&7IYp@L8??NrjJC8d*9S>nRkm|CG4&P0tg2X)^pTV9F! zalOOVe~P>mO)+Z5YV~wpMD7M;QmJT)>e&R;+CPhGXeX*8pQAc>65HV=tc1}S&I1!r zo3cGd;Ski!E=Il3UPKLaE$X?iqp!~YM`YB~6BvV+P*d#BPOFBoSP@fEo2e`6K^dq9 zhN4E4i&gO{)cs3s{U+4)J8gMC>Qo)U#FFz*CY}oKUd}Hf?XU^uJWRm#7>B2A*{8Qt z?tq*;GaY%`n!T8e_plkpb2RjvQK}%9gl<)7%h#zXE!mLqPgK~59!!Fne2cWwiyLd4fFDkZWIcr#i zIv&SROK=ri-~+6MEe1IDLali&>i8}}-M1Cf@BqeRz(8k@rD0>rPop}%XCU+6oXlk^ zG@{yr_~irBQRQ{03%{^FK)rZk20NQ_0@kKH6E%RFyeCcc4c_#g)3C2WOWL!AcNVMEHfw!9KGpieLs ze?z?w>br+I73o-?ikYY{HewPULG`@caA)nR<8;aqxDeN&zK z47h_@3Nw-;46SjJ2lwF$%HgA&`aL*R=RbBd59ESP$Un1pjMHF)u}%k?qo%YihG0Kb zLz8WJCaR;W(1ly<_XkkN_&Dm=T|mvm9c+vh#<3@8-z1Sy#Te8JV->c>L)J=9I_0jY z7t2D7!S_(d@)9Os-SN(G>yLWgGpHXv`%p`B5q{?%Y0nON+C>gg2JQY^x5 zxBBwy8d1s^RKloJHe@_f?CU( zSPnz63PxZA#-rADAhyI+SQSrMFIn%R8mctWS-KjifkmU*YmMI6c_Q<#HSI-()_4MH z%@(3|_e-b|?LZx)&+PXXFq!gQTOXJ2yqGdjBU^#$*amcA5o*((#BjWVx~`gglC!Hr ztSK1E7g^|w1=ht_o=v(6qp067*?Hg*)YM);HFyY zH=Kd9nZb*=n)0Zb{N+vO-)ojLwI1X(!iuwM z;W5-6_}+RMgDKy@dgwFH=|EG|eQi+p^+&gQGM0=dPQx-d13j=dA2o<<@&WiSRBGm6 zGElz-E48xrC9j_&ZHU(h&4@On*8Vn8NW^jNVkEgsrjpHSHWS)_k0z~C9I=*|O+;{` z{tKqNZA|MQMP9SBj@VDA=M{((WP1~Nsv~JLm!<}MubEc+B`JuCMNZayh65>AAvzOE zJBa>-cKQdz9U_r9MEryJolu%ej4jDM{ODkx(a2Uk_V6onS?$*%bfntZ3*RLFIQa*7 zmFP`Cka77zcCD8qfEykY7r;8}QMDs7YmM zYD`A2S9MPN;ypq;Ur9T9J<*luOti80RmQ`VpC*(tDTg}QlFzMt_92cEyfjPx$jPyF z8&043lu+tI#M%dTv#Q>Y{66kh-uQQXiKs*VLrlXjQ7M|d3)c|ah)~Ld zu&IXVMIo8O4@5meDV#c``@}OPIp<@j&5yuiHeUtfiRXyrwr(GOM0DgiI>Jh2$$McB ztVG;WrKVV^J&{6XX-c)3i`MFV*ONF^dI5S9nM6AAB%$;oF^16jzf1Jup5{as;wj2~ z@Ex2__>*_Hj8$EI@#gg9(We(Ad@AC1##QTI& z3!*MDkC;w;OXyd=Yo+raL`737X5b`3X%+EtNseR2cYh<_9+gfKpA$WZiquU*4=hF( z{)$Q+h^UgB^YJ$PLDc1%=Bm<^JwePQvZ&M_9nO<4O_7wF5K4O;O8&NUn*4P_zY~0q zXY6v7-Vc-PeV>p|wt3^~kUMp}t4nVFqdS1%hMC1{&HcaZS*hKmNr^+ JApPBD{|9%jjRpV! delta 7513 zcmYk>3w+PjAII^t8OFwJm|d{B%r-N#vD**B+-=ibhRQW7l-!qGe^^wKXjDq*pG%6Q zDbj^XH`k=3B66v}Q1nl_DF4^{cg}h^51-%job&sB&-tF)cU#?9;9ol5-}`M?z;Z*n z)z6svc(%GR2gq-#t6F1DQK{^ASP!pZ1co#)=4VX6ni$d0m{5#IwUdqfGXwaD!4hnQ z%P|_aBe#0Z5i&KXxPrCt2G+q^+!cgz7>TKA9Jazs z7=;aEeI1)@45EKC(3df0B-S>@j7JZaq8fS!LvSDR#O51pj(?yYxGBS`g6XJ%v_n03 zFJv;!0MyKkz@|7EHNdAZjQ-7LGSzT52I5{+$48u}oR?4y{)uX!a%08Dzqn*b56#EU z#u?KYr(iDbz-0Uj^oJY;VdS3)V7N?%Nkff%FdsQO|BsN-NcW71oQ8T6mLcyn^9pM79YQ_WX{Hl$%Il-*+n}DfgR?7UQO?83_y7*{<9;loT*x|&#NBb$mE!BW&QT7kNMGpfDa7=!zq7o0&n zbu9Hs$g9HSXEFcEOr%1a=n2&O;4ReDokaGVxsJLnG233(8`Z%S)Y2_OEzMfggT02q z_%^EDz0S+1y%g@Td#I_0`DYgz4;6ZYO+)sT*^cZ#^8@;0cw2jHA~A|`6VztQL47|M z)$uUY@fwAiv5C&<&QjD;E<#=ZxR;DJ-P0J48H(j}9G(9IWYkb_C;Maxs1AEzLo7s% zcsy##reh;qh>XB&LYwVx^BPobJQL=j+&XPsQV-H>BCEjO=S?E)}a$?u>z0fNEy|(!SRelhKGKV=bJ6YGA3W--x>5bywblRVW|E zOgx4<-?iAe$=D5B;S|ikb*Nulj=OSbe_QT>opt_ak>TZM-bD}ogK3yuWE&cbypznc z&g01bG0_|i4uTnl9dRpaq`zQoypEd5S_AEawM9++7)-@Y*neorBP;HJ?l-1|LJ+ zxCJ=?<^ZN+)a`bY6=DkIC8)LDjjiz#YDA3&^R~o(sPbCWbw{0*hS>K?E7Ybe8N&Rl z!?{#w1glXaUyEAv&8SWGCTfrDLp6BJS$U`(VH#@fyP%d}5^9gk#0V_KdbkoJaT_+k zgF~7BXfhY6Xpe!zYzN&if%0TmUWppfC#a78!bD6QZp-~pzi7-w)o;KoJdAqq>LcvZ z)x&9&o8v>c)=NegB;R56U^wOOs68K%U_wG;t&@{uibt^*uE!pD1@#{AjJI#jDd_d5ViTF_xCQItPE-S* zqP{RCA(Ty9m_CQcxY{Vld{R)^reRjZ08Vwg|Pm*PsUU8tN47bKjpw59PlnGXMG_ zYm$944M2_L8Po%<$5`Bs+O@~9DPBfhS9h}A)v?YF7(@L~48hsX#aNY1x(b_9zkZ5s z@35DQruICl!z-v8{Y&f%B@8u%SN5=_FKsJ-w#=3$-t?C~6qjVPC* z_RulATkHBHhzsd&p)|xC}&I$7>9K+8RM`s4#P264?jVT>^sy91>bM?Kq}Uu zoQ2_7fO-WN;}ZHev&ke-5yE>>4Q1g8EW|==Io%jelJVjkrtktjLwW2>P67tbvQt}m zwjH7Vq}HiPL2bH$7>l!U5U$4d_&eUFpZ^(i_@#l0rKr7d3^i51q1HHJu3dsAs7;xM z+I;O$r=uro#QCThoQN9feAM+T(YKdS*KfxN+=-#|Z;p`B6rXcmLj6#>icK(do_&CH z)Qw#*6o;T5WIX!gOss@n^usVdJjA!;mk~<5M9qJR{wk34_ow-lDB!|W)MopWI8F>E zly0&3K5MIG(u)?~$eK}CKsf^!;HN|f;$GrMLJ#>l@gHIgkx1m&cD%kHlMAWfNdB8b z__8w5nVL6#+yh$kiOw3V+6vs7<2pu_I0cO1_Nq-UgPcQ*QMM`z~_o&!Q>~LQ+puQ#f z=ZSV+3O|tPhrQhm+bQQ0O0m>sV-*~ZdN*t#9wRzZ*PYP0zk~RLI7ehtmrHCT&k^&T zcbz1qnZzSR6T(Ai|M^mNZcti5TqoWl^#25U5-Z7nM%+e>CI%4u2&HmDyZkp5NKX-s zxhI*(BmWICir{pbe+Z?oh!%YRh5EnZtFj+SRCXk*KfP{Fzq`VLn=1A9n^LUrlfUh- z4-rj$P4``Q%HxSJ!k^GFy_IOi_xth5it!gwv7Cz5#K(kE3X$m=Qn@+#@01~RB0o?P z_o;$($zmSHT6}+V3Z<}#NWQ6Zit?KOzlqC44`L^w)PV-tVP#**zVTev^d%EO_;Jns zuJR?EKf(fN?Kd=1-;v)*hL|wjU@4if+{0h;Ra(!Yk z`QAiDI!`9lU0YGtl}sGbs-og1kCK0zsKGrAEAFFzUwWUNGP2pf`~7P3}PMe05O$_B9yujM|?Schj4Aa>dGguDs_#0WwvQJnKGgUv6gs& zm{p$MV4;86nV8h_oY;aE0U4gutg^@Qn+9Zh(lg7q=RaI2VCtAj#bqId;brp*BP*4R QyQ8enowdtP7OqMAKVk_&ga7~l diff --git a/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.po b/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.po index 29a28d632..79fda3e05 100644 --- a/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.po +++ b/modules/monitoring/application/locale/de_DE/LC_MESSAGES/monitoring.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Monitoring Module (2.0.0~alpha4)\n" "Report-Msgid-Bugs-To: dev@icinga.org\n" -"POT-Creation-Date: 2014-08-22 16:18+0200\n" -"PO-Revision-Date: 2014-08-22 17:57+0100\n" +"POT-Creation-Date: 2014-08-22 18:04+0200\n" +"PO-Revision-Date: 2014-08-22 18:05+0100\n" "Last-Translator: Thomas Gelf \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" @@ -103,6 +103,18 @@ msgstr "%d werden nicht überwacht" msgid "%d are passively checked" msgstr "%d werden passiv überwacht" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml:20 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml:87 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml:138 +#, php-format +msgid "%d hosts disabled" +msgstr "%d deaktivierte Hosts" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml:36 +#, php-format +msgid "%d hosts flapping" +msgstr "%d flapping Hosts" + #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:62 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:132 #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/parts/servicestatesummarybyhoststate.phtml:202 @@ -119,6 +131,18 @@ msgstr "%d wird nicht überwacht" msgid "%d is passively checked" msgstr "%d wird passiv überwacht" +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml:48 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml:107 +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml:158 +#, php-format +msgid "%d services disabled" +msgstr "%d deaktivierte Services" + +#: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml:64 +#, php-format +msgid "%d services flapping" +msgstr "%d flapping services" + #: /usr/local/src/bugfix.master/modules/monitoring/application/views/scripts/list/hosts.phtml:105 #, php-format msgid "%d unhandled services" @@ -1349,6 +1373,7 @@ msgid "TODO: Help message when with children is enabled" msgstr "" #: /usr/local/src/bugfix.master/modules/monitoring/configuration.php:54 +#: /usr/local/src/bugfix.master/modules/monitoring/application/controllers/TacticalController.php:15 msgid "Tactical Overview" msgstr "Taktische Übersicht" diff --git a/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml b/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml index 41ad3331d..8e6d35221 100644 --- a/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml +++ b/modules/monitoring/application/views/scripts/tactical/components/monitoringfeatures.phtml @@ -17,7 +17,7 @@ 'monitoring/list/hosts', array('host_flap_detection_enabled' => 0) ); ?>" class="feature-highlight"> - statusSummary->hosts_without_flap_detection); ?> + translate('%d hosts disabled'), $this->statusSummary->hosts_without_flap_detection); ?>

@@ -33,7 +33,7 @@ 'monitoring/list/hosts', array('host_is_flapping' => 1) ); ?>" class="feature-highlight"> - statusSummary->hosts_flapping); ?> + translate('%d hosts flapping'), $this->statusSummary->hosts_flapping); ?>
@@ -45,7 +45,7 @@ 'monitoring/list/services', array('service_flap_detection_enabled' => 0) ); ?>" class="feature-highlight"> - statusSummary->services_without_flap_detection); ?> + translate('%d services disabled'), $this->statusSummary->services_without_flap_detection); ?>
@@ -61,7 +61,7 @@ 'monitoring/list/services', array('service_is_flapping' => 1) ); ?>" class="feature-highlight"> - statusSummary->services_flapping); ?> + translate('%d services flapping'), $this->statusSummary->services_flapping); ?>
@@ -84,7 +84,7 @@ 'monitoring/list/hosts', array('host_notifications_enabled' => 0) ); ?>" class="feature-highlight"> - statusSummary->hosts_not_triggering_notifications); ?> + translate('%d hosts disabled'), $this->statusSummary->hosts_not_triggering_notifications); ?>
@@ -104,7 +104,7 @@ 'monitoring/list/services', array('service_notifications_enabled' => 0) ); ?>" class="feature-highlight"> - statusSummary->services_not_triggering_notifications); ?> + translate('%d services disabled'), $this->statusSummary->services_not_triggering_notifications); ?>
@@ -135,7 +135,7 @@ 'monitoring/list/hosts', array('host_event_handler_enabled' => 0) ); ?>" class="feature-highlight"> - statusSummary->hosts_not_processing_event_handlers); ?> + translate('%d hosts disabled'), $this->statusSummary->hosts_not_processing_event_handlers); ?>
@@ -155,7 +155,7 @@ 'monitoring/list/services', array('service_event_handler_enabled' => 0) ); ?>" class="feature-highlight"> - statusSummary->services_not_processing_event_handlers); ?> + translate('%d services disabled'), $this->statusSummary->services_not_processing_event_handlers); ?>
From 013aad8f73b163b14f030656a79e902b2f003288 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Mon, 25 Aug 2014 12:14:18 +0200 Subject: [PATCH 015/257] MissingParameterException: extend IcingaException refs #6931 --- library/Icinga/Exception/MissingParameterException.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/library/Icinga/Exception/MissingParameterException.php b/library/Icinga/Exception/MissingParameterException.php index dda47aeab..b86ff7d8a 100644 --- a/library/Icinga/Exception/MissingParameterException.php +++ b/library/Icinga/Exception/MissingParameterException.php @@ -4,12 +4,10 @@ namespace Icinga\Exception; -use RuntimeException; - /** * Class MissingParameterException * @package Icinga\Exception */ -class MissingParameterException extends RuntimeException +class MissingParameterException extends IcingaException { } From f4dbb4df969ede0b406178cc66b09a3bc0a9a753 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Mon, 25 Aug 2014 12:21:59 +0200 Subject: [PATCH 016/257] NotImplementedError: extend IcingaException refs #6931 --- library/Icinga/Exception/NotImplementedError.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/Exception/NotImplementedError.php b/library/Icinga/Exception/NotImplementedError.php index 01131275d..1d22236df 100644 --- a/library/Icinga/Exception/NotImplementedError.php +++ b/library/Icinga/Exception/NotImplementedError.php @@ -8,6 +8,6 @@ namespace Icinga\Exception; * Class NotImplementedError * @package Icinga\Exception */ -class NotImplementedError extends \Exception +class NotImplementedError extends IcingaException { } From 6c9947326d0e8c42c226719360bced75f8640ad6 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Mon, 25 Aug 2014 12:38:34 +0200 Subject: [PATCH 017/257] NotReadableError: extend IcingaException refs #6931 --- library/Icinga/Application/Config.php | 5 ++++- library/Icinga/Application/Modules/Manager.php | 6 ++++-- library/Icinga/Exception/NotReadableError.php | 4 +--- library/Icinga/User/Preferences/Store/DbStore.php | 4 +++- library/Icinga/User/Preferences/Store/IniStore.php | 5 +++-- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/library/Icinga/Application/Config.php b/library/Icinga/Application/Config.php index e81e8062f..f794d46a0 100644 --- a/library/Icinga/Application/Config.php +++ b/library/Icinga/Application/Config.php @@ -61,7 +61,10 @@ class Config extends Zend_Config $this->configFile = $filepath; $this->merge(new Zend_Config_Ini($filepath)); } else { - throw new NotReadableError('Cannot read config file "' . $filename . '". Permission denied'); + throw new NotReadableError( + 'Cannot read config file "%s". Permission denied', + $filename + ); } } diff --git a/library/Icinga/Application/Modules/Manager.php b/library/Icinga/Application/Modules/Manager.php index 366f77c30..4154d2c20 100644 --- a/library/Icinga/Application/Modules/Manager.php +++ b/library/Icinga/Application/Modules/Manager.php @@ -110,12 +110,14 @@ class Manager } if (!is_dir($this->enableDir)) { throw new NotReadableError( - 'Cannot read enabled modules. Module directory "' . $this->enableDir . '" is not a directory' + 'Cannot read enabled modules. Module directory "%s" is not a directory', + $this->enableDir ); } if (!is_readable($this->enableDir)) { throw new NotReadableError( - 'Cannot read enabled modules. Module directory "' . $this->enableDir . '" is not readable' + 'Cannot read enabled modules. Module directory "%s" is not readable', + $this->enableDir ); } if (($dh = opendir($canonical)) !== false) { diff --git a/library/Icinga/Exception/NotReadableError.php b/library/Icinga/Exception/NotReadableError.php index 6bc4fc55f..41a7ec8fd 100644 --- a/library/Icinga/Exception/NotReadableError.php +++ b/library/Icinga/Exception/NotReadableError.php @@ -4,8 +4,6 @@ namespace Icinga\Exception; -use RuntimeException; - -class NotReadableError extends RuntimeException +class NotReadableError extends IcingaException { } diff --git a/library/Icinga/User/Preferences/Store/DbStore.php b/library/Icinga/User/Preferences/Store/DbStore.php index 728637a35..c0818f303 100644 --- a/library/Icinga/User/Preferences/Store/DbStore.php +++ b/library/Icinga/User/Preferences/Store/DbStore.php @@ -78,7 +78,9 @@ class DbStore extends PreferencesStore ->fetchAll(); } catch (Exception $e) { throw new NotReadableError( - 'Cannot fetch preferences for user ' . $this->getUser()->getUsername() . ' from database', 0, $e + 'Cannot fetch preferences for user %s from database', + $this->getUser()->getUsername(), + $e ); } diff --git a/library/Icinga/User/Preferences/Store/IniStore.php b/library/Icinga/User/Preferences/Store/IniStore.php index eb1c4cbfb..93b31b82b 100644 --- a/library/Icinga/User/Preferences/Store/IniStore.php +++ b/library/Icinga/User/Preferences/Store/IniStore.php @@ -62,8 +62,9 @@ class IniStore extends PreferencesStore if (file_exists($this->preferencesFile)) { if (!is_readable($this->preferencesFile)) { throw new NotReadableError( - 'Preferences INI file ' . $this->preferencesFile . ' for user ' - . $this->getUser()->getUsername() . ' is not readable' + 'Preferences INI file %s for user %s is not readable', + $this->preferencesFile, + $this->getUser()->getUsername() ); } else { $this->preferences = parse_ini_file($this->preferencesFile); From 7074fa1331c413b6e1dbf1c190b5cdc31c0d664c Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Mon, 25 Aug 2014 12:56:35 +0200 Subject: [PATCH 018/257] NotWritableError: extend IcingaException refs #6931 --- library/Icinga/Exception/NotWritableError.php | 4 +--- library/Icinga/User/Preferences/Store/DbStore.php | 12 +++++++++--- library/Icinga/User/Preferences/Store/IniStore.php | 11 +++++------ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/library/Icinga/Exception/NotWritableError.php b/library/Icinga/Exception/NotWritableError.php index 1b7495b03..cf09d4592 100644 --- a/library/Icinga/Exception/NotWritableError.php +++ b/library/Icinga/Exception/NotWritableError.php @@ -4,8 +4,6 @@ namespace Icinga\Exception; -use RuntimeException; - -class NotWritableError extends RuntimeException +class NotWritableError extends IcingaException { } diff --git a/library/Icinga/User/Preferences/Store/DbStore.php b/library/Icinga/User/Preferences/Store/DbStore.php index c0818f303..348a4f04d 100644 --- a/library/Icinga/User/Preferences/Store/DbStore.php +++ b/library/Icinga/User/Preferences/Store/DbStore.php @@ -147,7 +147,9 @@ class DbStore extends PreferencesStore } } catch (Exception $e) { throw new NotWritableError( - 'Cannot insert preferences for user ' . $this->getUser()->getUsername() . ' into database', 0, $e + 'Cannot insert preferences for user %s into database', + $this->getUser()->getUsername(), + $e ); } } @@ -176,7 +178,9 @@ class DbStore extends PreferencesStore } } catch (Exception $e) { throw new NotWritableError( - 'Cannot update preferences for user ' . $this->getUser()->getUsername() . ' in database', 0, $e + 'Cannot update preferences for user %s in database', + $this->getUser()->getUsername(), + $e ); } } @@ -202,7 +206,9 @@ class DbStore extends PreferencesStore ); } catch (Exception $e) { throw new NotWritableError( - 'Cannot delete preferences for user ' . $this->getUser()->getUsername() . ' from database', 0, $e + 'Cannot delete preferences for user %s from database', + $this->getUser()->getUsername(), + $e ); } } diff --git a/library/Icinga/User/Preferences/Store/IniStore.php b/library/Icinga/User/Preferences/Store/IniStore.php index 93b31b82b..1f01925c9 100644 --- a/library/Icinga/User/Preferences/Store/IniStore.php +++ b/library/Icinga/User/Preferences/Store/IniStore.php @@ -98,10 +98,8 @@ class IniStore extends PreferencesStore if (!file_exists($this->preferencesFile)) { if (!is_writable($this->getStoreConfig()->location)) { throw new NotWritableError( - sprintf( - 'Path to the preferences INI files %s is not writable', - $this->getStoreConfig()->location - ) + 'Path to the preferences INI files %s is not writable', + $this->getStoreConfig()->location ); } @@ -110,8 +108,9 @@ class IniStore extends PreferencesStore if (!is_writable($this->preferencesFile)) { throw new NotWritableError( - 'Preferences INI file ' . $this->preferencesFile . ' for user ' - . $this->getUser()->getUsername() . ' is not writable' + 'Preferences INI file %s for user %s is not writable', + $this->preferencesFile, + $this->getUser()->getUsername() ); } From f754531e4d36f7c82f840ac803eaf806ec72375c Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Tue, 26 Aug 2014 10:21:29 +0200 Subject: [PATCH 019/257] Fix grammatical error --- library/Icinga/Protocol/Statusdat/Query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/Protocol/Statusdat/Query.php b/library/Icinga/Protocol/Statusdat/Query.php index 4ab7c3053..ed8928b6f 100644 --- a/library/Icinga/Protocol/Statusdat/Query.php +++ b/library/Icinga/Protocol/Statusdat/Query.php @@ -440,7 +440,7 @@ class Query extends SimpleQuery */ public function fetchOne() { - throw new ProgrammingError('Statusdat/Query::fetchOne not yet implemented'); + throw new ProgrammingError('Statusdat/Query::fetchOne() is not implemented yet'); } /** From 7d25efb93caeff3bf7cb9ef7ba2a762d53b0002f Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Fri, 22 Aug 2014 15:35:02 +0200 Subject: [PATCH 020/257] Remove dashboard.ini related parts refs #6639 --- .vagrant-puppet/manifests/default.pp | 12 --------- config/dashboard/dashboard.ini | 39 ---------------------------- doc/dashboard.md | 26 ------------------- icingaweb2.spec | 2 -- 4 files changed, 79 deletions(-) delete mode 100644 config/dashboard/dashboard.ini diff --git a/.vagrant-puppet/manifests/default.pp b/.vagrant-puppet/manifests/default.pp index 282803a83..13d54bf9f 100644 --- a/.vagrant-puppet/manifests/default.pp +++ b/.vagrant-puppet/manifests/default.pp @@ -740,18 +740,6 @@ file { '/etc/icingaweb/modules/monitoring/instances.ini': group => 'apache', } -file { '/etc/icingaweb/dashboard': - ensure => 'directory', - owner => 'apache', - group => 'apache', -} - -file { '/etc/icingaweb/dashboard/dashboard.ini': - source => 'puppet:////vagrant/config/dashboard/dashboard.ini', - owner => 'apache', - group => 'apache', -} - # pear::package { 'deepend/Mockery': # channel => 'pear.survivethedeepend.com' # } diff --git a/config/dashboard/dashboard.ini b/config/dashboard/dashboard.ini deleted file mode 100644 index 022b34be5..000000000 --- a/config/dashboard/dashboard.ini +++ /dev/null @@ -1,39 +0,0 @@ -[Incidents] -title = "Current incidents" - -[Incidents.Service Problems] -url = "monitoring/list/services" -service_problem = 1 -limit = 10 -sort = service_severity - -[Incidents.Recently Recovered Services] -url = "monitoring/list/services" -sort = "service_last_state_change" -service_state = 0 -limit = 10 -dir = "desc" - -[Incidents.Host Problems] -url = "monitoring/list/hosts" -host_problem = 1 -sort = host_severity - -[Landing] -title = "Landing page" - -[Landing.Hostgroups] -url = "monitoring/chart/hostgroup" - -[Landing.Servicegroups] -url = "monitoring/chart/servicegroup" - -[Landing.Unhandled Problem Services] -url = "monitoring/list/services" -service_handled = 0 -service_problem = 1 - -[Landing.Unhandled Problem Hosts] -url = "monitoring/list/hosts" -host_handled = 0 -host_problem = 1 diff --git a/doc/dashboard.md b/doc/dashboard.md index 89ff52ee1..1b1e7a983 100644 --- a/doc/dashboard.md +++ b/doc/dashboard.md @@ -14,30 +14,4 @@ the objects you're interested in and can add and remove elements. * The dashboard itself is just the view containing the panes -## Configuration files - -By default, the config/dashboard/dashboard.ini is used for storing dashboards in the following format: - - [PaneName] ; Define a new Pane - title = "PaneTitle" ; The title of the pane as displayed in the tabls - - [PaneName.Component1] ; Define a new component 'Component 1' underneat the pane - url = "/url/for/component1" ; the url that will be displayed, with view=compact as URL parameter appended - height = "500px" ; optional height setting - width = "400px" ; optional width setting - - [test.My hosts] ; Another component, here with host - url = "monitoring/list/hosts" ; the url of the component - ; Notice the missing height/width definition - - [test.My services] ; And another pane - url = "monitoring/list/services" ; With service url - - [test2] ; Define a second pane - title = "test2" ; with the title - - [test2.test] ; Add a component to the second pane - url = "/monitoring/show/host/host1" ; ...and define it's url - - [dashboards1]: res/Dashboard.png diff --git a/icingaweb2.spec b/icingaweb2.spec index d7cc53ed9..270e18fff 100644 --- a/icingaweb2.spec +++ b/icingaweb2.spec @@ -185,8 +185,6 @@ install -D -m0644 packages/rpm/etc/httpd/conf.d/icingaweb.conf %{buildroot}/%{ap install -D -m0644 packages/rpm/etc/icingaweb/authentication.ini %{buildroot}/%{_sysconfdir}/icingaweb/authentication.ini # custom resource paths install -D -m0644 packages/rpm/etc/icingaweb/resources.ini %{buildroot}/%{_sysconfdir}/icingaweb/resources.ini -# dashboard -install -D -m0644 config/dashboard/dashboard.ini %{buildroot}/%{_sysconfdir}/icingaweb/dashboard/dashboard.ini # monitoring module (icinga2) install -D -m0644 packages/rpm/etc/icingaweb/modules/monitoring/backends.ini %{buildroot}/%{_sysconfdir}/icingaweb/modules/monitoring/backends.ini install -D -m0644 packages/rpm/etc/icingaweb/modules/monitoring/instances.ini %{buildroot}/%{_sysconfdir}/icingaweb/modules/monitoring/instances.ini From b60c3590b00fe08e90809fde0ba2dd9405b8aeac Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Fri, 22 Aug 2014 15:37:23 +0200 Subject: [PATCH 021/257] Deactivate addUrl to Dashboard refs #6639 --- application/views/scripts/dashboard/addurl.phtml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/application/views/scripts/dashboard/addurl.phtml b/application/views/scripts/dashboard/addurl.phtml index 27ea46f56..c2d3f7e6c 100644 --- a/application/views/scripts/dashboard/addurl.phtml +++ b/application/views/scripts/dashboard/addurl.phtml @@ -2,6 +2,11 @@ tabs ?>
-
-form ?> -
+
+

escape($this->translate('This feature is deactivated at the moment.')); ?>

+

+ escape($this->translate('Please have a little patience, we are hard working on it, take a look at icingaweb2 issues.')); + ?> +

+
\ No newline at end of file From 11127446e07e7fe8fb083c59210cbc95ac19812d Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Fri, 22 Aug 2014 15:39:35 +0200 Subject: [PATCH 022/257] Update description if no dashlets available refs #6639 --- .../views/scripts/dashboard/index.phtml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/application/views/scripts/dashboard/index.phtml b/application/views/scripts/dashboard/index.phtml index 3e721dc68..4adad7b66 100644 --- a/application/views/scripts/dashboard/index.phtml +++ b/application/views/scripts/dashboard/index.phtml @@ -7,16 +7,10 @@
-

No dashboard configuration found!

-

- translate('We tried to load a dashboard configuration with no success.' - . ' Please have look that the configuration does exist:'); - ?> - - - escape($this->configPath) ?>.ini - -

+

escape($this->translate('Welcome to Icinga Web!')) ?>

+

escape($this->translate('Currently there is no dashlet available. This might change once you enabled some of the available %s.')), + $this->qlink($this->translate('modules'), 'config/modules') + ) ?>

- \ No newline at end of file + \ No newline at end of file From af0cf48197c9ffccddbfcec619037a33503acb78 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Tue, 26 Aug 2014 10:08:33 +0200 Subject: [PATCH 023/257] Add self provided configuration for dashlets refs #6639 --- .../controllers/DashboardController.php | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/application/controllers/DashboardController.php b/application/controllers/DashboardController.php index 1f45eacde..108117959 100644 --- a/application/controllers/DashboardController.php +++ b/application/controllers/DashboardController.php @@ -111,19 +111,23 @@ class DashboardController extends ActionController */ public function indexAction() { - $dashboard = $this->getDashboard(); - if ($this->_getParam('pane')) { - $pane = $this->_getParam('pane'); - $dashboard->activate($pane); - } + $dashboard = Dashboard::load(); - $this->view->configPath = IcingaConfig::resolvePath(self::DEFAULT_CONFIG); - - if ($dashboard === null) { + if (! $dashboard->hasPanes()) { $this->view->title = 'Dashboard'; } else { - $this->view->title = $dashboard->getActivePane()->getTitle() . ' :: Dashboard'; - $this->view->tabs = $dashboard->getTabs(); + if ($this->_getParam('pane')) { + $pane = $this->_getParam('pane'); + $dashboard->activate($pane); + } + + $this->view->configPath = IcingaConfig::resolvePath(self::DEFAULT_CONFIG); + + if ($dashboard === null) { + $this->view->title = 'Dashboard'; + } else { + $this->view->title = $dashboard->getActivePane()->getTitle() . ' :: Dashboard'; + $this->view->tabs = $dashboard->getTabs(); /* Temporarily removed $this->view->tabs->add( @@ -135,8 +139,8 @@ class DashboardController extends ActionController ); */ - $this->view->dashboard = $dashboard; - + $this->view->dashboard = $dashboard; + } } } From bae5ba23524ffc24453a3189233b6d01c45249fc Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Tue, 26 Aug 2014 10:12:19 +0200 Subject: [PATCH 024/257] Add self provided configuration for dashlets in monitoring module refs #6639 --- modules/monitoring/configuration.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/modules/monitoring/configuration.php b/modules/monitoring/configuration.php index d4431e6e1..412581d24 100644 --- a/modules/monitoring/configuration.php +++ b/modules/monitoring/configuration.php @@ -125,10 +125,18 @@ $section->add($this->translate('Performance Info'), array( )); /* - -$dashboard = $this->dashboard('Current Incidents'); // Web\Widget\Dashboard\Pane -$dashboard->add('Service Problems', array( - -)); - -*/ + * Dashboard + */ +$dashboard = $this->dashboard($this->translate('Current Incidents')); +$dashboard->add( + $this->translate('Service Problems'), + 'monitoring/list/services?service_problem=1&limit=10&sort=service_severity' +); +$dashboard->add( + $this->translate('Recently Recovered Services'), + 'monitoring/list/services?service_state=0&limit=10&sort=service_last_state_change&dir=desc' +); +$dashboard->add( + $this->translate('Host Problems'), + 'monitoring/list/hosts?host_problem=1&sort=host_severity' +); From 42e2b3435699e7f6452304a0679b4954bdc7a6b0 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Tue, 26 Aug 2014 10:13:49 +0200 Subject: [PATCH 025/257] Implement self provided configuration for dashboard/dashlets in modules refs #6639 --- library/Icinga/Application/Modules/Module.php | 31 ++++++++++++ library/Icinga/Web/Widget/Dashboard.php | 50 +++++++++++++++++++ library/Icinga/Web/Widget/Dashboard/Pane.php | 41 +++++++++++++++ 3 files changed, 122 insertions(+) diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index a4b87be08..a325dfef0 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -16,6 +16,7 @@ use Icinga\Util\Translator; use Icinga\Web\Hook; use Icinga\Web\Menu; use Icinga\Web\Widget; +use Icinga\Web\Widget\Dashboard\Pane; use Icinga\Util\File; use Icinga\Exception\ProgrammingError; @@ -154,6 +155,36 @@ class Module */ protected $menuItems = array(); + /** + * A set of Pane elements + * + * @var array + */ + protected $paneItems = array(); + + /** + * Get all Menu Items + * + * @return array + */ + public function getPaneItems() + { + $this->launchConfigScript(); + return $this->paneItems; + } + + /** + * Add a pane to dashboard + * + * @param $name + * @return Pane + */ + protected function dashboard($name) + { + $this->paneItems[$name] = new Pane($name); + return $this->paneItems[$name]; + } + /** * Get all Menu Items * diff --git a/library/Icinga/Web/Widget/Dashboard.php b/library/Icinga/Web/Widget/Dashboard.php index c87afa1ab..f565c0fca 100644 --- a/library/Icinga/Web/Widget/Dashboard.php +++ b/library/Icinga/Web/Widget/Dashboard.php @@ -63,6 +63,46 @@ class Dashboard extends AbstractWidget $this->getTabs()->activate($name); } + /** + * Load Pane items provided by all enabled modules + * + * @return self + */ + public static function load() + { + /** @var $dashboard Dashboard */ + $dashboard = new static('dashboard'); + $manager = Icinga::app()->getModuleManager(); + foreach ($manager->getLoadedModules() as $module) { + /** @var $module \Icinga\Application\Modules\Module */ + $dashboard->mergePanes($module->getPaneItems()); + + } + return $dashboard; + } + + /** + * Merge panes with existing panes + * + * @param array $panes + * @return $this + */ + public function mergePanes(array $panes) + { + /** @var $pane Pane */ + foreach ($panes as $pane) { + if (array_key_exists($pane->getName(), $this->panes)) { + /** @var $current Pane */ + $current = $this->panes[$pane->getName()]; + $current->addComponents($pane->getComponents()); + } else { + $this->panes = array_filter(array_merge($this->panes, $panes)); + } + } + + return $this; + } + /** * Return the tab object used to navigate through this dashboard * @@ -147,6 +187,16 @@ class Dashboard extends AbstractWidget return $this; } + /** + * Checks if the current dashboard has any panes + * + * @return bool + */ + public function hasPanes() + { + return ! empty($this->panes); + } + /** * Return true if a pane doesn't exist or doesn't have any components in it * diff --git a/library/Icinga/Web/Widget/Dashboard/Pane.php b/library/Icinga/Web/Widget/Dashboard/Pane.php index 5e3e8ffea..15cf56524 100644 --- a/library/Icinga/Web/Widget/Dashboard/Pane.php +++ b/library/Icinga/Web/Widget/Dashboard/Pane.php @@ -162,6 +162,47 @@ class Pane extends AbstractWidget return $this; } + /** + * Add new components to existing components + * + * @param array $components + * @return $this + */ + public function addComponents(array $components) + { + /* @var $component Component */ + foreach ($components as $component) { + if (array_key_exists($component->getTitle(), $this->components)) { + if (preg_match('/_(\d+)$/', $component->getTitle(), $m)) { + $name = preg_replace('/_\d+$/', $m[1]++, $component->getTitle()); + } else { + $name = $component->getTitle() . '_2'; + } + $this->components[$name] = $component; + } else { + $this->components[$component->getTitle()] = $component; + } + } + + return $this; + } + + /** + * Add a component to the current pane + * + * @param $title + * @param $url + * @return Component + * + * @see addComponent() + */ + public function add($title, $url = null) + { + $this->addComponent($title, $url); + + return $this->components[$title]; + } + /** * Return the this pane's structure as array * From 4ec6dbe3f00ffb72c810cf564ab04900fd6bf4d7 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Tue, 26 Aug 2014 10:41:17 +0200 Subject: [PATCH 026/257] Prefer single quotes ' rather than double quotes " --- library/Icinga/Protocol/Statusdat/Parser.php | 72 ++++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/library/Icinga/Protocol/Statusdat/Parser.php b/library/Icinga/Protocol/Statusdat/Parser.php index f2c2e7793..5b3694518 100644 --- a/library/Icinga/Protocol/Statusdat/Parser.php +++ b/library/Icinga/Protocol/Statusdat/Parser.php @@ -72,12 +72,12 @@ class Parser */ public function parseObjectsFile() { - $DEFINE = strlen("define "); + $DEFINE = strlen('define '); $this->icingaState = array(); foreach ($this->file as $line) { $line = trim($line); $this->lineCtr++; - if ($line === "" || $line[0] === "#") { + if ($line === '' || $line[0] === '#') { continue; } $this->currentObjectType = trim(substr($line, $DEFINE, -1)); @@ -103,13 +103,13 @@ class Parser } if (!$this->icingaState) { - throw new ProgrammingError("Tried to read runtime state without existing objects data"); + throw new ProgrammingError('Tried to read runtime state without existing objects data'); } $this->overwrites = array(); foreach ($file as $line) { $line = trim($line); $this->lineCtr++; - if ($line === "" || $line[0] === "#") { + if ($line === '' || $line[0] === '#') { continue; } $this->currentStateType = trim(substr($line, 0, -1)); @@ -133,16 +133,16 @@ class Parser } // End of object - if ($line[0] === "}") { + if ($line[0] === '}') { $this->registerObject($monitoringObject); return; } if (!isset($line[1])) { - $line[1] = ""; + $line[1] = ''; } $monitoringObject->{$line[0]} = trim($line[1]); } - throw new ParsingException("Unexpected EOF in objects.cache, line " . $this->lineCtr); + throw new ParsingException('Unexpected EOF in objects.cache, line ' . $this->lineCtr); } /** @@ -156,7 +156,7 @@ class Parser $objectType = $this->getObjectTypeForState(); - if ($objectType != "host" && $objectType != "service") { + if ($objectType != 'host' && $objectType != 'service') { $this->skipObject(); // ignore unknown objects return; } @@ -170,7 +170,7 @@ class Parser if (!isset($base[$name])) { throw new ParsingException( - "Unknown object $name " . $this->currentObjectType . " - " + "Unknown object $name " . $this->currentObjectType . ' - ' . print_r( $statusdatObject, true @@ -180,7 +180,7 @@ class Parser } $type = substr($this->currentStateType, strlen($objectType)); - if ($type == "status") { + if ($type == 'status') { // directly set the status to the status field of the given object $base[$name]->status = & $statusdatObject; } else { @@ -211,20 +211,20 @@ class Parser */ private function getObjectTypeForState() { - $pos = strpos($this->currentStateType, "service"); + $pos = strpos($this->currentStateType, 'service'); if ($pos === false) { - $pos = strpos($this->currentStateType, "host"); + $pos = strpos($this->currentStateType, 'host'); } else { - $this->currentObjectType = "service"; - return "service"; + $this->currentObjectType = 'service'; + return 'service'; } if ($pos === false) { return $this->currentStateType; } else { - $this->currentObjectType = "host"; - return "host"; + $this->currentObjectType = 'host'; + return 'host'; } return $this->currentObjectType; @@ -239,12 +239,12 @@ class Parser protected function skipObject($returnString = false) { if (!$returnString) { - while (trim($this->file->fgets()) !== "}") { + while (trim($this->file->fgets()) !== '}') { } return null; } else { - $str = ""; - while (($val = trim($this->file->fgets())) !== "}") { + $str = ''; + while (($val = trim($this->file->fgets())) !== '}') { $str .= $val . "\n"; } return $str; @@ -280,9 +280,9 @@ class Parser || $this->currentObjectType == 'contact') { return null; } - $isService = strpos($this->currentObjectType, "service") !== false; - $isHost = strpos($this->currentObjectType, "host") !== false; - $isContact = strpos($this->currentObjectType, "contact") !== false; + $isService = strpos($this->currentObjectType, 'service') !== false; + $isHost = strpos($this->currentObjectType, 'host') !== false; + $isContact = strpos($this->currentObjectType, 'contact') !== false; $name = $this->getObjectIdentifier($object); if ($isService === false && $isHost === false && $isContact === false) { @@ -291,14 +291,14 @@ class Parser } $property = $this->currentObjectType; if ($isService) { - $this->currentObjectType = "service"; - $property = substr($property, strlen("service")); + $this->currentObjectType = 'service'; + $property = substr($property, strlen('service')); } elseif ($isHost) { - $this->currentObjectType = "host"; - $property = substr($property, strlen("host")); + $this->currentObjectType = 'host'; + $property = substr($property, strlen('host')); } elseif ($isContact) { - $this->currentObjectType = "contact"; - $property = substr($property, strlen("contact")); + $this->currentObjectType = 'contact'; + $property = substr($property, strlen('contact')); } if (!isset($this->icingaState[$this->currentObjectType])) { @@ -306,7 +306,7 @@ class Parser } // @TODO: Clean up, this differates between 1:n and 1:1 references - if (strpos($property, "group") !== false) { + if (strpos($property, 'group') !== false) { $sourceIdentifier = $this->getMembers($object); foreach ($sourceIdentifier as $id) { $source = $this->icingaState[$this->currentObjectType][$id]; @@ -368,12 +368,12 @@ class Parser return array(); } - $members = explode(",", $object->members); + $members = explode(',', $object->members); - if ($this->currentObjectType == "service") { + if ($this->currentObjectType == 'service') { $res = array(); for ($i = 0; $i < count($members); $i += 2) { - $res[] = $members[$i] . ";" . $members[$i + 1]; + $res[] = $members[$i] . ';' . $members[$i + 1]; } return $res; } else { @@ -394,15 +394,15 @@ class Parser return $object->contact_name; } - if ($this->currentObjectType == "service") { - return $object->host_name . ";" . $object->service_description; + if ($this->currentObjectType == 'service') { + return $object->host_name . ';' . $object->service_description; } - $name = $this->currentObjectType . "_name"; + $name = $this->currentObjectType . '_name'; if (isset($object->{$name})) { return $object->{$name}; } if (isset($object->service_description)) { - return $object->host_name . ";" . $object->service_description; + return $object->host_name . ';' . $object->service_description; } elseif (isset($object->host_name)) { return $object->host_name; } From febb2d1ae2400543cb1919e50386c0ba7591e408 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Tue, 26 Aug 2014 11:15:19 +0200 Subject: [PATCH 027/257] ProgrammingError: extend IcingaException refs #6931 --- library/Icinga/Application/Loader.php | 4 ++-- .../Icinga/Application/Modules/Manager.php | 12 ++++------- library/Icinga/Cli/Loader.php | 10 ++++++--- library/Icinga/Data/Filter/Filter.php | 17 +++++++++------ library/Icinga/Data/ResourceFactory.php | 2 +- library/Icinga/Exception/ProgrammingError.php | 2 +- .../Icinga/Protocol/Commandpipe/Command.php | 15 ++++++++++--- library/Icinga/Util/Format.php | 5 ++++- library/Icinga/Web/Form.php | 4 ++-- library/Icinga/Web/Hook.php | 18 +++++++++------- library/Icinga/Web/Menu.php | 5 ++++- library/Icinga/Web/Notification.php | 6 ++---- library/Icinga/Web/Url.php | 5 ++++- library/Icinga/Web/View.php | 6 ++---- library/Icinga/Web/View/helpers/url.php | 4 ++-- library/Icinga/Web/Widget.php | 6 ++---- library/Icinga/Web/Widget/AbstractWidget.php | 18 +++++++--------- library/Icinga/Web/Widget/Dashboard.php | 3 ++- library/Icinga/Web/Widget/Dashboard/Pane.php | 5 ++++- library/Icinga/Web/Widget/Tabs.php | 6 ++---- .../monitoring/library/Monitoring/Backend.php | 9 ++++++-- .../Monitoring/Backend/Ido/Query/IdoQuery.php | 21 ++++++++++--------- .../library/Monitoring/Timeline/TimeEntry.php | 4 +++- 23 files changed, 107 insertions(+), 80 deletions(-) diff --git a/library/Icinga/Application/Loader.php b/library/Icinga/Application/Loader.php index 56e59f4b2..15c3a9316 100644 --- a/library/Icinga/Application/Loader.php +++ b/library/Icinga/Application/Loader.php @@ -39,11 +39,11 @@ class Loader public function registerNamespace($namespace, $directory) { if (!is_dir($directory)) { - throw new ProgrammingError(sprintf( + throw new ProgrammingError( 'Directory "%s" for namespace "%s" does not exist', $directory, $namespace - )); + ); } $this->namespaces[$namespace] = $directory; diff --git a/library/Icinga/Application/Modules/Manager.php b/library/Icinga/Application/Modules/Manager.php index 4154d2c20..9022d4907 100644 --- a/library/Icinga/Application/Modules/Manager.php +++ b/library/Icinga/Application/Modules/Manager.php @@ -323,10 +323,8 @@ class Manager } throw new ProgrammingError( - sprintf( - 'Trying to access uninstalled module dir: %s', - $name - ) + 'Trying to access uninstalled module dir: %s', + $name ); } @@ -392,10 +390,8 @@ class Manager { if (!$this->hasLoaded($name)) { throw new ProgrammingError( - sprintf( - 'Cannot access module %s as it hasn\'t been loaded', - $name - ) + 'Cannot access module %s as it hasn\'t been loaded', + $name ); } return $this->loadedModules[$name]; diff --git a/library/Icinga/Cli/Loader.php b/library/Icinga/Cli/Loader.php index ab8064370..11ca2b70b 100644 --- a/library/Icinga/Cli/Loader.php +++ b/library/Icinga/Cli/Loader.php @@ -332,7 +332,8 @@ class Loader { if (! $this->hasModule($module)) { throw new ProgrammingError( - sprintf('There is no such module: %s', $module) + 'There is no such module: %s', + $module ); } } @@ -341,7 +342,8 @@ class Loader { if (! $this->hasCommand($command)) { throw new ProgrammingError( - sprintf('There is no such command: %s', $command) + 'There is no such command: %s', + $command ); } } @@ -351,7 +353,9 @@ class Loader $this->assertModuleExists($module); if (! $this->hasModuleCommand($module, $command)) { throw new ProgrammingError( - sprintf("The module '%s' has no such command: %s", $module, $command) + 'The module \'%s\' has no such command: %s', + $module, + $command ); } } diff --git a/library/Icinga/Data/Filter/Filter.php b/library/Icinga/Data/Filter/Filter.php index dc62e206a..7e995bb59 100644 --- a/library/Icinga/Data/Filter/Filter.php +++ b/library/Icinga/Data/Filter/Filter.php @@ -34,9 +34,12 @@ abstract class Filter if ((string) $id === $this->getId()) { return $this; } - throw new ProgrammingError(sprintf( - 'Trying to get invalid filter index "%s" from "%s" ("%s")', $id, $this, $this->id - )); + throw new ProgrammingError( + 'Trying to get invalid filter index "%s" from "%s" ("%s")', + $id, + $this, + $this->id + ); } public function getId() @@ -136,7 +139,8 @@ abstract class Filter case '<=': return new FilterEqualOrLessThan($col, $op, $expression); case '!=': return new FilterNotEqual($col, $op, $expression); default: throw new ProgrammingError( - sprintf('There is no such filter sign: %s', $op) + 'There is no such filter sign: %s', + $op ); } } @@ -188,7 +192,7 @@ abstract class Filter $args = $args[0]; } } - if (count($args) > 1) { + if (count($args) > 1) { return new FilterNot(array(new FilterAnd($args))); } else { return new FilterNot($args); @@ -203,7 +207,8 @@ abstract class Filter case 'NOT': return self::not($filters); } throw new ProgrammingError( - sprintf('"%s" is not a valid filter chain operator', $operator) + '"%s" is not a valid filter chain operator', + $operator ); } diff --git a/library/Icinga/Data/ResourceFactory.php b/library/Icinga/Data/ResourceFactory.php index b7156bb50..87f99c0e4 100644 --- a/library/Icinga/Data/ResourceFactory.php +++ b/library/Icinga/Data/ResourceFactory.php @@ -78,7 +78,7 @@ class ResourceFactory implements ConfigAwareFactory { if (!isset(self::$resources)) { throw new ProgrammingError( - "The ResourceFactory must be initialised by setting a config, before it can be used" + 'The ResourceFactory must be initialised by setting a config, before it can be used' ); } } diff --git a/library/Icinga/Exception/ProgrammingError.php b/library/Icinga/Exception/ProgrammingError.php index 282d80db0..430d1510f 100644 --- a/library/Icinga/Exception/ProgrammingError.php +++ b/library/Icinga/Exception/ProgrammingError.php @@ -8,6 +8,6 @@ namespace Icinga\Exception; * Class ProgrammingError * @package Icinga\Exception */ -class ProgrammingError extends \Exception +class ProgrammingError extends IcingaException { } diff --git a/library/Icinga/Protocol/Commandpipe/Command.php b/library/Icinga/Protocol/Commandpipe/Command.php index b7332ce33..e89169f35 100644 --- a/library/Icinga/Protocol/Commandpipe/Command.php +++ b/library/Icinga/Protocol/Commandpipe/Command.php @@ -138,7 +138,10 @@ abstract class Command */ public function getHostgroupCommand($hostgroup) { - throw new ProgrammingError(get_class($this) . ' does not provide a hostgroup command'); + throw new ProgrammingError( + '%s does not provide a hostgroup command', + get_class($this) + ); } /** @@ -150,7 +153,10 @@ abstract class Command */ public function getServicegroupCommand($servicegroup) { - throw new ProgrammingError(get_class($this) . ' does not provide a servicegroup command'); + throw new ProgrammingError( + '%s does not provide a servicegroup command', + get_class($this) + ); } /** @@ -163,6 +169,9 @@ abstract class Command */ public function getGlobalCommand($instance = null) { - throw new ProgrammingError(getclass($this) . ' does not provide a global command'); + throw new ProgrammingError( + '%s does not provide a global command', + getclass($this) + ); } } diff --git a/library/Icinga/Util/Format.php b/library/Icinga/Util/Format.php index 0658b2a57..0c69fbde4 100644 --- a/library/Icinga/Util/Format.php +++ b/library/Icinga/Util/Format.php @@ -95,7 +95,10 @@ class Format return '-'; } if (! preg_match('~^\d+$~', $timestamp)) { - throw new ProgrammingError(sprintf('"%s" is not a number', $timestamp)); + throw new ProgrammingError( + '"%s" is not a number', + $timestamp + ); } $prefix = ''; if ($diff < 0) { diff --git a/library/Icinga/Web/Form.php b/library/Icinga/Web/Form.php index d6f07cd3a..65dc7c8d1 100644 --- a/library/Icinga/Web/Form.php +++ b/library/Icinga/Web/Form.php @@ -369,8 +369,8 @@ class Form extends Zend_Form $element->setAttrib('class', $class); } else { throw new ProgrammingError( - 'You need to add the element "' . $elementName . '" to' . - ' the form before automatic submission can be enabled!' + 'You need to add the element "%s" to the form before automatic submission can be enabled!', + $elementName ); } } diff --git a/library/Icinga/Web/Hook.php b/library/Icinga/Web/Hook.php index 2b776daca..76200493a 100644 --- a/library/Icinga/Web/Hook.php +++ b/library/Icinga/Web/Hook.php @@ -117,11 +117,9 @@ class Hook $base_class = self::$BASE_NS . ucfirst($name); if (!$instance instanceof $base_class) { throw new ProgrammingError( - sprintf( - '%s is not an instance of %s', - get_class($instance), - $base_class - ) + '%s is not an instance of %s', + get_class($instance), + $base_class ); } } @@ -185,7 +183,10 @@ class Hook public static function registerClass($name, $key, $class) { if (!class_exists($class)) { - throw new ProgrammingError('"' . $class . '" is not an existing class'); + throw new ProgrammingError( + '"%s" is not an existing class', + $class + ); } if (!isset(self::$hooks[$name])) { @@ -207,7 +208,10 @@ class Hook public static function registerObject($name, $key, $object) { if (!is_object($object)) { - throw new ProgrammingError('"' . $object . '" is not an instantiated class'); + throw new ProgrammingError( + '"%s" is not an instantiated class', + $object + ); } if (!isset(self::$instances[$name])) { diff --git a/library/Icinga/Web/Menu.php b/library/Icinga/Web/Menu.php index d5b7ba882..55bda29b3 100644 --- a/library/Icinga/Web/Menu.php +++ b/library/Icinga/Web/Menu.php @@ -277,7 +277,10 @@ class Menu implements RecursiveIterator public function getSubMenu($id) { if (false === $this->hasSubMenu($id)) { - throw new ProgrammingError('Tried to get invalid sub menu "' . $id . '"'); + throw new ProgrammingError( + 'Tried to get invalid sub menu "%s"', + $id + ); } return $this->subMenus[$id]; diff --git a/library/Icinga/Web/Notification.php b/library/Icinga/Web/Notification.php index 3dd04c615..178a07e0a 100644 --- a/library/Icinga/Web/Notification.php +++ b/library/Icinga/Web/Notification.php @@ -53,10 +53,8 @@ class Notification ) )) { throw new ProgrammingError( - sprintf( - '"%s" is not a valid notification type', - $type - ) + '"%s" is not a valid notification type', + $type ); } diff --git a/library/Icinga/Web/Url.php b/library/Icinga/Web/Url.php index ed3acf6a7..9f0294c3c 100644 --- a/library/Icinga/Web/Url.php +++ b/library/Icinga/Web/Url.php @@ -120,7 +120,10 @@ class Url } if (!is_string($url)) { - throw new ProgrammingError(sprintf('url "%s" is not a string', $url)); + throw new ProgrammingError( + 'url "%s" is not a string', + $url + ); } $urlObject = new Url(); diff --git a/library/Icinga/Web/View.php b/library/Icinga/Web/View.php index b74bca41c..22e8e6fbd 100644 --- a/library/Icinga/Web/View.php +++ b/library/Icinga/Web/View.php @@ -103,10 +103,8 @@ class View extends Zend_View_Abstract { if ($this->hasHelperFunction($name)) { throw new ProgrammingError( - sprintf( - 'Cannot assign the same helper function twice: "%s"', - $name - ) + 'Cannot assign the same helper function twice: "%s"', + $name ); } diff --git a/library/Icinga/Web/View/helpers/url.php b/library/Icinga/Web/View/helpers/url.php index 14b741e78..2fca99098 100644 --- a/library/Icinga/Web/View/helpers/url.php +++ b/library/Icinga/Web/View/helpers/url.php @@ -94,10 +94,10 @@ $this->addHelperFunction('attributeToString', function ($key, $value) { // TODO: Doublecheck this! if (! preg_match('~^[a-zA-Z0-9-]+$~', $key)) { - throw new ProgrammingError(sprintf( + throw new ProgrammingError( 'Trying to set an invalid HTML attribute name: %s', $key - )); + ); } return sprintf( diff --git a/library/Icinga/Web/Widget.php b/library/Icinga/Web/Widget.php index 4bb177341..b181a49ea 100644 --- a/library/Icinga/Web/Widget.php +++ b/library/Icinga/Web/Widget.php @@ -38,10 +38,8 @@ class Widget if (! class_exists($class)) { throw new ProgrammingError( - sprintf( - 'There is no such widget: %s', - $name - ) + 'There is no such widget: %s', + $name ); } diff --git a/library/Icinga/Web/Widget/AbstractWidget.php b/library/Icinga/Web/Widget/AbstractWidget.php index 37fb7ad36..fe4d2434d 100644 --- a/library/Icinga/Web/Widget/AbstractWidget.php +++ b/library/Icinga/Web/Widget/AbstractWidget.php @@ -52,11 +52,9 @@ abstract class AbstractWidget } throw new ProgrammingError( - sprintf( - 'Trying to get invalid "%s" property for %s', - $key, - get_class($this) - ) + 'Trying to get invalid "%s" property for %s', + $key, + get_class($this) ); } @@ -78,14 +76,12 @@ abstract class AbstractWidget } throw new ProgrammingError( - sprintf( - 'Trying to set invalid "%s" property in %s. Allowed are: %s', - $key, - get_class($this), - empty($this->properties) + 'Trying to set invalid "%s" property in %s. Allowed are: %s', + $key, + get_class($this), + empty($this->properties) ? 'none' : implode(', ', array_keys($this->properties)) - ) ); } diff --git a/library/Icinga/Web/Widget/Dashboard.php b/library/Icinga/Web/Widget/Dashboard.php index c87afa1ab..5ae6896d8 100644 --- a/library/Icinga/Web/Widget/Dashboard.php +++ b/library/Icinga/Web/Widget/Dashboard.php @@ -224,7 +224,8 @@ class Dashboard extends AbstractWidget { if (! array_key_exists($name, $this->panes)) { throw new ProgrammingError( - sprintf('Trying to retrieve invalid dashboard pane "%s"', $name) + 'Trying to retrieve invalid dashboard pane "%s"', + $name ); } return $this->panes[$name]; diff --git a/library/Icinga/Web/Widget/Dashboard/Pane.php b/library/Icinga/Web/Widget/Dashboard/Pane.php index 05d121385..2390b5e4f 100644 --- a/library/Icinga/Web/Widget/Dashboard/Pane.php +++ b/library/Icinga/Web/Widget/Dashboard/Pane.php @@ -105,7 +105,10 @@ class Pane extends AbstractWidget if ($this->hasComponent($title)) { return $this->components[$title]; } - throw new ProgrammingError(sprintf('Trying to access invalid component: %s', $title)); + throw new ProgrammingError( + 'Trying to access invalid component: %s', + $title + ); } /** diff --git a/library/Icinga/Web/Widget/Tabs.php b/library/Icinga/Web/Widget/Tabs.php index cd480ba32..716d5a959 100644 --- a/library/Icinga/Web/Widget/Tabs.php +++ b/library/Icinga/Web/Widget/Tabs.php @@ -154,10 +154,8 @@ EOT; { if ($this->has($name)) { throw new ProgrammingError( - sprintf( - 'Cannot add a tab named "%s" twice"', - $name - ) + 'Cannot add a tab named "%s" twice"', + $name ); } return $this->set($name, $tab); diff --git a/modules/monitoring/library/Monitoring/Backend.php b/modules/monitoring/library/Monitoring/Backend.php index 8131e7c1c..e10c70d4e 100644 --- a/modules/monitoring/library/Monitoring/Backend.php +++ b/modules/monitoring/library/Monitoring/Backend.php @@ -148,7 +148,10 @@ public function getResource() { $viewClass = '\\Icinga\\Module\\Monitoring\\DataView\\' . ucfirst($viewName); if (!class_exists($viewClass)) { - throw new ProgrammingError('DataView ' . ucfirst($viewName) . ' does not exist'); + throw new ProgrammingError( + 'DataView %s does not exist', + ucfirst($viewName) + ); } return $viewClass; } @@ -175,7 +178,9 @@ public function getResource() . 'Query'; if (!class_exists($queryClass)) { throw new ProgrammingError( - 'Query "' . ucfirst($queryName) . '" does not exist for backend ' . ucfirst($this->type) + 'Query "%s" does not exist for backend %s', + ucfirst($queryName), + ucfirst($this->type) ); } return $queryClass; diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php index f0f927487..df7118fe0 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php @@ -442,7 +442,11 @@ abstract class IdoQuery extends DbQuery } elseif ($this->isCustomVar($alias)) { $this->requireCustomvar($alias); } else { - throw new ProgrammingError(sprintf('%s : Got invalid column: %s', get_called_class(), $alias)); + throw new ProgrammingError( + '%s : Got invalid column: %s', + get_called_class(), + $alias + ); } return $this; } @@ -476,7 +480,8 @@ abstract class IdoQuery extends DbQuery { if ($this->hasJoinedVirtualTable($name)) { throw new ProgrammingError( - sprintf('IDO query virtual table conflict with "%s"', $name) + 'IDO query virtual table conflict with "%s"', + $name ); } return $this; @@ -499,10 +504,8 @@ abstract class IdoQuery extends DbQuery $this->$func(); } else { throw new ProgrammingError( - sprintf( - 'Cannot join "%s", no such table found', - $table - ) + 'Cannot join "%s", no such table found', + $table ); } $this->joinedVirtualTables[$table] = true; @@ -581,10 +584,8 @@ abstract class IdoQuery extends DbQuery // TODO: Improve this: if (! preg_match('~^_(host|service)_([a-zA-Z0-9_]+)$~', $customvar, $m)) { throw new ProgrammingError( - sprintf( - 'Got invalid custom var: "%s"', - $customvar - ) + 'Got invalid custom var: "%s"', + $customvar ); } return array($m[1], $m[2]); diff --git a/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php b/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php index 7a91bfc85..615999bdb 100644 --- a/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php +++ b/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php @@ -79,7 +79,9 @@ class TimeEntry $entry->{$methodName}($value); } else { throw new ProgrammingError( - 'Method "' . $methodName . '" does not exist on object of type "' . __CLASS__ . '"' + 'Method "%s" does not exist on object of type "%s"', + $methodName, + __CLASS__ ); } } From a2011b16655280ef648028d26f3137edb45f5f58 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Tue, 26 Aug 2014 11:21:57 +0200 Subject: [PATCH 028/257] SystemPermissionException: extend IcingaException refs #6931 --- library/Icinga/Application/Modules/Manager.php | 16 ++++++++++------ .../Exception/SystemPermissionException.php | 4 +--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/library/Icinga/Application/Modules/Manager.php b/library/Icinga/Application/Modules/Manager.php index 9022d4907..60c2ee85b 100644 --- a/library/Icinga/Application/Modules/Manager.php +++ b/library/Icinga/Application/Modules/Manager.php @@ -219,8 +219,8 @@ class Manager if (!is_writable($this->enableDir)) { throw new SystemPermissionException( - 'Can not enable module "' . $name . '". ' - . 'Insufficient system permissions for enabling modules.' + 'Can not enable module "%s". Insufficient system permissions for enabling modules.', + $name ); } @@ -232,9 +232,11 @@ class Manager $error = error_get_last(); if (strstr($error["message"], "File exists") === false) { throw new SystemPermissionException( - 'Could not enable module "' . $name . '" due to file system errors. ' + 'Could not enable module "%s" due to file system errors. ' . 'Please check path and mounting points because this is not a permission error. ' - . 'Primary error was: ' . $error['message'] + . 'Primary error was: %s', + $name, + $error['message'] ); } } @@ -287,9 +289,11 @@ class Manager if (!@unlink($link)) { $error = error_get_last(); throw new SystemPermissionException( - 'Could not disable module "' . $name . '" due to file system errors. ' + 'Could not disable module "%s" due to file system errors. ' . 'Please check path and mounting points because this is not a permission error. ' - . 'Primary error was: ' . $error['message'] + . 'Primary error was: %s', + $name, + $error['message'] ); } } diff --git a/library/Icinga/Exception/SystemPermissionException.php b/library/Icinga/Exception/SystemPermissionException.php index 8202e34ac..33dfe596c 100644 --- a/library/Icinga/Exception/SystemPermissionException.php +++ b/library/Icinga/Exception/SystemPermissionException.php @@ -4,11 +4,9 @@ namespace Icinga\Exception; -use \Exception; - /** * Handle problems according to file system permissions */ -class SystemPermissionException extends Exception +class SystemPermissionException extends IcingaException { } From c8643ab02e5baadc7da931797af2e31c87949b26 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Tue, 26 Aug 2014 11:46:58 +0200 Subject: [PATCH 029/257] Add preferences directory to vagrant provision default.pp --- .vagrant-puppet/manifests/default.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.vagrant-puppet/manifests/default.pp b/.vagrant-puppet/manifests/default.pp index 13d54bf9f..9e9f9e26d 100644 --- a/.vagrant-puppet/manifests/default.pp +++ b/.vagrant-puppet/manifests/default.pp @@ -696,6 +696,12 @@ file { '/etc/icingaweb': group => 'apache' } +file { '/etc/icingaweb/preferences': + ensure => 'directory', + owner => 'apache', + group => 'apache' +} + file { '/etc/icingaweb/authentication.ini': source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icingaweb/authentication.ini', owner => 'apache', From 3a85a45ef20337c30aa714602e7e7cbfde3d4268 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Tue, 26 Aug 2014 12:08:55 +0200 Subject: [PATCH 030/257] Fix preferences directory dependency in vagrant provision manifests default.pp --- .vagrant-puppet/manifests/default.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vagrant-puppet/manifests/default.pp b/.vagrant-puppet/manifests/default.pp index 9e9f9e26d..39b0d967c 100644 --- a/.vagrant-puppet/manifests/default.pp +++ b/.vagrant-puppet/manifests/default.pp @@ -699,7 +699,8 @@ file { '/etc/icingaweb': file { '/etc/icingaweb/preferences': ensure => 'directory', owner => 'apache', - group => 'apache' + group => 'apache', + require => File['/etc/icingaweb'] } file { '/etc/icingaweb/authentication.ini': From 376e9aa16056e5e19f8a144963f0236ecfeb7f60 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Tue, 26 Aug 2014 14:29:55 +0200 Subject: [PATCH 031/257] Rename hook base classes Adding suffix "Hook" to every base class. This simplifies development because you don't need to alias bases classes in your concrete hook classes refs #6928 --- library/Icinga/Web/Hook/{Grapher.php => GrapherHook.php} | 2 +- library/Icinga/Web/Hook/{Ticket.php => TicketHook.php} | 2 +- library/Icinga/Web/Hook/{TopBar.php => TopBarHook.php} | 4 ++-- .../Hook/{TimelineProvider.php => TimelineProviderHook.php} | 2 +- modules/monitoring/library/Monitoring/Web/Hook/TopBar.php | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) rename library/Icinga/Web/Hook/{Grapher.php => GrapherHook.php} (99%) rename library/Icinga/Web/Hook/{Ticket.php => TicketHook.php} (97%) rename library/Icinga/Web/Hook/{TopBar.php => TopBarHook.php} (81%) rename modules/monitoring/library/Monitoring/Web/Hook/{TimelineProvider.php => TimelineProviderHook.php} (96%) diff --git a/library/Icinga/Web/Hook/Grapher.php b/library/Icinga/Web/Hook/GrapherHook.php similarity index 99% rename from library/Icinga/Web/Hook/Grapher.php rename to library/Icinga/Web/Hook/GrapherHook.php index 28de49604..e2fea304a 100644 --- a/library/Icinga/Web/Hook/Grapher.php +++ b/library/Icinga/Web/Hook/GrapherHook.php @@ -14,7 +14,7 @@ namespace Icinga\Web\Hook; * @author Icinga-Web Team * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License */ -class Grapher +class GrapherHook { /** * Whether this grapher provides preview images diff --git a/library/Icinga/Web/Hook/Ticket.php b/library/Icinga/Web/Hook/TicketHook.php similarity index 97% rename from library/Icinga/Web/Hook/Ticket.php rename to library/Icinga/Web/Hook/TicketHook.php index f9c1b495e..bb9a129b4 100644 --- a/library/Icinga/Web/Hook/Ticket.php +++ b/library/Icinga/Web/Hook/TicketHook.php @@ -14,7 +14,7 @@ namespace Icinga\Web\Hook; * @author Icinga-Web Team * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License */ -abstract class Ticket +abstract class TicketHook { /** * Constructor must live without arguments right now diff --git a/library/Icinga/Web/Hook/TopBar.php b/library/Icinga/Web/Hook/TopBarHook.php similarity index 81% rename from library/Icinga/Web/Hook/TopBar.php rename to library/Icinga/Web/Hook/TopBarHook.php index d32f6d1fd..695d81109 100644 --- a/library/Icinga/Web/Hook/TopBar.php +++ b/library/Icinga/Web/Hook/TopBarHook.php @@ -10,7 +10,7 @@ use \Zend_View; /** * Hook to extend topbar items */ -interface TopBar +abstract class TopBarHook { /** * Function to generate top bar content @@ -20,5 +20,5 @@ interface TopBar * * @return string */ - public function getHtml($request, $view); + abstract public function getHtml($request, $view); } diff --git a/modules/monitoring/library/Monitoring/Web/Hook/TimelineProvider.php b/modules/monitoring/library/Monitoring/Web/Hook/TimelineProviderHook.php similarity index 96% rename from modules/monitoring/library/Monitoring/Web/Hook/TimelineProvider.php rename to modules/monitoring/library/Monitoring/Web/Hook/TimelineProviderHook.php index cafe68c17..e265086ab 100644 --- a/modules/monitoring/library/Monitoring/Web/Hook/TimelineProvider.php +++ b/modules/monitoring/library/Monitoring/Web/Hook/TimelineProviderHook.php @@ -9,7 +9,7 @@ use Icinga\Module\Monitoring\Timeline\TimeRange; /** * Base class for TimeLine providers */ -abstract class TimelineProvider +abstract class TimelineProviderHook { /** * Return the names by which to group entries diff --git a/modules/monitoring/library/Monitoring/Web/Hook/TopBar.php b/modules/monitoring/library/Monitoring/Web/Hook/TopBar.php index 32efaca9a..9433bf805 100644 --- a/modules/monitoring/library/Monitoring/Web/Hook/TopBar.php +++ b/modules/monitoring/library/Monitoring/Web/Hook/TopBar.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Web\Hook; -use Icinga\Web\Hook\TopBar as IcingaTopBar; +use Icinga\Web\Hook\TopBarHook; use Icinga\Module\Monitoring\DataView\StatusSummary as StatusSummaryView; use Icinga\Web\Request; use Zend_View; @@ -12,7 +12,7 @@ use Zend_View; /** * Render status summary into the topbar of icinga */ -class TopBar implements IcingaTopBar +class TopBar extends TopBarHook { /** * Function to generate top bar content From 2575634dec0e2ea4ca4e1e960583846b10c00d32 Mon Sep 17 00:00:00 2001 From: Goran Rakic Date: Thu, 21 Aug 2014 03:50:50 +0200 Subject: [PATCH 032/257] Draw full circle pie slice (100%) as a primitive Allows getPieSlicePath to draw a full circle pie slice (100%) by slightly adjusting endpoint to have a valid arc. Also hides a central line as there will be no more pie slices. --- library/Icinga/Chart/Primitive/PieSlice.php | 22 ++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/library/Icinga/Chart/Primitive/PieSlice.php b/library/Icinga/Chart/Primitive/PieSlice.php index 1ded01dbd..c7a6a06fa 100644 --- a/library/Icinga/Chart/Primitive/PieSlice.php +++ b/library/Icinga/Chart/Primitive/PieSlice.php @@ -104,17 +104,22 @@ class PieSlice extends Animatable implements Drawable */ private function getPieSlicePath($x, $y, $r) { - // start at the center of the pieslice - $pathString = 'M ' . $x . ' ' . $y . ' '; - // The coordinate system is mirrored on the Y axis, so we have to flip cos and sin $xStart = $x + ($r * sin($this->startRadian)); $yStart = $y - ($r * cos($this->startRadian)); - $xEnd = $x + ($r * sin($this->endRadian)); - $yEnd = $y - ($r * cos($this->endRadian)); - // Draw a straight line to the upper part of the arc - $pathString .= 'L ' . Format::formatSVGNumber($xStart) . ' ' . Format::formatSVGNumber($yStart); + if($this->endRadian - $this->startRadian == 2*M_PI) { + // To draw a full circle, adjust arc endpoint by a small (unvisible) value + $this->endRadian -= 0.001; + $pathString = 'M '. Format::formatSVGNumber($xStart) . ' ' . Format::formatSVGNumber($yStart); + } + else { + // Start at the center of the pieslice + $pathString = 'M ' . $x . ' ' . $y; + // Draw a straight line to the upper part of the arc + $pathString .= ' L ' . Format::formatSVGNumber($xStart) . ' ' . Format::formatSVGNumber($yStart); + } + // Instead of directly connecting the upper part of the arc (leaving a triangle), draw a bow with the radius $pathString .= ' A ' . Format::formatSVGNumber($r) . ' ' . Format::formatSVGNumber($r); // These are the flags for the bow, see the SVG path documentation for details @@ -122,7 +127,10 @@ class PieSlice extends Animatable implements Drawable $pathString .= ' 0 ' . (($this->endRadian - $this->startRadian > M_PI) ? '1' : '0 ') . ' 1'; // xEnd and yEnd are the lower point of the arc + $xEnd = $x + ($r * sin($this->endRadian)); + $yEnd = $y - ($r * cos($this->endRadian)); $pathString .= ' ' . Format::formatSVGNumber($xEnd) . ' ' . Format::formatSVGNumber($yEnd); + return $pathString; } From 23aa57a5d78e7efba28b743069164e9429219de0 Mon Sep 17 00:00:00 2001 From: Goran Rakic Date: Thu, 21 Aug 2014 03:52:51 +0200 Subject: [PATCH 033/257] Remove 100% pie slice hack The getPieSlicePath primitive can draw it now. --- library/Icinga/Chart/PieChart.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/library/Icinga/Chart/PieChart.php b/library/Icinga/Chart/PieChart.php index 222af96bd..7f7541e4e 100644 --- a/library/Icinga/Chart/PieChart.php +++ b/library/Icinga/Chart/PieChart.php @@ -274,9 +274,6 @@ class PieChart extends Chart $lastRadius = 0; foreach ($pie['data'] as $idx => $dataset) { $color = $this->getColorForPieSlice($pie, $idx); - if ($dataset === 100) { - $dataset = 99.9; - } if ($dataset == 0) { $labelPos++; continue; From 746f53fd2017153ee4a0c679509ad929aab559a2 Mon Sep 17 00:00:00 2001 From: Goran Rakic Date: Thu, 21 Aug 2014 03:58:36 +0200 Subject: [PATCH 034/257] Do not hide OK hosts and services from the Pie Chart Having a single hostgroup, and all hosts and services up, landing page Pie Chart is empty. This restores display of OK hosts and services. --- .../application/controllers/ChartController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/monitoring/application/controllers/ChartController.php b/modules/monitoring/application/controllers/ChartController.php index 31bea79af..4b5dd109d 100644 --- a/modules/monitoring/application/controllers/ChartController.php +++ b/modules/monitoring/application/controllers/ChartController.php @@ -222,16 +222,16 @@ class Monitoring_ChartController extends Controller if (isset($query->hosts_up)) { $this->view->chart->drawPie(array( 'data' => array( - // (int) $query->hosts_up, + (int) $query->hosts_up, (int) $query->hosts_down_handled, (int) $query->hosts_down_unhandled, (int) $query->hosts_unreachable_handled, (int) $query->hosts_unreachable_unhandled, (int) $query->hosts_pending ), - 'colors' => array( '#ff4444', '#ff0000', '#E066FF', '#f099FF', '#fefefe'), + 'colors' => array('#44bb77', '#ff4444', '#ff0000', '#E066FF', '#f099FF', '#fefefe'), 'labels'=> array( - // (int) $query->hosts_up . ' Up Hosts', + (int) $query->hosts_up . ' Up Hosts', (int) $query->hosts_down_handled . t(' Down Hosts (Handled)'), (int) $query->hosts_down_unhandled . t(' Down Hosts (Unhandled)'), (int) $query->hosts_unreachable_handled . t(' Unreachable Hosts (Handled)'), @@ -240,7 +240,7 @@ class Monitoring_ChartController extends Controller ) ), array( 'data' => array( - // (int) $query->services_ok, + (int) $query->services_ok, (int) $query->services_warning_unhandled, (int) $query->services_warning_handled, (int) $query->services_critical_unhandled, @@ -249,9 +249,9 @@ class Monitoring_ChartController extends Controller (int) $query->services_unknown_handled, (int) $query->services_pending ), - 'colors' => array('#ff4444', '#ff0000', '#ffff00', '#ffff33', '#E066FF', '#f099FF', '#fefefe'), + 'colors' => array('#44bb77', '#ff4444', '#ff0000', '#ffff00', '#ffff33', '#E066FF', '#f099FF', '#fefefe'), 'labels'=> array( - // $query->services_ok . ' Up Services', + $query->services_ok . ' Up Services', $query->services_warning_handled . t(' Warning Services (Handled)'), $query->services_warning_unhandled . t(' Warning Services (Unhandled)'), $query->services_critical_handled . t(' Down Services (Handled)'), From ff1d2e4fed398cc4260ffc131e2fa4e3a24b7a49 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Tue, 26 Aug 2014 11:40:48 +0200 Subject: [PATCH 035/257] Fix coding style --- library/Icinga/Chart/Primitive/PieSlice.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/Icinga/Chart/Primitive/PieSlice.php b/library/Icinga/Chart/Primitive/PieSlice.php index c7a6a06fa..90572a641 100644 --- a/library/Icinga/Chart/Primitive/PieSlice.php +++ b/library/Icinga/Chart/Primitive/PieSlice.php @@ -108,12 +108,11 @@ class PieSlice extends Animatable implements Drawable $xStart = $x + ($r * sin($this->startRadian)); $yStart = $y - ($r * cos($this->startRadian)); - if($this->endRadian - $this->startRadian == 2*M_PI) { + if ($this->endRadian - $this->startRadian == 2*M_PI) { // To draw a full circle, adjust arc endpoint by a small (unvisible) value $this->endRadian -= 0.001; - $pathString = 'M '. Format::formatSVGNumber($xStart) . ' ' . Format::formatSVGNumber($yStart); - } - else { + $pathString = 'M ' . Format::formatSVGNumber($xStart) . ' ' . Format::formatSVGNumber($yStart); + } else { // Start at the center of the pieslice $pathString = 'M ' . $x . ' ' . $y; // Draw a straight line to the upper part of the arc From 1ff63dbf3fc49fbbb48affecd1bddbf624193548 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Tue, 26 Aug 2014 18:05:22 +0200 Subject: [PATCH 036/257] Support nested keys expressed as single strings in the PreservingIniWriter Automatically convert keys with dots into nested configurations to avoid errors during the property diff, of the old and new configuration file. --- library/Icinga/Config/PreservingIniWriter.php | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/library/Icinga/Config/PreservingIniWriter.php b/library/Icinga/Config/PreservingIniWriter.php index 67059b6d8..2cafd5416 100644 --- a/library/Icinga/Config/PreservingIniWriter.php +++ b/library/Icinga/Config/PreservingIniWriter.php @@ -38,6 +38,45 @@ class PreservingIniWriter extends Zend_Config_Writer_FileAbstract parent::__construct($options); } + /** + * Find all keys containing dots and convert it to a nested configuration + * + * Ensure that configurations with the same ini representation the have + * similarly nested Zend_Config objects. The configuration may be altered + * during that process. + * + * @param Zend_Config $config The configuration to normalize + * @return Zend_Config The normalized config + */ + private function normalizeKeys(Zend_Config $config) + { + foreach ($config as $key => $value) { + if (preg_match('/\./', $key) > 0) { + // remove old key + unset ($config->$key); + + // insert new key + $nests = explode('.', $key); + $current = $config; + $i = 0; + for (; $i < count($nests) - 1; $i++) { + if (! isset($current->{$nests[$i]})) { + // configuration key doesn't exist, create a new nesting level + $current->{$nests[$i]} = new Zend_Config (array(), true); + } + // move to next nesting level + $current = $current->{$nests[$i]}; + } + // reached last nesting level, insert value + $current->{$nests[$i]} = $value; + } + if ($value instanceof Zend_Config) { + $config->$key = $this->normalizeKeys ($value); + } + } + return $config; + } + /** * Render the Zend_Config into a config file string * @@ -50,6 +89,17 @@ class PreservingIniWriter extends Zend_Config_Writer_FileAbstract } else { $oldconfig = new Zend_Config(array()); } + + // create an internal copy of the given configuration, since the user of this class + // won't expect that a configuration will ever be altered during + // the rendering process. + $extends = $this->_config->getExtends(); + $this->_config = new Zend_Config ($this->_config->toArray(), true); + foreach ($extends as $extending => $extended) { + $this->_config->setExtend($extending, $extended); + } + $this->_config = $this->normalizeKeys($this->_config); + $newconfig = $this->_config; $editor = new IniEditor(file_get_contents($this->_filename), $this->options); $this->diffConfigs($oldconfig, $newconfig, $editor); From 1aa95b054cc65b127162d767f770dd9ffc718731 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Tue, 26 Aug 2014 18:24:31 +0200 Subject: [PATCH 037/257] Add unit tests for nested-key handling in the PreservingIniWriter fixes #6381 --- .../Icinga/Config/PreservingIniWriterTest.php | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/test/php/library/Icinga/Config/PreservingIniWriterTest.php b/test/php/library/Icinga/Config/PreservingIniWriterTest.php index b69bc4d1c..da7e9674d 100644 --- a/test/php/library/Icinga/Config/PreservingIniWriterTest.php +++ b/test/php/library/Icinga/Config/PreservingIniWriterTest.php @@ -12,12 +12,14 @@ use Icinga\Config\PreservingIniWriter; class PreservingIniWriterTest extends BaseTestCase { protected $tempFile; + protected $tempFile2; public function setUp() { parent::setUp(); $this->tempFile = tempnam(sys_get_temp_dir(), 'icinga-ini-writer-test'); + $this->tempFile2 = tempnam(sys_get_temp_dir(), 'icinga-ini-writer-test-2'); } public function tearDown() @@ -25,6 +27,7 @@ class PreservingIniWriterTest extends BaseTestCase parent::tearDown(); unlink($this->tempFile); + unlink($this->tempFile2); } public function testWhetherSimplePropertiesAreInsertedInEmptyFiles() @@ -299,7 +302,7 @@ EOD ); $this->assertEquals( '1', - $newConfig->get('bar')->get('key1'), + $newConfig->get('foo')->get('key1'), 'PreservingIniWriter does not properly define extending sections' ); } @@ -678,6 +681,44 @@ EOD; ); } + public function testKeyNormalization() + { + $normalKeys = new PreservingIniWriter( + array ( + 'config' => new Zend_Config(array ( + 'foo' => 'bar', + 'nest' => array ( + 'nested' => array ( + 'stuff' => 'nested configuration element' + ) + ), + 'preserving' => array ( + 'ini' => array( + 'writer' => 'n' + ), + 'foo' => 'this should not be overwritten' + ) + )), + 'filename' => $this->tempFile + ) + + ); + + $nestedKeys = new PreservingIniWriter( + array ( + 'config' => new Zend_Config(array ( + 'foo' => 'bar', + 'nest.nested.stuff' => 'nested configuration element', + 'preserving.ini.writer' => 'n', + 'preserving.foo' => 'this should not be overwritten' + )), + 'filename' => $this->tempFile2 + ) + + ); + $this->assertEquals($normalKeys->render(), $nestedKeys->render()); + } + /** * Write a INI-configuration string to a temporary file and return it's path * From 7e5b5a0b30856c7904a18563e39e57c90efaa02f Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Wed, 27 Aug 2014 09:35:43 +0200 Subject: [PATCH 038/257] Hook/Grapher: Rework hook interface Rework interface based on specification and changed consumer calls. refs #6932 --- library/Icinga/Web/Hook/GrapherHook.php | 63 +++++++++++++++---- .../controllers/ShowController.php | 11 ++-- 2 files changed, 59 insertions(+), 15 deletions(-) diff --git a/library/Icinga/Web/Hook/GrapherHook.php b/library/Icinga/Web/Hook/GrapherHook.php index e2fea304a..99ab8a8f6 100644 --- a/library/Icinga/Web/Hook/GrapherHook.php +++ b/library/Icinga/Web/Hook/GrapherHook.php @@ -4,6 +4,8 @@ namespace Icinga\Web\Hook; +use Icinga\Exception\ProgrammingError; + /** * Icinga Web Grapher Hook base class * @@ -14,7 +16,7 @@ namespace Icinga\Web\Hook; * @author Icinga-Web Team * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License */ -class GrapherHook +abstract class GrapherHook { /** * Whether this grapher provides preview images @@ -56,9 +58,13 @@ class GrapherHook /** * Whether a graph for the given host[, service [, plot]] exists * + * @param string $host + * @param string $service + * @param string $plot + * * @return bool */ - public function hasGraph($host, $service = null, $plot = null) + public function has($host, $service = null, $plot = null) { return false; } @@ -66,13 +72,47 @@ class GrapherHook /** * Get a preview image for the given host[, service [, plot]] exists * - * WARNING: We are not sure yet whether this will remain as is + * @param string $host + * @param string $service + * @param string $plot * - * @return string + * @return string + * + * @throws ProgrammingError */ - public function getPreviewImage($host, $service = null, $plot = null) + public function getPreviewHtml($host, $service = null, $plot = null) { - throw new Exception('This backend has no preview images'); + throw new ProgrammingError('This backend has no preview images'); + } + + /** + * Whether a tiny graph for the given host[, service [, plot]] exists + * + * @param string $host + * @param string $service + * @param string $plot + * + * @return bool + */ + public function hasTinyPreview($host, $service = null, $plot = null) + { + return false; + } + + /** + * Get a tiny preview image for the given host[, service [, plot]] exists + * + * @param string $host + * @param string $service + * @param string $plot + * + * @return string + * + * @throws ProgrammingError + */ + public function getTinyPreviewHtml($host, $service = null, $plot = null) + { + throw new ProgrammingError('This backend has no tiny preview images'); } /** @@ -80,10 +120,11 @@ class GrapherHook * * WARNING: We are not sure yet whether this will remain as is * - * @return string + * @param string $host + * @param string $service + * @param string $plot + * + * @return string */ - public function getGraphUrl($host, $service = null, $plot = null) - { - throw new Exception('This backend has no images'); - } + abstract function getGraphUrl($host, $service = null, $plot = null); } diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index d503ba512..55b57cd52 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -25,6 +25,9 @@ class Monitoring_ShowController extends Controller */ protected $backend; + /** + * @var Hook\GrapherHook + */ protected $grapher; /** @@ -61,8 +64,8 @@ class Monitoring_ShowController extends Controller . ' on ' . $o->host_name; $this->getTabs()->activate('service'); $o->populate(); - if ($this->grapher && $this->grapher->hasGraph($o->host_name, $o->service_description)) { - $this->view->grapherHtml = $this->grapher->getPreviewImage($o->host_name, $o->service_description); + if ($this->grapher && $this->grapher->hasPreviews($o->host_name, $o->service_description)) { + $this->view->grapherHtml = $this->grapher->getPreviewHtml($o->host_name, $o->service_description); } } @@ -76,8 +79,8 @@ class Monitoring_ShowController extends Controller $this->getTabs()->activate('host'); $this->view->title = $o->host_name; $o->populate(); - if ($this->grapher && $this->grapher->hasGraph($o->host_name)) { - $this->view->grapherHtml = $this->grapher->getPreviewImage($o->host_name); + if ($this->grapher && $this->grapher->hasPreviews($o->host_name)) { + $this->view->grapherHtml = $this->grapher->getPreviewHtml($o->host_name); } } From 5abf41edef8f1678df6a50f6167a085c822c377f Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Wed, 27 Aug 2014 10:19:27 +0200 Subject: [PATCH 039/257] Hook/ConfigurationTab: Remove deprecated implementation ConfigurationTab hook is not used anywhere. Test is removed also. --- .../Hook/Configuration/ConfigurationTab.php | 145 ------------------ .../Configuration/ConfigurationTabBuilder.php | 107 ------------- .../ConfigurationTabInterface.php | 27 ---- .../ConfigurationTabBuilderTest.php | 72 --------- .../Configuration/ConfigurationTabTest.php | 79 ---------- 5 files changed, 430 deletions(-) delete mode 100644 library/Icinga/Web/Hook/Configuration/ConfigurationTab.php delete mode 100644 library/Icinga/Web/Hook/Configuration/ConfigurationTabBuilder.php delete mode 100644 library/Icinga/Web/Hook/Configuration/ConfigurationTabInterface.php delete mode 100644 test/php/library/Icinga/Web/Hook/Configuration/ConfigurationTabBuilderTest.php delete mode 100644 test/php/library/Icinga/Web/Hook/Configuration/ConfigurationTabTest.php diff --git a/library/Icinga/Web/Hook/Configuration/ConfigurationTab.php b/library/Icinga/Web/Hook/Configuration/ConfigurationTab.php deleted file mode 100644 index 28538687b..000000000 --- a/library/Icinga/Web/Hook/Configuration/ConfigurationTab.php +++ /dev/null @@ -1,145 +0,0 @@ -setModuleName($name); - - if ($title === null) { - $this->setTitle($name); - } - } - - if ($url !== null) { - $this->setUrl($url); - } - - if ($title !== null) { - $this->setTitle($title); - } - } - - /** - * Setter for title - * @param string $title - */ - public function setTitle($title) - { - $this->title = $title; - } - - /** - * Getter for title - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * Setter for url - * @param string $url - */ - public function setUrl($url) - { - $this->url = $url; - } - - /** - * Getter for url - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Setter for module name - * @param string $moduleName - */ - public function setModuleName($moduleName) - { - $this->moduleName = $moduleName; - } - - private function assertConfiguration() - { - if (!$this->moduleName) { - throw new ProgrammingError('moduleName is missing'); - } - - if (!$this->getUrl()) { - throw new ProgrammingError('url is missing'); - } - - if (!$this->getTitle()) { - throw new ProgrammingError('title is missing'); - } - } - - /** - * Returns a tab configuration to build configuration links - * @return array - */ - public function getTab() - { - $this->assertConfiguration(); - - return array( - 'title' => $this->getTitle(), - 'url' => $this->getUrl() - ); - } - - /** - * Return the tab key - * @return string - */ - public function getModuleName() - { - $this->assertConfiguration(); - return $this->moduleName; - } -} diff --git a/library/Icinga/Web/Hook/Configuration/ConfigurationTabBuilder.php b/library/Icinga/Web/Hook/Configuration/ConfigurationTabBuilder.php deleted file mode 100644 index c84073e1e..000000000 --- a/library/Icinga/Web/Hook/Configuration/ConfigurationTabBuilder.php +++ /dev/null @@ -1,107 +0,0 @@ -setTabs($tabs); - - $this->initializeSystemConfigurationTabs(); - } - - /** - * Setter for tabs - * @param \Icinga\Web\Widget\Tabs $tabs - */ - public function setTabs($tabs) - { - $this->tabs = $tabs; - } - - /** - * Getter for tabs - * @return \Icinga\Web\Widget\Tabs - */ - public function getTabs() - { - return $this->tabs; - } - - /** - * Build the tabs - * - */ - public function build() - { - /** @var ConfigurationTab $configTab */ - $configTab = null; - foreach (Hook::all(self::HOOK_NAMESPACE) as $configTab) { - if (!$configTab instanceof ConfigurationTabInterface) { - throw new ProgrammingError('tab not instance of ConfigTabInterface'); - } - - $this->getTabs()->add($configTab->getModuleName(), $configTab->getTab()); - } - } - - /** - * Initialize system configuration tabs - */ - public function initializeSystemConfigurationTabs() - { - $configurationTab = new ConfigurationTab( - 'configuration', - 'configuration/index', - 'Configuration' - ); - - // Display something about us - Hook::registerObject( - ConfigurationTabBuilder::HOOK_NAMESPACE, - $configurationTab->getModuleName(), - $configurationTab - ); - - $modulesOverviewTab = new ConfigurationTab( - 'modules', - 'modules/overview', - 'Modules' - ); - - Hook::registerObject( - ConfigurationTabBuilder::HOOK_NAMESPACE, - $modulesOverviewTab->getModuleName(), - $modulesOverviewTab - ); - } -} diff --git a/library/Icinga/Web/Hook/Configuration/ConfigurationTabInterface.php b/library/Icinga/Web/Hook/Configuration/ConfigurationTabInterface.php deleted file mode 100644 index 064bd8450..000000000 --- a/library/Icinga/Web/Hook/Configuration/ConfigurationTabInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -build(); - $tabs = $builder->getTabs(); - - $this->assertInstanceOf('Icinga\\Web\\Widget\\Tab', $tabs->get('configuration')); - } - - public function testTabCreation1() - { - $widget = new Tabs(); - $builder = new ConfigurationTabBuilder($widget); - - $tab1 = new ConfigurationTab('test1', '/test1', 'TEST1'); - $tab2 = new ConfigurationTab('test2', '/test2', 'TEST2'); - $tab3 = new ConfigurationTab('test3', '/test3', 'TEST3'); - - Hook::registerObject(ConfigurationTabBuilder::HOOK_NAMESPACE, 'test1', $tab1); - Hook::registerObject(ConfigurationTabBuilder::HOOK_NAMESPACE, 'test2', $tab2); - Hook::registerObject(ConfigurationTabBuilder::HOOK_NAMESPACE, 'test3', $tab3); - - $builder->build(); - - $this->assertCount(5, $builder->getTabs()); - } - - /** - * @expectedException Icinga\Exception\ProgrammingError - * @expectedExceptionMessage tab not instance of ConfigTabInterface - */ - public function testTabCreation2() - { - $widget = new Tabs(); - $builder = new ConfigurationTabBuilder($widget); - - $tab = Mockery::mock('Tab'); - Hook::registerObject(ConfigurationTabBuilder::HOOK_NAMESPACE, 'misc', $tab); - $builder->build(); - - $this->assertCount(5, $builder->getTabs()); - } -} diff --git a/test/php/library/Icinga/Web/Hook/Configuration/ConfigurationTabTest.php b/test/php/library/Icinga/Web/Hook/Configuration/ConfigurationTabTest.php deleted file mode 100644 index 6f9fdaeb1..000000000 --- a/test/php/library/Icinga/Web/Hook/Configuration/ConfigurationTabTest.php +++ /dev/null @@ -1,79 +0,0 @@ -assertEquals('test1', $tab->getModuleName()); - - $testArray = array( - 'title' => 'TEST_TITLE', - 'url' => '/test/$555' - ); - - $this->assertEquals($testArray, $tab->getTab()); - } - - public function testCreate2() - { - $tab = new ConfigurationTab( - 'test2', - '/test/$666' - ); - - $this->assertEquals('test2', $tab->getModuleName()); - - $testArray = array( - 'title' => 'test2', - 'url' => '/test/$666' - ); - - $this->assertEquals($testArray, $tab->getTab()); - } - - /** - * @expectedException Icinga\Exception\ProgrammingError - * @expectedExceptionMessage moduleName is missing - */ - public function testException1() - { - $tab = new ConfigurationTab(); - $tab->getTab(); - } - - /** - * @expectedException Icinga\Exception\ProgrammingError - * @expectedExceptionMessage url is missing - */ - public function testException2() - { - $tab = new ConfigurationTab(); - $tab->setModuleName('DING1'); - $tab->getTab(); - } - - /** - * @expectedException Icinga\Exception\ProgrammingError - * @expectedExceptionMessage title is missing - */ - public function testException3() - { - $tab = new ConfigurationTab(); - $tab->setModuleName('DING1'); - $tab->setUrl('/ding/dong'); - $tab->getTab(); - } -} From 87a59675011a4cf284d8e44c4fb66042ad84c39f Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 27 Aug 2014 11:16:44 +0200 Subject: [PATCH 040/257] Remove leading backslashes from the targets of use statements - use \Exception; + use Exception; --- .../controllers/DashboardController.php | 2 +- application/controllers/StaticController.php | 2 +- .../Config/Authentication/BaseBackendForm.php | 4 ++-- .../Config/Authentication/DbBackendForm.php | 4 ++-- .../Config/Authentication/LdapBackendForm.php | 4 ++-- .../Config/Authentication/ReorderForm.php | 2 +- application/forms/Config/LoggingForm.php | 2 +- application/forms/Preference/GeneralForm.php | 18 +++++++++--------- application/views/helpers/FormDateTime.php | 2 +- .../views/helpers/FormTriStateCheckbox.php | 2 +- library/Icinga/Application/functions.php | 2 +- library/Icinga/Chart/Primitive/Rect.php | 4 ++-- .../Commandpipe/Transport/Transport.php | 2 +- library/Icinga/Protocol/Ldap/Connection.php | 2 +- .../Statusdat/View/MonitoringObjectList.php | 8 ++++---- .../User/Preferences/PreferencesStore.php | 2 +- .../Web/Form/Decorator/ConditionalHidden.php | 2 +- .../Icinga/Web/Form/Element/DateTimePicker.php | 6 +++--- .../Web/Form/Element/TriStateCheckbox.php | 4 ++-- .../Web/Form/Validator/DateFormatValidator.php | 2 +- .../Web/Form/Validator/DateTimeValidator.php | 6 +++--- .../Web/Form/Validator/TimeFormatValidator.php | 2 +- .../Web/Form/Validator/TriStateValidator.php | 2 +- .../Form/Validator/WritablePathValidator.php | 4 ++-- library/Icinga/Web/Hook/TopBarHook.php | 4 ++-- .../Icinga/Web/Session/SessionNamespace.php | 6 +++--- .../controllers/IcingawebController.php | 2 +- .../controllers/ModuleController.php | 2 +- modules/doc/run.php | 2 +- .../controllers/ConfigController.php | 2 +- .../controllers/MonitoringCommands.php | 2 +- .../controllers/TimelineController.php | 6 +++--- .../forms/Command/AcknowledgeForm.php | 8 ++++---- .../forms/Command/MultiCommandFlagForm.php | 8 ++++---- .../Command/SingleArgumentCommandForm.php | 2 +- .../Command/SubmitPassiveCheckResultForm.php | 2 +- .../forms/Config/Backend/CreateBackendForm.php | 2 +- .../Config/Instance/CreateInstanceForm.php | 4 ++-- .../forms/Config/Instance/EditInstanceForm.php | 4 ++-- .../views/helpers/ResolveMacros.php | 2 +- modules/monitoring/bin/action/list.inc.php | 2 +- .../Backend/Ido/Query/StatusSummaryQuery.php | 2 +- .../Exception/UnsupportedBackendException.php | 2 +- .../library/Monitoring/Timeline/TimeEntry.php | 2 +- .../library/Monitoring/Timeline/TimeLine.php | 8 ++++---- .../views/helpers/MonitoringFlagsTest.php | 2 +- .../views/helpers/MonitoringPropertiesTest.php | 2 +- .../views/helpers/ResolveMacrosTest.php | 4 ++-- .../Translation/Cli/TranslationCommand.php | 2 +- .../Config/Authentication/ReorderFormTest.php | 4 ++-- .../library/Icinga/Application/ConfigTest.php | 2 +- .../library/Icinga/Chart/GraphChartTest.php | 4 ++-- test/php/library/Icinga/Chart/PieChartTest.php | 4 ++-- .../Protocol/Commandpipe/CommandPipeTest.php | 2 +- .../library/Icinga/Protocol/Ldap/QueryTest.php | 2 +- 55 files changed, 96 insertions(+), 96 deletions(-) diff --git a/application/controllers/DashboardController.php b/application/controllers/DashboardController.php index 108117959..dc48dd7f3 100644 --- a/application/controllers/DashboardController.php +++ b/application/controllers/DashboardController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Zend_Config; +use Zend_Config; use Icinga\Web\Url; use Icinga\Logger\Logger; use Icinga\Config\PreservingIniWriter; diff --git a/application/controllers/StaticController.php b/application/controllers/StaticController.php index 3a15b1b1e..51b5fdb62 100644 --- a/application/controllers/StaticController.php +++ b/application/controllers/StaticController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Zend_Controller_Action_Exception as ActionException; +use Zend_Controller_Action_Exception as ActionException; use Icinga\Web\Controller\ActionController; use Icinga\Application\Icinga; use Icinga\Logger\Logger; diff --git a/application/forms/Config/Authentication/BaseBackendForm.php b/application/forms/Config/Authentication/BaseBackendForm.php index 7a34f236a..f670b25c1 100644 --- a/application/forms/Config/Authentication/BaseBackendForm.php +++ b/application/forms/Config/Authentication/BaseBackendForm.php @@ -4,8 +4,8 @@ namespace Icinga\Form\Config\Authentication; -use \Zend_Config; -use \Zend_Form_Element_Checkbox; +use Zend_Config; +use Zend_Form_Element_Checkbox; use Icinga\Web\Form; use Icinga\Data\ResourceFactory; use Icinga\Web\Form\Decorator\HelpText; diff --git a/application/forms/Config/Authentication/DbBackendForm.php b/application/forms/Config/Authentication/DbBackendForm.php index 2c57b82e2..82594280b 100644 --- a/application/forms/Config/Authentication/DbBackendForm.php +++ b/application/forms/Config/Authentication/DbBackendForm.php @@ -4,8 +4,8 @@ namespace Icinga\Form\Config\Authentication; -use \Exception; -use \Zend_Config; +use Exception; +use Zend_Config; use Icinga\Data\ResourceFactory; use Icinga\Authentication\DbConnection; use Icinga\Authentication\Backend\DbUserBackend; diff --git a/application/forms/Config/Authentication/LdapBackendForm.php b/application/forms/Config/Authentication/LdapBackendForm.php index ee90fa95c..89f446795 100644 --- a/application/forms/Config/Authentication/LdapBackendForm.php +++ b/application/forms/Config/Authentication/LdapBackendForm.php @@ -4,8 +4,8 @@ namespace Icinga\Form\Config\Authentication; -use \Exception; -use \Zend_Config; +use Exception; +use Zend_Config; use Icinga\Web\Form; use Icinga\Data\ResourceFactory; use Icinga\Authentication\Backend\LdapUserBackend; diff --git a/application/forms/Config/Authentication/ReorderForm.php b/application/forms/Config/Authentication/ReorderForm.php index a074febea..b4c3cd9b7 100644 --- a/application/forms/Config/Authentication/ReorderForm.php +++ b/application/forms/Config/Authentication/ReorderForm.php @@ -4,7 +4,7 @@ namespace Icinga\Form\Config\Authentication; -use \Zend_Config; +use Zend_Config; use Icinga\Web\Form; /** diff --git a/application/forms/Config/LoggingForm.php b/application/forms/Config/LoggingForm.php index b3b4089c8..1fcb30fa5 100644 --- a/application/forms/Config/LoggingForm.php +++ b/application/forms/Config/LoggingForm.php @@ -4,7 +4,7 @@ namespace Icinga\Form\Config; -use \Zend_Config; +use Zend_Config; use Icinga\Web\Form; use Icinga\Application\Icinga; use Icinga\Web\Form\Validator\WritablePathValidator; diff --git a/application/forms/Preference/GeneralForm.php b/application/forms/Preference/GeneralForm.php index 204ddc51d..5b9a1b95f 100644 --- a/application/forms/Preference/GeneralForm.php +++ b/application/forms/Preference/GeneralForm.php @@ -4,15 +4,15 @@ namespace Icinga\Form\Preference; -use \DateTimeZone; -use \Zend_Config; -use \Zend_Form_Element_Text; -use \Zend_Form_Element_Select; -use \Zend_View_Helper_DateFormat; -use \Icinga\Web\Form; -use \Icinga\Web\Form\Validator\TimeFormatValidator; -use \Icinga\Web\Form\Validator\DateFormatValidator; -use \Icinga\Util\Translator; +use DateTimeZone; +use Zend_Config; +use Zend_Form_Element_Text; +use Zend_Form_Element_Select; +use Zend_View_Helper_DateFormat; +use Icinga\Web\Form; +use Icinga\Web\Form\Validator\TimeFormatValidator; +use Icinga\Web\Form\Validator\DateFormatValidator; +use Icinga\Util\Translator; /** * General user preferences diff --git a/application/views/helpers/FormDateTime.php b/application/views/helpers/FormDateTime.php index 07d5fb930..19a9cc3c5 100644 --- a/application/views/helpers/FormDateTime.php +++ b/application/views/helpers/FormDateTime.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Zend_View_Helper_FormElement; +use Zend_View_Helper_FormElement; /** * Helper to generate a "datetime" element diff --git a/application/views/helpers/FormTriStateCheckbox.php b/application/views/helpers/FormTriStateCheckbox.php index 695c9af56..b69114a11 100644 --- a/application/views/helpers/FormTriStateCheckbox.php +++ b/application/views/helpers/FormTriStateCheckbox.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Zend_View_Helper_FormElement; +use Zend_View_Helper_FormElement; /** * Helper to generate a "datetime" element diff --git a/library/Icinga/Application/functions.php b/library/Icinga/Application/functions.php index cfa5620ba..422dfeab7 100644 --- a/library/Icinga/Application/functions.php +++ b/library/Icinga/Application/functions.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Icinga\Util\Translator; +use Icinga\Util\Translator; if (extension_loaded('gettext')) { function t($messageId) diff --git a/library/Icinga/Chart/Primitive/Rect.php b/library/Icinga/Chart/Primitive/Rect.php index 36b63912f..fc389e204 100644 --- a/library/Icinga/Chart/Primitive/Rect.php +++ b/library/Icinga/Chart/Primitive/Rect.php @@ -4,8 +4,8 @@ namespace Icinga\Chart\Primitive; -use \DomElement; -use \Icinga\Chart\Render\RenderContext; +use DomElement; +use Icinga\Chart\Render\RenderContext; use Icinga\Chart\Format; /** diff --git a/library/Icinga/Protocol/Commandpipe/Transport/Transport.php b/library/Icinga/Protocol/Commandpipe/Transport/Transport.php index c5a5b3883..59119cf13 100644 --- a/library/Icinga/Protocol/Commandpipe/Transport/Transport.php +++ b/library/Icinga/Protocol/Commandpipe/Transport/Transport.php @@ -4,7 +4,7 @@ namespace Icinga\Protocol\Commandpipe\Transport; -use \Zend_Config; +use Zend_Config; /** * Interface for Transport classes handling the concrete access to the command pipe diff --git a/library/Icinga/Protocol/Ldap/Connection.php b/library/Icinga/Protocol/Ldap/Connection.php index edd99d021..531a399c8 100644 --- a/library/Icinga/Protocol/Ldap/Connection.php +++ b/library/Icinga/Protocol/Ldap/Connection.php @@ -8,7 +8,7 @@ use Icinga\Protocol\Ldap\Exception as LdapException; use Icinga\Application\Platform; use Icinga\Application\Config; use Icinga\Logger\Logger; -use \Zend_Config; +use Zend_Config; /** * Backend class managing all the LDAP stuff for you. diff --git a/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php b/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php index 8c6fdf0bc..e9a7e1bc9 100644 --- a/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php +++ b/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php @@ -4,10 +4,10 @@ namespace Icinga\Protocol\Statusdat\View; -use \Iterator; -use \Countable; -use \ArrayAccess; -use \Exception; +use Iterator; +use Countable; +use ArrayAccess; +use Exception; /** * Wrapper around an array of monitoring objects that can be enhanced with an optional diff --git a/library/Icinga/User/Preferences/PreferencesStore.php b/library/Icinga/User/Preferences/PreferencesStore.php index 749d054dc..b8121eb25 100644 --- a/library/Icinga/User/Preferences/PreferencesStore.php +++ b/library/Icinga/User/Preferences/PreferencesStore.php @@ -4,7 +4,7 @@ namespace Icinga\User\Preferences; -use \Zend_Config; +use Zend_Config; use Icinga\User; use Icinga\User\Preferences; use Icinga\Data\ResourceFactory; diff --git a/library/Icinga/Web/Form/Decorator/ConditionalHidden.php b/library/Icinga/Web/Form/Decorator/ConditionalHidden.php index 5d29caee4..c24f637ba 100644 --- a/library/Icinga/Web/Form/Decorator/ConditionalHidden.php +++ b/library/Icinga/Web/Form/Decorator/ConditionalHidden.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Form\Decorator; -use \Zend_Form_Decorator_Abstract; +use Zend_Form_Decorator_Abstract; /** * Decorator to hide elements using a >noscript< tag instead of diff --git a/library/Icinga/Web/Form/Element/DateTimePicker.php b/library/Icinga/Web/Form/Element/DateTimePicker.php index 911e26322..dd48bd7f2 100644 --- a/library/Icinga/Web/Form/Element/DateTimePicker.php +++ b/library/Icinga/Web/Form/Element/DateTimePicker.php @@ -5,9 +5,9 @@ namespace Icinga\Web\Form\Element; use Icinga\Web\Form\Validator\DateTimeValidator; -use \Zend_Form_Element_Text; -use \Zend_Form_Element; -use \Icinga\Util\DateTimeFactory; +use Zend_Form_Element_Text; +use Zend_Form_Element; +use Icinga\Util\DateTimeFactory; /** * Datetime form element which returns the input as Unix timestamp after the input has been proven valid. Utilizes diff --git a/library/Icinga/Web/Form/Element/TriStateCheckbox.php b/library/Icinga/Web/Form/Element/TriStateCheckbox.php index fb6ffb692..45763880d 100644 --- a/library/Icinga/Web/Form/Element/TriStateCheckbox.php +++ b/library/Icinga/Web/Form/Element/TriStateCheckbox.php @@ -4,8 +4,8 @@ namespace Icinga\Web\Form\Element; -use \Icinga\Web\Form\Validator\TriStateValidator; -use \Zend_Form_Element_Xhtml; +use Icinga\Web\Form\Validator\TriStateValidator; +use Zend_Form_Element_Xhtml; /** * A checkbox that can display three different states: diff --git a/library/Icinga/Web/Form/Validator/DateFormatValidator.php b/library/Icinga/Web/Form/Validator/DateFormatValidator.php index 2b2a413fd..b11629cbf 100644 --- a/library/Icinga/Web/Form/Validator/DateFormatValidator.php +++ b/library/Icinga/Web/Form/Validator/DateFormatValidator.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Form\Validator; -use \Zend_Validate_Abstract; +use Zend_Validate_Abstract; /** * Validator that checks if a textfield contains a correct date format diff --git a/library/Icinga/Web/Form/Validator/DateTimeValidator.php b/library/Icinga/Web/Form/Validator/DateTimeValidator.php index 952ac6c86..f1952f7d4 100644 --- a/library/Icinga/Web/Form/Validator/DateTimeValidator.php +++ b/library/Icinga/Web/Form/Validator/DateTimeValidator.php @@ -4,9 +4,9 @@ namespace Icinga\Web\Form\Validator; -use \Icinga\Util\DateTimeFactory; -use \Zend_Validate_Abstract; -use \Icinga\Exception\ProgrammingError; +use Icinga\Util\DateTimeFactory; +use Zend_Validate_Abstract; +use Icinga\Exception\ProgrammingError; /** * Validator that checks if a textfield contains a correct date format diff --git a/library/Icinga/Web/Form/Validator/TimeFormatValidator.php b/library/Icinga/Web/Form/Validator/TimeFormatValidator.php index 1715f7fdb..a02581cfa 100644 --- a/library/Icinga/Web/Form/Validator/TimeFormatValidator.php +++ b/library/Icinga/Web/Form/Validator/TimeFormatValidator.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Form\Validator; -use \Zend_Validate_Abstract; +use Zend_Validate_Abstract; /** * Validator that checks if a textfield contains a correct time format diff --git a/library/Icinga/Web/Form/Validator/TriStateValidator.php b/library/Icinga/Web/Form/Validator/TriStateValidator.php index f05f35b27..e51e00e21 100644 --- a/library/Icinga/Web/Form/Validator/TriStateValidator.php +++ b/library/Icinga/Web/Form/Validator/TriStateValidator.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Form\Validator; -use \Zend_Validate_Abstract; +use Zend_Validate_Abstract; class TriStateValidator extends Zend_Validate_Abstract { diff --git a/library/Icinga/Web/Form/Validator/WritablePathValidator.php b/library/Icinga/Web/Form/Validator/WritablePathValidator.php index 1381da9c7..8387c5cf5 100644 --- a/library/Icinga/Web/Form/Validator/WritablePathValidator.php +++ b/library/Icinga/Web/Form/Validator/WritablePathValidator.php @@ -4,8 +4,8 @@ namespace Icinga\Web\Form\Validator; -use \Zend_Validate_Abstract; -use \Icinga\Application\Config as IcingaConfig; +use Zend_Validate_Abstract; +use Icinga\Application\Config as IcingaConfig; /** * Validator that interprets the value as a path and checks if it's writable diff --git a/library/Icinga/Web/Hook/TopBarHook.php b/library/Icinga/Web/Hook/TopBarHook.php index 695d81109..fb637015d 100644 --- a/library/Icinga/Web/Hook/TopBarHook.php +++ b/library/Icinga/Web/Hook/TopBarHook.php @@ -4,8 +4,8 @@ namespace Icinga\Web\Hook; -use \Icinga\Web\Request; -use \Zend_View; +use Icinga\Web\Request; +use Zend_View; /** * Hook to extend topbar items diff --git a/library/Icinga/Web/Session/SessionNamespace.php b/library/Icinga/Web/Session/SessionNamespace.php index 8862d343f..682991aed 100644 --- a/library/Icinga/Web/Session/SessionNamespace.php +++ b/library/Icinga/Web/Session/SessionNamespace.php @@ -4,9 +4,9 @@ namespace Icinga\Web\Session; -use \Exception; -use \ArrayIterator; -use \IteratorAggregate; +use Exception; +use ArrayIterator; +use IteratorAggregate; /** * Container for session values diff --git a/modules/doc/application/controllers/IcingawebController.php b/modules/doc/application/controllers/IcingawebController.php index 967a2b768..ecbe3a6ee 100644 --- a/modules/doc/application/controllers/IcingawebController.php +++ b/modules/doc/application/controllers/IcingawebController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Zend_Controller_Action_Exception; +use Zend_Controller_Action_Exception; use Icinga\Application\Icinga; use Icinga\Module\Doc\DocController; diff --git a/modules/doc/application/controllers/ModuleController.php b/modules/doc/application/controllers/ModuleController.php index 40913368c..fa6c69d19 100644 --- a/modules/doc/application/controllers/ModuleController.php +++ b/modules/doc/application/controllers/ModuleController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Zend_Controller_Action_Exception; +use Zend_Controller_Action_Exception; use Icinga\Application\Icinga; use Icinga\Module\Doc\DocController; use Icinga\Module\Doc\Exception\DocException; diff --git a/modules/doc/run.php b/modules/doc/run.php index 7392e4c22..5edb69093 100644 --- a/modules/doc/run.php +++ b/modules/doc/run.php @@ -1,6 +1,6 @@ isCli()) { diff --git a/modules/monitoring/application/controllers/ConfigController.php b/modules/monitoring/application/controllers/ConfigController.php index f0982c29a..f0322dc3f 100644 --- a/modules/monitoring/application/controllers/ConfigController.php +++ b/modules/monitoring/application/controllers/ConfigController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Exception; +use Exception; use Icinga\Config\PreservingIniWriter; use Icinga\Web\Controller\ModuleActionController; diff --git a/modules/monitoring/application/controllers/MonitoringCommands.php b/modules/monitoring/application/controllers/MonitoringCommands.php index faa04114e..16b713d4c 100644 --- a/modules/monitoring/application/controllers/MonitoringCommands.php +++ b/modules/monitoring/application/controllers/MonitoringCommands.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Icinga\Module\Monitoring\Command\Meta; +use Icinga\Module\Monitoring\Command\Meta; /** * Class MonitoringCommands diff --git a/modules/monitoring/application/controllers/TimelineController.php b/modules/monitoring/application/controllers/TimelineController.php index 3fa621f3e..2f9b1339d 100644 --- a/modules/monitoring/application/controllers/TimelineController.php +++ b/modules/monitoring/application/controllers/TimelineController.php @@ -2,9 +2,9 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \DateTime; -use \DateInterval; -use \Zend_Config; +use DateTime; +use DateInterval; +use Zend_Config; use Icinga\Web\Url; use Icinga\Util\Format; use Icinga\Application\Config; diff --git a/modules/monitoring/application/forms/Command/AcknowledgeForm.php b/modules/monitoring/application/forms/Command/AcknowledgeForm.php index 364c3c20a..4ac4901b0 100644 --- a/modules/monitoring/application/forms/Command/AcknowledgeForm.php +++ b/modules/monitoring/application/forms/Command/AcknowledgeForm.php @@ -4,10 +4,10 @@ namespace Icinga\Module\Monitoring\Form\Command; -use \Icinga\Web\Form\Element\DateTimePicker; -use \Icinga\Protocol\Commandpipe\Comment; -use \Icinga\Util\DateTimeFactory; -use \Icinga\Module\Monitoring\Command\AcknowledgeCommand; +use Icinga\Web\Form\Element\DateTimePicker; +use Icinga\Protocol\Commandpipe\Comment; +use Icinga\Util\DateTimeFactory; +use Icinga\Module\Monitoring\Command\AcknowledgeCommand; /** * Form for problem acknowledgements diff --git a/modules/monitoring/application/forms/Command/MultiCommandFlagForm.php b/modules/monitoring/application/forms/Command/MultiCommandFlagForm.php index 6d49580a0..e413848c8 100644 --- a/modules/monitoring/application/forms/Command/MultiCommandFlagForm.php +++ b/modules/monitoring/application/forms/Command/MultiCommandFlagForm.php @@ -4,10 +4,10 @@ namespace Icinga\Module\Monitoring\Form\Command; -use \Icinga\Web\Form\Element\TriStateCheckbox; -use \Icinga\Web\Form; -use \Zend_Form_Element_Hidden; -use \Zend_Form; +use Icinga\Web\Form\Element\TriStateCheckbox; +use Icinga\Web\Form; +use Zend_Form_Element_Hidden; +use Zend_Form; /** * A form to edit multiple command flags of multiple commands at once. When some commands have diff --git a/modules/monitoring/application/forms/Command/SingleArgumentCommandForm.php b/modules/monitoring/application/forms/Command/SingleArgumentCommandForm.php index 7333ccdac..d7228ebdf 100644 --- a/modules/monitoring/application/forms/Command/SingleArgumentCommandForm.php +++ b/modules/monitoring/application/forms/Command/SingleArgumentCommandForm.php @@ -5,7 +5,7 @@ namespace Icinga\Module\Monitoring\Form\Command; use Zend_Controller_Request_Abstract; -use \Zend_Form_Element_Hidden; +use Zend_Form_Element_Hidden; use Icinga\Module\Monitoring\Command\AcknowledgeCommand; use Icinga\Module\Monitoring\Command\SingleArgumentCommand; diff --git a/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php b/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php index de2965565..c2c9151f3 100644 --- a/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php +++ b/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Form\Command; -use \Icinga\Exception\ProgrammingError; +use Icinga\Exception\ProgrammingError; /** * Form for submitting passive check results diff --git a/modules/monitoring/application/forms/Config/Backend/CreateBackendForm.php b/modules/monitoring/application/forms/Config/Backend/CreateBackendForm.php index 513dea238..6acc210ae 100644 --- a/modules/monitoring/application/forms/Config/Backend/CreateBackendForm.php +++ b/modules/monitoring/application/forms/Config/Backend/CreateBackendForm.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Form\Config\Backend; -use \Zend_Config; +use Zend_Config; /** * Extended EditBackendForm for creating new Backends diff --git a/modules/monitoring/application/forms/Config/Instance/CreateInstanceForm.php b/modules/monitoring/application/forms/Config/Instance/CreateInstanceForm.php index 705804bb9..077e02183 100644 --- a/modules/monitoring/application/forms/Config/Instance/CreateInstanceForm.php +++ b/modules/monitoring/application/forms/Config/Instance/CreateInstanceForm.php @@ -4,8 +4,8 @@ namespace Icinga\Module\Monitoring\Form\Config\Instance; -use \Icinga\Web\Form; -use \Zend_Config; +use Icinga\Web\Form; +use Zend_Config; /** * Form for creating new instances diff --git a/modules/monitoring/application/forms/Config/Instance/EditInstanceForm.php b/modules/monitoring/application/forms/Config/Instance/EditInstanceForm.php index e2a091c0f..f74b091df 100644 --- a/modules/monitoring/application/forms/Config/Instance/EditInstanceForm.php +++ b/modules/monitoring/application/forms/Config/Instance/EditInstanceForm.php @@ -4,8 +4,8 @@ namespace Icinga\Module\Monitoring\Form\Config\Instance; -use \Zend_Config; -use \Icinga\Web\Form; +use Zend_Config; +use Icinga\Web\Form; /** * Form for editing existing instances diff --git a/modules/monitoring/application/views/helpers/ResolveMacros.php b/modules/monitoring/application/views/helpers/ResolveMacros.php index b0f007b19..24471449c 100644 --- a/modules/monitoring/application/views/helpers/ResolveMacros.php +++ b/modules/monitoring/application/views/helpers/ResolveMacros.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Zend_View_Helper_Abstract; +use Zend_View_Helper_Abstract; use Icinga\Module\Monitoring\Object\AbstractObject; class Zend_View_Helper_ResolveMacros extends Zend_View_Helper_Abstract diff --git a/modules/monitoring/bin/action/list.inc.php b/modules/monitoring/bin/action/list.inc.php index 65a0ca61d..01fd35131 100644 --- a/modules/monitoring/bin/action/list.inc.php +++ b/modules/monitoring/bin/action/list.inc.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Icinga\Module\Monitoring\Backend; +use Icinga\Module\Monitoring\Backend; use Icinga\Util\Format; $backend = Backend::getInstance($params->shift('backend')); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php index ce61c8f1b..75db67b55 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Backend\Ido\Query; -use \Zend_Db_Select; +use Zend_Db_Select; class StatusSummaryQuery extends IdoQuery { diff --git a/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php b/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php index b0cd1b445..3e1468e36 100644 --- a/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php +++ b/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Exception; -use \Exception; +use Exception; class UnsupportedBackendException extends Exception { diff --git a/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php b/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php index 615999bdb..bd83a42cd 100644 --- a/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php +++ b/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Timeline; -use \DateTime; +use DateTime; use Icinga\Web\Url; use Icinga\Exception\ProgrammingError; diff --git a/modules/monitoring/library/Monitoring/Timeline/TimeLine.php b/modules/monitoring/library/Monitoring/Timeline/TimeLine.php index fa5af9141..2b0158bf1 100644 --- a/modules/monitoring/library/Monitoring/Timeline/TimeLine.php +++ b/modules/monitoring/library/Monitoring/Timeline/TimeLine.php @@ -4,10 +4,10 @@ namespace Icinga\Module\Monitoring\Timeline; -use \DateTime; -use \Exception; -use \ArrayIterator; -use \IteratorAggregate; +use DateTime; +use Exception; +use ArrayIterator; +use IteratorAggregate; use Icinga\Data\Filter\Filter; use Icinga\Web\Hook; use Icinga\Web\Session; diff --git a/modules/monitoring/test/php/application/views/helpers/MonitoringFlagsTest.php b/modules/monitoring/test/php/application/views/helpers/MonitoringFlagsTest.php index 961aefca5..f50b07893 100644 --- a/modules/monitoring/test/php/application/views/helpers/MonitoringFlagsTest.php +++ b/modules/monitoring/test/php/application/views/helpers/MonitoringFlagsTest.php @@ -4,7 +4,7 @@ namespace Tests\Icinga\Module\Monitoring\Application\Views\Helpers; -use \Zend_View_Helper_MonitoringFlags; +use Zend_View_Helper_MonitoringFlags; use Icinga\Test\BaseTestCase; require_once realpath(BaseTestCase::$moduleDir . '/monitoring/application/views/helpers/MonitoringFlags.php'); diff --git a/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php b/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php index aa13df35e..5a476aaef 100644 --- a/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php +++ b/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php @@ -4,7 +4,7 @@ namespace Test\Modules\Monitoring\Application\Views\Helpers; -use \Zend_View_Helper_MonitoringProperties; +use Zend_View_Helper_MonitoringProperties; use Icinga\Test\BaseTestCase; require_once realpath(BaseTestCase::$moduleDir . '/monitoring/application/views/helpers/MonitoringProperties.php'); diff --git a/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php b/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php index 374578947..a14f64ae7 100644 --- a/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php +++ b/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php @@ -4,8 +4,8 @@ namespace Tests\Icinga\Modules\Monitoring\Application\Views\Helpers; -use \Mockery; -use \Zend_View_Helper_ResolveMacros; +use Mockery; +use Zend_View_Helper_ResolveMacros; use Icinga\Test\BaseTestCase; require_once realpath(BaseTestCase::$moduleDir . '/monitoring/application/views/helpers/ResolveMacros.php'); diff --git a/modules/translation/library/Translation/Cli/TranslationCommand.php b/modules/translation/library/Translation/Cli/TranslationCommand.php index 417d9d6ed..b3cfc6de4 100644 --- a/modules/translation/library/Translation/Cli/TranslationCommand.php +++ b/modules/translation/library/Translation/Cli/TranslationCommand.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Translation\Cli; -use \Exception; +use Exception; use Icinga\Cli\Command; /** diff --git a/test/php/application/forms/Config/Authentication/ReorderFormTest.php b/test/php/application/forms/Config/Authentication/ReorderFormTest.php index a61efc48a..808806f1a 100644 --- a/test/php/application/forms/Config/Authentication/ReorderFormTest.php +++ b/test/php/application/forms/Config/Authentication/ReorderFormTest.php @@ -4,8 +4,8 @@ namespace Tests\Icinga\Form\Config\Authentication; -use \Mockery; -use \Zend_Config; +use Mockery; +use Zend_Config; use Icinga\Test\BaseTestCase; use Icinga\Form\Config\Authentication\ReorderForm; diff --git a/test/php/library/Icinga/Application/ConfigTest.php b/test/php/library/Icinga/Application/ConfigTest.php index bc39afecd..e99b17b2e 100644 --- a/test/php/library/Icinga/Application/ConfigTest.php +++ b/test/php/library/Icinga/Application/ConfigTest.php @@ -5,7 +5,7 @@ namespace Tests\Icinga\Application; use Icinga\Test\BaseTestCase; -use \Icinga\Application\Config as IcingaConfig; +use Icinga\Application\Config as IcingaConfig; class ConfigTest extends BaseTestCase { diff --git a/test/php/library/Icinga/Chart/GraphChartTest.php b/test/php/library/Icinga/Chart/GraphChartTest.php index 25870791a..6a7f73864 100644 --- a/test/php/library/Icinga/Chart/GraphChartTest.php +++ b/test/php/library/Icinga/Chart/GraphChartTest.php @@ -4,8 +4,8 @@ namespace Tests\Icinga\Chart; -use \DOMXPath; -use \DOMDocument; +use DOMXPath; +use DOMDocument; use Icinga\Chart\GridChart; use Icinga\Test\BaseTestCase; diff --git a/test/php/library/Icinga/Chart/PieChartTest.php b/test/php/library/Icinga/Chart/PieChartTest.php index c09f29e57..756fdf6e6 100644 --- a/test/php/library/Icinga/Chart/PieChartTest.php +++ b/test/php/library/Icinga/Chart/PieChartTest.php @@ -4,8 +4,8 @@ namespace Tests\Icinga\Chart; -use \DOMXPath; -use \DOMDocument; +use DOMXPath; +use DOMDocument; use Icinga\Chart\PieChart; use Icinga\Test\BaseTestCase; diff --git a/test/php/library/Icinga/Protocol/Commandpipe/CommandPipeTest.php b/test/php/library/Icinga/Protocol/Commandpipe/CommandPipeTest.php index 0ec9a4da6..7d3fd94f6 100644 --- a/test/php/library/Icinga/Protocol/Commandpipe/CommandPipeTest.php +++ b/test/php/library/Icinga/Protocol/Commandpipe/CommandPipeTest.php @@ -4,7 +4,7 @@ namespace Tests\Icinga\Protocol\Commandpipe; -use \Zend_Config; +use Zend_Config; use Icinga\Test\BaseTestCase; use Icinga\Protocol\Commandpipe\Comment; use Icinga\Protocol\Commandpipe\CommandPipe; diff --git a/test/php/library/Icinga/Protocol/Ldap/QueryTest.php b/test/php/library/Icinga/Protocol/Ldap/QueryTest.php index 0fa155202..b710a0934 100644 --- a/test/php/library/Icinga/Protocol/Ldap/QueryTest.php +++ b/test/php/library/Icinga/Protocol/Ldap/QueryTest.php @@ -4,7 +4,7 @@ namespace Tests\Icinga\Protocol\Ldap; -use \Zend_Config; +use Zend_Config; use Icinga\Test\BaseTestCase; use Icinga\Protocol\Ldap\Connection; From e0d7c3855dec7fe92fedb253264299f6ff0be0c1 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Wed, 27 Aug 2014 11:13:41 +0200 Subject: [PATCH 041/257] Hook: Add class suffix for base class testing refs #6928 --- library/Icinga/Web/Hook.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Web/Hook.php b/library/Icinga/Web/Hook.php index 76200493a..b88069da1 100644 --- a/library/Icinga/Web/Hook.php +++ b/library/Icinga/Web/Hook.php @@ -41,6 +41,15 @@ class Hook */ public static $BASE_NS = 'Icinga\\Web\\Hook\\'; + /** + * Append this string to base class + * + * All base classes renamed to *Hook + * + * @var string + */ + public static $classSuffix = 'Hook'; + /** * Reset object state */ @@ -114,7 +123,7 @@ class Hook */ private static function assertValidHook($instance, $name) { - $base_class = self::$BASE_NS . ucfirst($name); + $base_class = self::$BASE_NS . ucfirst($name) . self::$classSuffix; if (!$instance instanceof $base_class) { throw new ProgrammingError( '%s is not an instance of %s', From b7ae66b496e750836cd619b898f5fb72475e7187 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Wed, 27 Aug 2014 11:23:03 +0200 Subject: [PATCH 042/257] Hook: Add web hook base class refs #6929 --- library/Icinga/Web/Hook/WebBaseHook.php | 51 +++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 library/Icinga/Web/Hook/WebBaseHook.php diff --git a/library/Icinga/Web/Hook/WebBaseHook.php b/library/Icinga/Web/Hook/WebBaseHook.php new file mode 100644 index 000000000..a901787bb --- /dev/null +++ b/library/Icinga/Web/Hook/WebBaseHook.php @@ -0,0 +1,51 @@ +view = $view; + } + + /** + * Get the view instance + * + * @return Zend_View + */ + public function getView() + { + if ($this->view === null) { + $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); + if ($viewRenderer->view === null) { + $viewRenderer->initView(); + } + $this->view = $viewRenderer->view; + } + + return $this->view; + } +} \ No newline at end of file From 88698cb05dfdc3f3c8d8d852bbf04e32209d3ffe Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Wed, 27 Aug 2014 11:28:31 +0200 Subject: [PATCH 043/257] Hook/TopBar: Rework interface for monitoring top bar refs #6929 --- application/controllers/LayoutController.php | 4 ++-- library/Icinga/Web/Hook/TopBarHook.php | 5 ++--- modules/monitoring/library/Monitoring/Web/Hook/TopBar.php | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/application/controllers/LayoutController.php b/application/controllers/LayoutController.php index 952c4ee61..6c1355fc1 100644 --- a/application/controllers/LayoutController.php +++ b/application/controllers/LayoutController.php @@ -31,11 +31,11 @@ class LayoutController extends ActionController { $topbarHtmlParts = array(); - /** @var Hook\Layout\TopBar $hook */ + /** @var Hook\TopBarHook $hook */ $hook = null; foreach (Hook::all('TopBar') as $hook) { - $topbarHtmlParts[] = $hook->getHtml($this->getRequest(), $this->view); + $topbarHtmlParts[] = $hook->getHtml($this->getRequest()); } $this->view->topbarHtmlParts = $topbarHtmlParts; diff --git a/library/Icinga/Web/Hook/TopBarHook.php b/library/Icinga/Web/Hook/TopBarHook.php index fb637015d..183a0ca07 100644 --- a/library/Icinga/Web/Hook/TopBarHook.php +++ b/library/Icinga/Web/Hook/TopBarHook.php @@ -10,15 +10,14 @@ use Zend_View; /** * Hook to extend topbar items */ -abstract class TopBarHook +abstract class TopBarHook extends WebBaseHook { /** * Function to generate top bar content * * @param Request $request - * @param Zend_View $view * * @return string */ - abstract public function getHtml($request, $view); + abstract public function getHtml($request); } diff --git a/modules/monitoring/library/Monitoring/Web/Hook/TopBar.php b/modules/monitoring/library/Monitoring/Web/Hook/TopBar.php index 9433bf805..082a03c5b 100644 --- a/modules/monitoring/library/Monitoring/Web/Hook/TopBar.php +++ b/modules/monitoring/library/Monitoring/Web/Hook/TopBar.php @@ -18,11 +18,10 @@ class TopBar extends TopBarHook * Function to generate top bar content * * @param Request $request - * @param Zend_View $view * * @return string */ - public function getHtml($request, $view) + public function getHtml($request) { $hostSummary = StatusSummaryView::fromRequest( $request, @@ -50,7 +49,7 @@ class TopBar extends TopBarHook ) )->getQuery()->fetchRow(); - return $view->partial( + return $this->getView()->partial( 'layout/topbar.phtml', 'monitoring', array( From 1dea19504f4665975284c298dc221b7c5fcedb96 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 27 Aug 2014 12:24:11 +0200 Subject: [PATCH 044/257] Revert "Remove leading backslashes from the targets of use statements" This reverts commit 87a59675011a4cf284d8e44c4fb66042ad84c39f. At least 'modules/doc/run.php' issues a warning about "The use statement with non-compound name 'Zend_Controller_Router_Route' has no effect" --- .../controllers/DashboardController.php | 2 +- application/controllers/StaticController.php | 2 +- .../Config/Authentication/BaseBackendForm.php | 4 ++-- .../Config/Authentication/DbBackendForm.php | 4 ++-- .../Config/Authentication/LdapBackendForm.php | 4 ++-- .../Config/Authentication/ReorderForm.php | 2 +- application/forms/Config/LoggingForm.php | 2 +- application/forms/Preference/GeneralForm.php | 18 +++++++++--------- application/views/helpers/FormDateTime.php | 2 +- .../views/helpers/FormTriStateCheckbox.php | 2 +- library/Icinga/Application/functions.php | 2 +- library/Icinga/Chart/Primitive/Rect.php | 4 ++-- .../Commandpipe/Transport/Transport.php | 2 +- library/Icinga/Protocol/Ldap/Connection.php | 2 +- .../Statusdat/View/MonitoringObjectList.php | 8 ++++---- .../User/Preferences/PreferencesStore.php | 2 +- .../Web/Form/Decorator/ConditionalHidden.php | 2 +- .../Icinga/Web/Form/Element/DateTimePicker.php | 6 +++--- .../Web/Form/Element/TriStateCheckbox.php | 4 ++-- .../Web/Form/Validator/DateFormatValidator.php | 2 +- .../Web/Form/Validator/DateTimeValidator.php | 6 +++--- .../Web/Form/Validator/TimeFormatValidator.php | 2 +- .../Web/Form/Validator/TriStateValidator.php | 2 +- .../Form/Validator/WritablePathValidator.php | 4 ++-- library/Icinga/Web/Hook/TopBarHook.php | 4 ++-- .../Icinga/Web/Session/SessionNamespace.php | 6 +++--- .../controllers/IcingawebController.php | 2 +- .../controllers/ModuleController.php | 2 +- modules/doc/run.php | 2 +- .../controllers/ConfigController.php | 2 +- .../controllers/MonitoringCommands.php | 2 +- .../controllers/TimelineController.php | 6 +++--- .../forms/Command/AcknowledgeForm.php | 8 ++++---- .../forms/Command/MultiCommandFlagForm.php | 8 ++++---- .../Command/SingleArgumentCommandForm.php | 2 +- .../Command/SubmitPassiveCheckResultForm.php | 2 +- .../forms/Config/Backend/CreateBackendForm.php | 2 +- .../Config/Instance/CreateInstanceForm.php | 4 ++-- .../forms/Config/Instance/EditInstanceForm.php | 4 ++-- .../views/helpers/ResolveMacros.php | 2 +- modules/monitoring/bin/action/list.inc.php | 2 +- .../Backend/Ido/Query/StatusSummaryQuery.php | 2 +- .../Exception/UnsupportedBackendException.php | 2 +- .../library/Monitoring/Timeline/TimeEntry.php | 2 +- .../library/Monitoring/Timeline/TimeLine.php | 8 ++++---- .../views/helpers/MonitoringFlagsTest.php | 2 +- .../views/helpers/MonitoringPropertiesTest.php | 2 +- .../views/helpers/ResolveMacrosTest.php | 4 ++-- .../Translation/Cli/TranslationCommand.php | 2 +- .../Config/Authentication/ReorderFormTest.php | 4 ++-- .../library/Icinga/Application/ConfigTest.php | 2 +- .../library/Icinga/Chart/GraphChartTest.php | 4 ++-- test/php/library/Icinga/Chart/PieChartTest.php | 4 ++-- .../Protocol/Commandpipe/CommandPipeTest.php | 2 +- .../library/Icinga/Protocol/Ldap/QueryTest.php | 2 +- 55 files changed, 96 insertions(+), 96 deletions(-) diff --git a/application/controllers/DashboardController.php b/application/controllers/DashboardController.php index dc48dd7f3..108117959 100644 --- a/application/controllers/DashboardController.php +++ b/application/controllers/DashboardController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Zend_Config; +use \Zend_Config; use Icinga\Web\Url; use Icinga\Logger\Logger; use Icinga\Config\PreservingIniWriter; diff --git a/application/controllers/StaticController.php b/application/controllers/StaticController.php index 51b5fdb62..3a15b1b1e 100644 --- a/application/controllers/StaticController.php +++ b/application/controllers/StaticController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Zend_Controller_Action_Exception as ActionException; +use \Zend_Controller_Action_Exception as ActionException; use Icinga\Web\Controller\ActionController; use Icinga\Application\Icinga; use Icinga\Logger\Logger; diff --git a/application/forms/Config/Authentication/BaseBackendForm.php b/application/forms/Config/Authentication/BaseBackendForm.php index f670b25c1..7a34f236a 100644 --- a/application/forms/Config/Authentication/BaseBackendForm.php +++ b/application/forms/Config/Authentication/BaseBackendForm.php @@ -4,8 +4,8 @@ namespace Icinga\Form\Config\Authentication; -use Zend_Config; -use Zend_Form_Element_Checkbox; +use \Zend_Config; +use \Zend_Form_Element_Checkbox; use Icinga\Web\Form; use Icinga\Data\ResourceFactory; use Icinga\Web\Form\Decorator\HelpText; diff --git a/application/forms/Config/Authentication/DbBackendForm.php b/application/forms/Config/Authentication/DbBackendForm.php index 82594280b..2c57b82e2 100644 --- a/application/forms/Config/Authentication/DbBackendForm.php +++ b/application/forms/Config/Authentication/DbBackendForm.php @@ -4,8 +4,8 @@ namespace Icinga\Form\Config\Authentication; -use Exception; -use Zend_Config; +use \Exception; +use \Zend_Config; use Icinga\Data\ResourceFactory; use Icinga\Authentication\DbConnection; use Icinga\Authentication\Backend\DbUserBackend; diff --git a/application/forms/Config/Authentication/LdapBackendForm.php b/application/forms/Config/Authentication/LdapBackendForm.php index 89f446795..ee90fa95c 100644 --- a/application/forms/Config/Authentication/LdapBackendForm.php +++ b/application/forms/Config/Authentication/LdapBackendForm.php @@ -4,8 +4,8 @@ namespace Icinga\Form\Config\Authentication; -use Exception; -use Zend_Config; +use \Exception; +use \Zend_Config; use Icinga\Web\Form; use Icinga\Data\ResourceFactory; use Icinga\Authentication\Backend\LdapUserBackend; diff --git a/application/forms/Config/Authentication/ReorderForm.php b/application/forms/Config/Authentication/ReorderForm.php index b4c3cd9b7..a074febea 100644 --- a/application/forms/Config/Authentication/ReorderForm.php +++ b/application/forms/Config/Authentication/ReorderForm.php @@ -4,7 +4,7 @@ namespace Icinga\Form\Config\Authentication; -use Zend_Config; +use \Zend_Config; use Icinga\Web\Form; /** diff --git a/application/forms/Config/LoggingForm.php b/application/forms/Config/LoggingForm.php index 1fcb30fa5..b3b4089c8 100644 --- a/application/forms/Config/LoggingForm.php +++ b/application/forms/Config/LoggingForm.php @@ -4,7 +4,7 @@ namespace Icinga\Form\Config; -use Zend_Config; +use \Zend_Config; use Icinga\Web\Form; use Icinga\Application\Icinga; use Icinga\Web\Form\Validator\WritablePathValidator; diff --git a/application/forms/Preference/GeneralForm.php b/application/forms/Preference/GeneralForm.php index 5b9a1b95f..204ddc51d 100644 --- a/application/forms/Preference/GeneralForm.php +++ b/application/forms/Preference/GeneralForm.php @@ -4,15 +4,15 @@ namespace Icinga\Form\Preference; -use DateTimeZone; -use Zend_Config; -use Zend_Form_Element_Text; -use Zend_Form_Element_Select; -use Zend_View_Helper_DateFormat; -use Icinga\Web\Form; -use Icinga\Web\Form\Validator\TimeFormatValidator; -use Icinga\Web\Form\Validator\DateFormatValidator; -use Icinga\Util\Translator; +use \DateTimeZone; +use \Zend_Config; +use \Zend_Form_Element_Text; +use \Zend_Form_Element_Select; +use \Zend_View_Helper_DateFormat; +use \Icinga\Web\Form; +use \Icinga\Web\Form\Validator\TimeFormatValidator; +use \Icinga\Web\Form\Validator\DateFormatValidator; +use \Icinga\Util\Translator; /** * General user preferences diff --git a/application/views/helpers/FormDateTime.php b/application/views/helpers/FormDateTime.php index 19a9cc3c5..07d5fb930 100644 --- a/application/views/helpers/FormDateTime.php +++ b/application/views/helpers/FormDateTime.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Zend_View_Helper_FormElement; +use \Zend_View_Helper_FormElement; /** * Helper to generate a "datetime" element diff --git a/application/views/helpers/FormTriStateCheckbox.php b/application/views/helpers/FormTriStateCheckbox.php index b69114a11..695c9af56 100644 --- a/application/views/helpers/FormTriStateCheckbox.php +++ b/application/views/helpers/FormTriStateCheckbox.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Zend_View_Helper_FormElement; +use \Zend_View_Helper_FormElement; /** * Helper to generate a "datetime" element diff --git a/library/Icinga/Application/functions.php b/library/Icinga/Application/functions.php index 422dfeab7..cfa5620ba 100644 --- a/library/Icinga/Application/functions.php +++ b/library/Icinga/Application/functions.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Icinga\Util\Translator; +use \Icinga\Util\Translator; if (extension_loaded('gettext')) { function t($messageId) diff --git a/library/Icinga/Chart/Primitive/Rect.php b/library/Icinga/Chart/Primitive/Rect.php index fc389e204..36b63912f 100644 --- a/library/Icinga/Chart/Primitive/Rect.php +++ b/library/Icinga/Chart/Primitive/Rect.php @@ -4,8 +4,8 @@ namespace Icinga\Chart\Primitive; -use DomElement; -use Icinga\Chart\Render\RenderContext; +use \DomElement; +use \Icinga\Chart\Render\RenderContext; use Icinga\Chart\Format; /** diff --git a/library/Icinga/Protocol/Commandpipe/Transport/Transport.php b/library/Icinga/Protocol/Commandpipe/Transport/Transport.php index 59119cf13..c5a5b3883 100644 --- a/library/Icinga/Protocol/Commandpipe/Transport/Transport.php +++ b/library/Icinga/Protocol/Commandpipe/Transport/Transport.php @@ -4,7 +4,7 @@ namespace Icinga\Protocol\Commandpipe\Transport; -use Zend_Config; +use \Zend_Config; /** * Interface for Transport classes handling the concrete access to the command pipe diff --git a/library/Icinga/Protocol/Ldap/Connection.php b/library/Icinga/Protocol/Ldap/Connection.php index 531a399c8..edd99d021 100644 --- a/library/Icinga/Protocol/Ldap/Connection.php +++ b/library/Icinga/Protocol/Ldap/Connection.php @@ -8,7 +8,7 @@ use Icinga\Protocol\Ldap\Exception as LdapException; use Icinga\Application\Platform; use Icinga\Application\Config; use Icinga\Logger\Logger; -use Zend_Config; +use \Zend_Config; /** * Backend class managing all the LDAP stuff for you. diff --git a/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php b/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php index e9a7e1bc9..8c6fdf0bc 100644 --- a/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php +++ b/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php @@ -4,10 +4,10 @@ namespace Icinga\Protocol\Statusdat\View; -use Iterator; -use Countable; -use ArrayAccess; -use Exception; +use \Iterator; +use \Countable; +use \ArrayAccess; +use \Exception; /** * Wrapper around an array of monitoring objects that can be enhanced with an optional diff --git a/library/Icinga/User/Preferences/PreferencesStore.php b/library/Icinga/User/Preferences/PreferencesStore.php index b8121eb25..749d054dc 100644 --- a/library/Icinga/User/Preferences/PreferencesStore.php +++ b/library/Icinga/User/Preferences/PreferencesStore.php @@ -4,7 +4,7 @@ namespace Icinga\User\Preferences; -use Zend_Config; +use \Zend_Config; use Icinga\User; use Icinga\User\Preferences; use Icinga\Data\ResourceFactory; diff --git a/library/Icinga/Web/Form/Decorator/ConditionalHidden.php b/library/Icinga/Web/Form/Decorator/ConditionalHidden.php index c24f637ba..5d29caee4 100644 --- a/library/Icinga/Web/Form/Decorator/ConditionalHidden.php +++ b/library/Icinga/Web/Form/Decorator/ConditionalHidden.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Form\Decorator; -use Zend_Form_Decorator_Abstract; +use \Zend_Form_Decorator_Abstract; /** * Decorator to hide elements using a >noscript< tag instead of diff --git a/library/Icinga/Web/Form/Element/DateTimePicker.php b/library/Icinga/Web/Form/Element/DateTimePicker.php index dd48bd7f2..911e26322 100644 --- a/library/Icinga/Web/Form/Element/DateTimePicker.php +++ b/library/Icinga/Web/Form/Element/DateTimePicker.php @@ -5,9 +5,9 @@ namespace Icinga\Web\Form\Element; use Icinga\Web\Form\Validator\DateTimeValidator; -use Zend_Form_Element_Text; -use Zend_Form_Element; -use Icinga\Util\DateTimeFactory; +use \Zend_Form_Element_Text; +use \Zend_Form_Element; +use \Icinga\Util\DateTimeFactory; /** * Datetime form element which returns the input as Unix timestamp after the input has been proven valid. Utilizes diff --git a/library/Icinga/Web/Form/Element/TriStateCheckbox.php b/library/Icinga/Web/Form/Element/TriStateCheckbox.php index 45763880d..fb6ffb692 100644 --- a/library/Icinga/Web/Form/Element/TriStateCheckbox.php +++ b/library/Icinga/Web/Form/Element/TriStateCheckbox.php @@ -4,8 +4,8 @@ namespace Icinga\Web\Form\Element; -use Icinga\Web\Form\Validator\TriStateValidator; -use Zend_Form_Element_Xhtml; +use \Icinga\Web\Form\Validator\TriStateValidator; +use \Zend_Form_Element_Xhtml; /** * A checkbox that can display three different states: diff --git a/library/Icinga/Web/Form/Validator/DateFormatValidator.php b/library/Icinga/Web/Form/Validator/DateFormatValidator.php index b11629cbf..2b2a413fd 100644 --- a/library/Icinga/Web/Form/Validator/DateFormatValidator.php +++ b/library/Icinga/Web/Form/Validator/DateFormatValidator.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Form\Validator; -use Zend_Validate_Abstract; +use \Zend_Validate_Abstract; /** * Validator that checks if a textfield contains a correct date format diff --git a/library/Icinga/Web/Form/Validator/DateTimeValidator.php b/library/Icinga/Web/Form/Validator/DateTimeValidator.php index f1952f7d4..952ac6c86 100644 --- a/library/Icinga/Web/Form/Validator/DateTimeValidator.php +++ b/library/Icinga/Web/Form/Validator/DateTimeValidator.php @@ -4,9 +4,9 @@ namespace Icinga\Web\Form\Validator; -use Icinga\Util\DateTimeFactory; -use Zend_Validate_Abstract; -use Icinga\Exception\ProgrammingError; +use \Icinga\Util\DateTimeFactory; +use \Zend_Validate_Abstract; +use \Icinga\Exception\ProgrammingError; /** * Validator that checks if a textfield contains a correct date format diff --git a/library/Icinga/Web/Form/Validator/TimeFormatValidator.php b/library/Icinga/Web/Form/Validator/TimeFormatValidator.php index a02581cfa..1715f7fdb 100644 --- a/library/Icinga/Web/Form/Validator/TimeFormatValidator.php +++ b/library/Icinga/Web/Form/Validator/TimeFormatValidator.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Form\Validator; -use Zend_Validate_Abstract; +use \Zend_Validate_Abstract; /** * Validator that checks if a textfield contains a correct time format diff --git a/library/Icinga/Web/Form/Validator/TriStateValidator.php b/library/Icinga/Web/Form/Validator/TriStateValidator.php index e51e00e21..f05f35b27 100644 --- a/library/Icinga/Web/Form/Validator/TriStateValidator.php +++ b/library/Icinga/Web/Form/Validator/TriStateValidator.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Form\Validator; -use Zend_Validate_Abstract; +use \Zend_Validate_Abstract; class TriStateValidator extends Zend_Validate_Abstract { diff --git a/library/Icinga/Web/Form/Validator/WritablePathValidator.php b/library/Icinga/Web/Form/Validator/WritablePathValidator.php index 8387c5cf5..1381da9c7 100644 --- a/library/Icinga/Web/Form/Validator/WritablePathValidator.php +++ b/library/Icinga/Web/Form/Validator/WritablePathValidator.php @@ -4,8 +4,8 @@ namespace Icinga\Web\Form\Validator; -use Zend_Validate_Abstract; -use Icinga\Application\Config as IcingaConfig; +use \Zend_Validate_Abstract; +use \Icinga\Application\Config as IcingaConfig; /** * Validator that interprets the value as a path and checks if it's writable diff --git a/library/Icinga/Web/Hook/TopBarHook.php b/library/Icinga/Web/Hook/TopBarHook.php index 183a0ca07..867b4f721 100644 --- a/library/Icinga/Web/Hook/TopBarHook.php +++ b/library/Icinga/Web/Hook/TopBarHook.php @@ -4,8 +4,8 @@ namespace Icinga\Web\Hook; -use Icinga\Web\Request; -use Zend_View; +use \Icinga\Web\Request; +use \Zend_View; /** * Hook to extend topbar items diff --git a/library/Icinga/Web/Session/SessionNamespace.php b/library/Icinga/Web/Session/SessionNamespace.php index 682991aed..8862d343f 100644 --- a/library/Icinga/Web/Session/SessionNamespace.php +++ b/library/Icinga/Web/Session/SessionNamespace.php @@ -4,9 +4,9 @@ namespace Icinga\Web\Session; -use Exception; -use ArrayIterator; -use IteratorAggregate; +use \Exception; +use \ArrayIterator; +use \IteratorAggregate; /** * Container for session values diff --git a/modules/doc/application/controllers/IcingawebController.php b/modules/doc/application/controllers/IcingawebController.php index ecbe3a6ee..967a2b768 100644 --- a/modules/doc/application/controllers/IcingawebController.php +++ b/modules/doc/application/controllers/IcingawebController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Zend_Controller_Action_Exception; +use \Zend_Controller_Action_Exception; use Icinga\Application\Icinga; use Icinga\Module\Doc\DocController; diff --git a/modules/doc/application/controllers/ModuleController.php b/modules/doc/application/controllers/ModuleController.php index fa6c69d19..40913368c 100644 --- a/modules/doc/application/controllers/ModuleController.php +++ b/modules/doc/application/controllers/ModuleController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Zend_Controller_Action_Exception; +use \Zend_Controller_Action_Exception; use Icinga\Application\Icinga; use Icinga\Module\Doc\DocController; use Icinga\Module\Doc\Exception\DocException; diff --git a/modules/doc/run.php b/modules/doc/run.php index 5edb69093..7392e4c22 100644 --- a/modules/doc/run.php +++ b/modules/doc/run.php @@ -1,6 +1,6 @@ isCli()) { diff --git a/modules/monitoring/application/controllers/ConfigController.php b/modules/monitoring/application/controllers/ConfigController.php index f0322dc3f..f0982c29a 100644 --- a/modules/monitoring/application/controllers/ConfigController.php +++ b/modules/monitoring/application/controllers/ConfigController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Exception; +use \Exception; use Icinga\Config\PreservingIniWriter; use Icinga\Web\Controller\ModuleActionController; diff --git a/modules/monitoring/application/controllers/MonitoringCommands.php b/modules/monitoring/application/controllers/MonitoringCommands.php index 16b713d4c..faa04114e 100644 --- a/modules/monitoring/application/controllers/MonitoringCommands.php +++ b/modules/monitoring/application/controllers/MonitoringCommands.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Icinga\Module\Monitoring\Command\Meta; +use \Icinga\Module\Monitoring\Command\Meta; /** * Class MonitoringCommands diff --git a/modules/monitoring/application/controllers/TimelineController.php b/modules/monitoring/application/controllers/TimelineController.php index 2f9b1339d..3fa621f3e 100644 --- a/modules/monitoring/application/controllers/TimelineController.php +++ b/modules/monitoring/application/controllers/TimelineController.php @@ -2,9 +2,9 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use DateTime; -use DateInterval; -use Zend_Config; +use \DateTime; +use \DateInterval; +use \Zend_Config; use Icinga\Web\Url; use Icinga\Util\Format; use Icinga\Application\Config; diff --git a/modules/monitoring/application/forms/Command/AcknowledgeForm.php b/modules/monitoring/application/forms/Command/AcknowledgeForm.php index 4ac4901b0..364c3c20a 100644 --- a/modules/monitoring/application/forms/Command/AcknowledgeForm.php +++ b/modules/monitoring/application/forms/Command/AcknowledgeForm.php @@ -4,10 +4,10 @@ namespace Icinga\Module\Monitoring\Form\Command; -use Icinga\Web\Form\Element\DateTimePicker; -use Icinga\Protocol\Commandpipe\Comment; -use Icinga\Util\DateTimeFactory; -use Icinga\Module\Monitoring\Command\AcknowledgeCommand; +use \Icinga\Web\Form\Element\DateTimePicker; +use \Icinga\Protocol\Commandpipe\Comment; +use \Icinga\Util\DateTimeFactory; +use \Icinga\Module\Monitoring\Command\AcknowledgeCommand; /** * Form for problem acknowledgements diff --git a/modules/monitoring/application/forms/Command/MultiCommandFlagForm.php b/modules/monitoring/application/forms/Command/MultiCommandFlagForm.php index e413848c8..6d49580a0 100644 --- a/modules/monitoring/application/forms/Command/MultiCommandFlagForm.php +++ b/modules/monitoring/application/forms/Command/MultiCommandFlagForm.php @@ -4,10 +4,10 @@ namespace Icinga\Module\Monitoring\Form\Command; -use Icinga\Web\Form\Element\TriStateCheckbox; -use Icinga\Web\Form; -use Zend_Form_Element_Hidden; -use Zend_Form; +use \Icinga\Web\Form\Element\TriStateCheckbox; +use \Icinga\Web\Form; +use \Zend_Form_Element_Hidden; +use \Zend_Form; /** * A form to edit multiple command flags of multiple commands at once. When some commands have diff --git a/modules/monitoring/application/forms/Command/SingleArgumentCommandForm.php b/modules/monitoring/application/forms/Command/SingleArgumentCommandForm.php index d7228ebdf..7333ccdac 100644 --- a/modules/monitoring/application/forms/Command/SingleArgumentCommandForm.php +++ b/modules/monitoring/application/forms/Command/SingleArgumentCommandForm.php @@ -5,7 +5,7 @@ namespace Icinga\Module\Monitoring\Form\Command; use Zend_Controller_Request_Abstract; -use Zend_Form_Element_Hidden; +use \Zend_Form_Element_Hidden; use Icinga\Module\Monitoring\Command\AcknowledgeCommand; use Icinga\Module\Monitoring\Command\SingleArgumentCommand; diff --git a/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php b/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php index c2c9151f3..de2965565 100644 --- a/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php +++ b/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Form\Command; -use Icinga\Exception\ProgrammingError; +use \Icinga\Exception\ProgrammingError; /** * Form for submitting passive check results diff --git a/modules/monitoring/application/forms/Config/Backend/CreateBackendForm.php b/modules/monitoring/application/forms/Config/Backend/CreateBackendForm.php index 6acc210ae..513dea238 100644 --- a/modules/monitoring/application/forms/Config/Backend/CreateBackendForm.php +++ b/modules/monitoring/application/forms/Config/Backend/CreateBackendForm.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Form\Config\Backend; -use Zend_Config; +use \Zend_Config; /** * Extended EditBackendForm for creating new Backends diff --git a/modules/monitoring/application/forms/Config/Instance/CreateInstanceForm.php b/modules/monitoring/application/forms/Config/Instance/CreateInstanceForm.php index 077e02183..705804bb9 100644 --- a/modules/monitoring/application/forms/Config/Instance/CreateInstanceForm.php +++ b/modules/monitoring/application/forms/Config/Instance/CreateInstanceForm.php @@ -4,8 +4,8 @@ namespace Icinga\Module\Monitoring\Form\Config\Instance; -use Icinga\Web\Form; -use Zend_Config; +use \Icinga\Web\Form; +use \Zend_Config; /** * Form for creating new instances diff --git a/modules/monitoring/application/forms/Config/Instance/EditInstanceForm.php b/modules/monitoring/application/forms/Config/Instance/EditInstanceForm.php index f74b091df..e2a091c0f 100644 --- a/modules/monitoring/application/forms/Config/Instance/EditInstanceForm.php +++ b/modules/monitoring/application/forms/Config/Instance/EditInstanceForm.php @@ -4,8 +4,8 @@ namespace Icinga\Module\Monitoring\Form\Config\Instance; -use Zend_Config; -use Icinga\Web\Form; +use \Zend_Config; +use \Icinga\Web\Form; /** * Form for editing existing instances diff --git a/modules/monitoring/application/views/helpers/ResolveMacros.php b/modules/monitoring/application/views/helpers/ResolveMacros.php index 24471449c..b0f007b19 100644 --- a/modules/monitoring/application/views/helpers/ResolveMacros.php +++ b/modules/monitoring/application/views/helpers/ResolveMacros.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Zend_View_Helper_Abstract; +use \Zend_View_Helper_Abstract; use Icinga\Module\Monitoring\Object\AbstractObject; class Zend_View_Helper_ResolveMacros extends Zend_View_Helper_Abstract diff --git a/modules/monitoring/bin/action/list.inc.php b/modules/monitoring/bin/action/list.inc.php index 01fd35131..65a0ca61d 100644 --- a/modules/monitoring/bin/action/list.inc.php +++ b/modules/monitoring/bin/action/list.inc.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Icinga\Module\Monitoring\Backend; +use \Icinga\Module\Monitoring\Backend; use Icinga\Util\Format; $backend = Backend::getInstance($params->shift('backend')); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php index 75db67b55..ce61c8f1b 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Backend\Ido\Query; -use Zend_Db_Select; +use \Zend_Db_Select; class StatusSummaryQuery extends IdoQuery { diff --git a/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php b/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php index 3e1468e36..b0cd1b445 100644 --- a/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php +++ b/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Exception; -use Exception; +use \Exception; class UnsupportedBackendException extends Exception { diff --git a/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php b/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php index bd83a42cd..615999bdb 100644 --- a/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php +++ b/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Timeline; -use DateTime; +use \DateTime; use Icinga\Web\Url; use Icinga\Exception\ProgrammingError; diff --git a/modules/monitoring/library/Monitoring/Timeline/TimeLine.php b/modules/monitoring/library/Monitoring/Timeline/TimeLine.php index 2b0158bf1..fa5af9141 100644 --- a/modules/monitoring/library/Monitoring/Timeline/TimeLine.php +++ b/modules/monitoring/library/Monitoring/Timeline/TimeLine.php @@ -4,10 +4,10 @@ namespace Icinga\Module\Monitoring\Timeline; -use DateTime; -use Exception; -use ArrayIterator; -use IteratorAggregate; +use \DateTime; +use \Exception; +use \ArrayIterator; +use \IteratorAggregate; use Icinga\Data\Filter\Filter; use Icinga\Web\Hook; use Icinga\Web\Session; diff --git a/modules/monitoring/test/php/application/views/helpers/MonitoringFlagsTest.php b/modules/monitoring/test/php/application/views/helpers/MonitoringFlagsTest.php index f50b07893..961aefca5 100644 --- a/modules/monitoring/test/php/application/views/helpers/MonitoringFlagsTest.php +++ b/modules/monitoring/test/php/application/views/helpers/MonitoringFlagsTest.php @@ -4,7 +4,7 @@ namespace Tests\Icinga\Module\Monitoring\Application\Views\Helpers; -use Zend_View_Helper_MonitoringFlags; +use \Zend_View_Helper_MonitoringFlags; use Icinga\Test\BaseTestCase; require_once realpath(BaseTestCase::$moduleDir . '/monitoring/application/views/helpers/MonitoringFlags.php'); diff --git a/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php b/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php index 5a476aaef..aa13df35e 100644 --- a/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php +++ b/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php @@ -4,7 +4,7 @@ namespace Test\Modules\Monitoring\Application\Views\Helpers; -use Zend_View_Helper_MonitoringProperties; +use \Zend_View_Helper_MonitoringProperties; use Icinga\Test\BaseTestCase; require_once realpath(BaseTestCase::$moduleDir . '/monitoring/application/views/helpers/MonitoringProperties.php'); diff --git a/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php b/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php index a14f64ae7..374578947 100644 --- a/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php +++ b/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php @@ -4,8 +4,8 @@ namespace Tests\Icinga\Modules\Monitoring\Application\Views\Helpers; -use Mockery; -use Zend_View_Helper_ResolveMacros; +use \Mockery; +use \Zend_View_Helper_ResolveMacros; use Icinga\Test\BaseTestCase; require_once realpath(BaseTestCase::$moduleDir . '/monitoring/application/views/helpers/ResolveMacros.php'); diff --git a/modules/translation/library/Translation/Cli/TranslationCommand.php b/modules/translation/library/Translation/Cli/TranslationCommand.php index b3cfc6de4..417d9d6ed 100644 --- a/modules/translation/library/Translation/Cli/TranslationCommand.php +++ b/modules/translation/library/Translation/Cli/TranslationCommand.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Translation\Cli; -use Exception; +use \Exception; use Icinga\Cli\Command; /** diff --git a/test/php/application/forms/Config/Authentication/ReorderFormTest.php b/test/php/application/forms/Config/Authentication/ReorderFormTest.php index 808806f1a..a61efc48a 100644 --- a/test/php/application/forms/Config/Authentication/ReorderFormTest.php +++ b/test/php/application/forms/Config/Authentication/ReorderFormTest.php @@ -4,8 +4,8 @@ namespace Tests\Icinga\Form\Config\Authentication; -use Mockery; -use Zend_Config; +use \Mockery; +use \Zend_Config; use Icinga\Test\BaseTestCase; use Icinga\Form\Config\Authentication\ReorderForm; diff --git a/test/php/library/Icinga/Application/ConfigTest.php b/test/php/library/Icinga/Application/ConfigTest.php index e99b17b2e..bc39afecd 100644 --- a/test/php/library/Icinga/Application/ConfigTest.php +++ b/test/php/library/Icinga/Application/ConfigTest.php @@ -5,7 +5,7 @@ namespace Tests\Icinga\Application; use Icinga\Test\BaseTestCase; -use Icinga\Application\Config as IcingaConfig; +use \Icinga\Application\Config as IcingaConfig; class ConfigTest extends BaseTestCase { diff --git a/test/php/library/Icinga/Chart/GraphChartTest.php b/test/php/library/Icinga/Chart/GraphChartTest.php index 6a7f73864..25870791a 100644 --- a/test/php/library/Icinga/Chart/GraphChartTest.php +++ b/test/php/library/Icinga/Chart/GraphChartTest.php @@ -4,8 +4,8 @@ namespace Tests\Icinga\Chart; -use DOMXPath; -use DOMDocument; +use \DOMXPath; +use \DOMDocument; use Icinga\Chart\GridChart; use Icinga\Test\BaseTestCase; diff --git a/test/php/library/Icinga/Chart/PieChartTest.php b/test/php/library/Icinga/Chart/PieChartTest.php index 756fdf6e6..c09f29e57 100644 --- a/test/php/library/Icinga/Chart/PieChartTest.php +++ b/test/php/library/Icinga/Chart/PieChartTest.php @@ -4,8 +4,8 @@ namespace Tests\Icinga\Chart; -use DOMXPath; -use DOMDocument; +use \DOMXPath; +use \DOMDocument; use Icinga\Chart\PieChart; use Icinga\Test\BaseTestCase; diff --git a/test/php/library/Icinga/Protocol/Commandpipe/CommandPipeTest.php b/test/php/library/Icinga/Protocol/Commandpipe/CommandPipeTest.php index 7d3fd94f6..0ec9a4da6 100644 --- a/test/php/library/Icinga/Protocol/Commandpipe/CommandPipeTest.php +++ b/test/php/library/Icinga/Protocol/Commandpipe/CommandPipeTest.php @@ -4,7 +4,7 @@ namespace Tests\Icinga\Protocol\Commandpipe; -use Zend_Config; +use \Zend_Config; use Icinga\Test\BaseTestCase; use Icinga\Protocol\Commandpipe\Comment; use Icinga\Protocol\Commandpipe\CommandPipe; diff --git a/test/php/library/Icinga/Protocol/Ldap/QueryTest.php b/test/php/library/Icinga/Protocol/Ldap/QueryTest.php index b710a0934..0fa155202 100644 --- a/test/php/library/Icinga/Protocol/Ldap/QueryTest.php +++ b/test/php/library/Icinga/Protocol/Ldap/QueryTest.php @@ -4,7 +4,7 @@ namespace Tests\Icinga\Protocol\Ldap; -use Zend_Config; +use \Zend_Config; use Icinga\Test\BaseTestCase; use Icinga\Protocol\Ldap\Connection; From 4a59ff6712f67db924e190c7989caaacb1fdcf44 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Wed, 27 Aug 2014 13:51:52 +0200 Subject: [PATCH 045/257] Support preserveAspectRatio in SVGRenderer Add support for the preserveAspectRatio attributes in root SVG elements, to improve the handling of padding and automatic resizing of inline SVG. --- library/Icinga/Chart/Chart.php | 18 +++++- library/Icinga/Chart/SVGRenderer.php | 92 ++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Chart/Chart.php b/library/Icinga/Chart/Chart.php index be436df2a..625a2ccaa 100644 --- a/library/Icinga/Chart/Chart.php +++ b/library/Icinga/Chart/Chart.php @@ -15,6 +15,8 @@ use Icinga\Chart\SVGRenderer; */ abstract class Chart implements Drawable { + protected $align = false; + /** * SVG renderer that handles * @@ -98,8 +100,22 @@ abstract class Chart implements Drawable throw new Exception('Dataset for graph doesn\'t have the proper structure'); } $this->build(); - + if ($this->align) { + $this->renderer->preserveAspectRatio(); + $this->renderer->setXAspectRatioAlignment(SVGRenderer::X_ASPECT_RATIO_MIN); + $this->renderer->setYAspectRatioAlignment(SVGRenderer::Y_ASPECT_RATIO_MIN); + } $this->renderer->getCanvas()->addElement($this); return $this->renderer->render(); } + + /** + * Align the chart to the top left corner instead of centering it + * + * @param bool $align + */ + public function alignTopLeft ($align = true) + { + $this->align = $align; + } } diff --git a/library/Icinga/Chart/SVGRenderer.php b/library/Icinga/Chart/SVGRenderer.php index 390e48739..69a3ce285 100644 --- a/library/Icinga/Chart/SVGRenderer.php +++ b/library/Icinga/Chart/SVGRenderer.php @@ -19,6 +19,22 @@ use Icinga\Chart\Primitive\Canvas; */ class SVGRenderer { + const X_ASPECT_RATIO_MIN = 'xMin'; + + const X_ASPECT_RATIO_MID = 'xMid'; + + const X_ASPECT_RATIO_MAX = 'xMax'; + + const Y_ASPECT_RATIO_MIN = 'YMin'; + + const Y_ASPECT_RATIO_MID = 'YMid'; + + const Y_ASPECT_RATIO_MAX = 'YMax'; + + const ASPECT_RATIO_PAD = 'meet'; + + const ASPECT_RATIO_CUTOFF = 'slice'; + /** * The XML-document * @@ -54,6 +70,35 @@ class SVGRenderer */ private $height = 100; + /** + * Whether the aspect ratio is preversed + * + * @var bool + */ + private $preserveAspectRatio = false; + + /** + * Horizontal alignment of SVG element + * + * @var string + */ + private $xAspectRatio = self::X_ASPECT_RATIO_MID; + + /** + * Vertical alignment of SVG element + * + * @var string + */ + private $yAspectRatio = self::Y_ASPECT_RATIO_MID; + + /** + * Define whether aspect differences should be handled using padding (default) or cutoff + * + * @var string + */ + private $xFillMode = "meet"; + + /** * Create the root document and the SVG root node */ @@ -92,6 +137,17 @@ class SVGRenderer $ctx->getNrOfUnitsY() ) ); + if ($this->preserveAspectRatio) { + $svg->setAttribute( + 'preserveAspectRatio', + sprintf ( + '%s%s %s', + $this->xAspectRatio, + $this->yAspectRatio, + $this->xFillMode + ) + ); + } return $svg; } @@ -141,4 +197,40 @@ class SVGRenderer { return $this->rootCanvas; } + + /** + * Preserve the aspect ratio of the rendered object + * + * Do not deform the content of the SVG when the aspect ratio of the viewBox + * differs from the aspect ratio of the SVG element, but add padding or cutoff + * instead + * + * @param bool $preserve Whether the aspect ratio should be preserved + */ + public function preserveAspectRatio($preserve = true) + { + $this->preserveAspectRatio = $preserve; + } + + /** + * Change the horizontal alignment of the SVG element + * + * Change the horizontal alignment of the svg, when preserveAspectRatio is used and + * padding is present. Defaults to + */ + public function setXAspectRatioAlignment($alignment) + { + $this->xAspectRatio = $alignment; + } + + /** + * Change the vertical alignment of the SVG element + * + * Change the vertical alignment of the svg, when preserveAspectRatio is used and + * padding is present. + */ + public function setYAspectRatioAlignment($alignment) + { + $this->yAspectRatio = $alignment; + } } From 236d384bab3c1b64f3fd9954487accc33aafe48a Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Wed, 27 Aug 2014 14:54:45 +0200 Subject: [PATCH 046/257] Fixes unaccepted behavior in module configuration fixes #7011 --- library/Icinga/Application/Modules/Module.php | 15 +++-- library/Icinga/Web/Menu.php | 20 ++++--- .../Icinga/Web/Widget/Dashboard/Component.php | 37 ++++++++++-- library/Icinga/Web/Widget/Dashboard/Pane.php | 56 +++++++++--------- modules/doc/configuration.php | 3 +- modules/monitoring/configuration.php | 58 ++++++++++--------- 6 files changed, 115 insertions(+), 74 deletions(-) diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index a325dfef0..ebc939f49 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -176,6 +176,7 @@ class Module /** * Add a pane to dashboard * + * @param $id * @param $name * @return Pane */ @@ -199,19 +200,21 @@ class Module /** * Add a menu Section to the Sidebar menu * - * @param $name + * @param string $id + * @param string $name * @param array $properties * @return mixed */ - protected function menuSection($name, array $properties = array()) + protected function menuSection($id, $name, array $properties = array()) { - if (array_key_exists($name, $this->menuItems)) { - $this->menuItems[$name]->setProperties($properties); + if (array_key_exists($id, $this->menuItems)) { + $this->menuItems[$id]->setProperties($properties); } else { - $this->menuItems[$name] = new Menu($name, new Zend_Config($properties)); + $this->menuItems[$id] = new Menu($id, new Zend_Config($properties)); + $this->menuItems[$id]->setTitle($name); } - return $this->menuItems[$name]; + return $this->menuItems[$id]; } /** diff --git a/library/Icinga/Web/Menu.php b/library/Icinga/Web/Menu.php index 2fa49b99c..c5640ac09 100644 --- a/library/Icinga/Web/Menu.php +++ b/library/Icinga/Web/Menu.php @@ -5,6 +5,7 @@ namespace Icinga\Web; use Icinga\Exception\ConfigurationError; +use Icinga\Logger\Logger; use Zend_Config; use RecursiveIterator; use Icinga\Application\Config; @@ -172,34 +173,34 @@ class Menu implements RecursiveIterator */ protected function addMainMenuItems() { - $this->add(t('Dashboard'), array( + $this->add('dashboard', t('Dashboard'), array( 'url' => 'dashboard', 'icon' => 'img/icons/dashboard.png', 'priority' => 10 )); - $section = $this->add(t('System'), array( + $section = $this->add('system', t('System'), array( 'icon' => 'img/icons/configuration.png', 'priority' => 200 )); - $section->add(t('Preferences'), array( + $section->add('preferences', t('Preferences'), array( 'url' => 'preference', 'priority' => 200 )); - $section->add(t('Configuration'), array( + $section->add('configuration', t('Configuration'), array( 'url' => 'config', 'priority' => 300 )); - $section->add(t('Modules'), array( + $section->add('modules', t('Modules'), array( 'url' => 'config/modules', 'priority' => 400 )); - $section->add(t('ApplicationLog'), array( + $section->add('applicationlog', t('ApplicationLog'), array( 'url' => 'list/applicationlog', 'priority' => 500 )); - $this->add(t('Logout'), array( + $this->add('logout', t('Logout'), array( 'url' => 'authentication/logout', 'icon' => 'img/icons/logout.png', 'priority' => 300 @@ -427,9 +428,10 @@ class Menu implements RecursiveIterator * @param array $config * @return Menu */ - public function add($name, $config = array()) + public function add($id, $name, $config = array()) { - return $this->addSubMenu($name, new Zend_Config($config)); + $config['title'] = $name; + return $this->addSubMenu($id, new Zend_Config($config)); } /** diff --git a/library/Icinga/Web/Widget/Dashboard/Component.php b/library/Icinga/Web/Widget/Dashboard/Component.php index 2d8517526..56f499dc1 100644 --- a/library/Icinga/Web/Widget/Dashboard/Component.php +++ b/library/Icinga/Web/Widget/Dashboard/Component.php @@ -29,6 +29,13 @@ class Component extends AbstractWidget */ private $url; + /** + * The id of this Component + * + * @var string + */ + private $id; + /** * The title being displayed on top of the component * @var @@ -59,12 +66,14 @@ EOD; /** * Create a new component displaying the given url in the provided pane * + * @param string $id The id to use for this component * @param string $title The title to use for this component * @param Url|string $url The url this component uses for displaying information * @param Pane $pane The pane this Component will be added to */ - public function __construct($title, $url, Pane $pane) + public function __construct($id, $title, $url, Pane $pane) { + $this->id = $id; $this->title = $title; $this->pane = $pane; if ($url instanceof Url) { @@ -187,14 +196,14 @@ EOD; /** * Create a @see Component instance from the given Zend config, using the provided title - * + * @param $id The id for this component * @param $title The title for this component * @param Zend_Config $config The configuration defining url, parameters, height, width, etc. * @param Pane $pane The pane this component belongs to * * @return Component A newly created Component for use in the Dashboard */ - public static function fromIni($title, Zend_Config $config, Pane $pane) + public static function fromIni($id, $title, Zend_Config $config, Pane $pane) { $height = null; $width = null; @@ -202,7 +211,27 @@ EOD; $parameters = $config->toArray(); unset($parameters['url']); // otherwise there's an url = parameter in the Url - $cmp = new Component($title, Url::fromPath($url, $parameters), $pane); + $cmp = new Component($id, $title, Url::fromPath($url, $parameters), $pane); return $cmp; } + + /** + * Set the components id + * + * @param $id string + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * Retrieve the components id + * + * @return string + */ + public function getId() + { + return $this->id; + } } diff --git a/library/Icinga/Web/Widget/Dashboard/Pane.php b/library/Icinga/Web/Widget/Dashboard/Pane.php index 39ad1fda3..edb3b6b77 100644 --- a/library/Icinga/Web/Widget/Dashboard/Pane.php +++ b/library/Icinga/Web/Widget/Dashboard/Pane.php @@ -83,44 +83,44 @@ class Pane extends AbstractWidget /** * Return true if a component with the given title exists in this pane * - * @param string $title The title of the component to check for existence + * @param string $id The id of the component to check for existence * * @return bool */ - public function hasComponent($title) + public function hasComponent($id) { - return array_key_exists($title, $this->components); + return array_key_exists($id, $this->components); } /** * Return a component with the given name if existing * - * @param string $title The title of the component to return + * @param string $id The id of the component to return * * @return Component The component with the given title * @throws ProgrammingError If the component doesn't exist */ - public function getComponent($title) + public function getComponent($id) { - if ($this->hasComponent($title)) { - return $this->components[$title]; + if ($this->hasComponent($id)) { + return $this->components[$id]; } throw new ProgrammingError( 'Trying to access invalid component: %s', - $title + $id ); } /** - * Removes the component with the given title if it exists in this pane + * Removes the component with the given id if it exists in this pane * - * @param string $title The pane + * @param string $id The pane * @return Pane $this */ - public function removeComponent($title) + public function removeComponent($id) { - if ($this->hasComponent($title)) { - unset($this->components[$title]); + if ($this->hasComponent($id)) { + unset($this->components[$id]); } return $this; } @@ -146,6 +146,7 @@ class Pane extends AbstractWidget /** * Add a component to this pane, optionally creating it if $component is a string * + * @param string $id An unique Identifier * @param string|Component $component The component object or title * (if a new component will be created) * @param string|null $url An Url to be used when component is a string @@ -153,12 +154,12 @@ class Pane extends AbstractWidget * @return self * @throws \Icinga\Exception\ConfigurationError */ - public function addComponent($component, $url = null) + public function addComponent($id, $component, $url = null) { if ($component instanceof Component) { - $this->components[$component->getTitle()] = $component; - } elseif (is_string($component) && $url !== null) { - $this->components[$component] = new Component($component, $url, $this); + $this->components[$component->getId()] = $component; + } elseif (is_string($id) && is_string($component) && $url !== null) { + $this->components[$id] = new Component($id, $component, $url, $this); } else { throw new ConfigurationError('Invalid component added: %s', $component); } @@ -175,15 +176,15 @@ class Pane extends AbstractWidget { /* @var $component Component */ foreach ($components as $component) { - if (array_key_exists($component->getTitle(), $this->components)) { - if (preg_match('/_(\d+)$/', $component->getTitle(), $m)) { - $name = preg_replace('/_\d+$/', $m[1]++, $component->getTitle()); + if (array_key_exists($component->getId(), $this->components)) { + if (preg_match('/-(\d+)$/', $component->getId(), $m)) { + $name = preg_replace('/-\d+$/', $m[1]++, $component->getId()); } else { - $name = $component->getTitle() . '_2'; + $name = $component->getId() . '-2'; } $this->components[$name] = $component; } else { - $this->components[$component->getTitle()] = $component; + $this->components[$component->getId()] = $component; } } @@ -193,17 +194,18 @@ class Pane extends AbstractWidget /** * Add a component to the current pane * + * @param $id * @param $title - * @param $url - * @return Component + * @param null $url + * @return mixed * * @see addComponent() */ - public function add($title, $url = null) + public function add($id, $title, $url = null) { - $this->addComponent($title, $url); + $this->addComponent($id, $title, $url); - return $this->components[$title]; + return $this->components[$id]; } /** diff --git a/modules/doc/configuration.php b/modules/doc/configuration.php index ce3f99113..06e900300 100644 --- a/modules/doc/configuration.php +++ b/modules/doc/configuration.php @@ -4,8 +4,7 @@ /* @var $this \Icinga\Application\Modules\Module */ -$section = $this->menuSection($this->translate('Documentation'), array( - 'title' => 'Documentation', +$section = $this->menuSection('documentation', $this->translate('Documentation'), array( 'icon' => 'img/icons/comment.png', 'url' => 'doc', 'priority' => 80 diff --git a/modules/monitoring/configuration.php b/modules/monitoring/configuration.php index 412581d24..9b12049e4 100644 --- a/modules/monitoring/configuration.php +++ b/modules/monitoring/configuration.php @@ -22,72 +22,73 @@ $this->provideConfigTab('security', array( /* * Problems Section */ -$section = $this->menuSection($this->translate('Problems'), array( +$section = $this->menuSection('problems', $this->translate('Problems'), array( 'icon' => 'img/icons/error.png', 'priority' => 20 )); -$section->add($this->translate('Unhandled Hosts'), array( +$section->add('unhandled hosts', $this->translate('Unhandled Hosts'), array( 'url' => 'monitoring/list/hosts?host_problem=1&host_handled=0', 'priority' => 40 )); -$section->add($this->translate('Unhandled Services'), array( +$section->add('unhandled services', $this->translate('Unhandled Services'), array( 'url' => 'monitoring/list/services?service_problem=1&service_handled=0&sort=service_severity', 'priority' => 40 )); -$section->add($this->translate('Host Problems'), array( +$section->add('host problems', $this->translate('Host Problems'), array( 'url' => 'monitoring/list/hosts?host_problem=1&sort=host_severity', 'priority' => 50 )); -$section->add($this->translate('Service Problems'), array( +$section->add('service prolems', $this->translate('Service Problems'), array( 'url' => 'monitoring/list/services?service_problem=1&sort=service_severity&dir=desc', 'priority' => 50 )); -$section->add($this->translate('Current Downtimes'))->setUrl('monitoring/list/downtimes?downtime_is_in_effect=1'); +$section->add('current downtimes', $this->translate('Current Downtimes')) + ->setUrl('monitoring/list/downtimes?downtime_is_in_effect=1'); /* * Overview Section */ -$section = $this->menuSection($this->translate('Overview'), array( +$section = $this->menuSection('overview', $this->translate('Overview'), array( 'icon' => 'img/icons/hostgroup.png', 'priority' => 30 )); -$section->add($this->translate('Tactical Overview'), array( +$section->add('tactical overview', $this->translate('Tactical Overview'), array( 'url' => 'monitoring/tactical', 'priority' => 40 )); -$section->add($this->translate('Hosts'), array( +$section->add('hosts', $this->translate('Hosts'), array( 'url' => 'monitoring/list/hosts', 'priority' => 50 )); -$section->add($this->translate('Services'), array( +$section->add('services', $this->translate('Services'), array( 'url' => 'monitoring/list/services', 'priority' => 50 )); -$section->add($this->translate('Servicematrix'), array( +$section->add('servicematrix', $this->translate('Servicematrix'), array( 'url' => 'monitoring/list/servicematrix?service_problem=1', 'priority' => 51 )); -$section->add($this->translate('Servicegroups'), array( +$section->add('servicegroups', $this->translate('Servicegroups'), array( 'url' => 'monitoring/list/servicegroups', 'priority' => 60 )); -$section->add($this->translate('Hostgroups'), array( +$section->add('hostgroups', $this->translate('Hostgroups'), array( 'url' => 'monitoring/list/hostgroups', 'priority' => 60 )); -$section->add($this->translate('Contactgroups'), array( +$section->add('contactgroups', $this->translate('Contactgroups'), array( 'url' => 'monitoring/list/contactgroups', 'priority' => 61 )); -$section->add($this->translate('Downtimes'), array( +$section->add('downtimes', $this->translate('Downtimes'), array( 'url' => 'monitoring/list/downtimes', 'priority' => 71 )); -$section->add($this->translate('Comments'), array( +$section->add('comments', $this->translate('Comments'), array( 'url' => 'monitoring/list/comments?comment_type=(comment|ack)', 'priority' => 70 )); -$section->add($this->translate('Contacts'), array( +$section->add('contacts', $this->translate('Contacts'), array( 'url' => 'monitoring/list/contacts', 'priority' => 70 )); @@ -95,31 +96,33 @@ $section->add($this->translate('Contacts'), array( /* * History Section */ -$section = $this->menuSection($this->translate('History'), array( +$section = $this->menuSection('history', $this->translate('History'), array( + 'title' => $this->translate('History'), 'icon' => 'img/icons/history.png' )); -$section->add($this->translate('Critical Events'), array( +$section->add('critical events', $this->translate('Critical Events'), array( + 'title' => $this->translate('Critical Events'), 'url' => 'monitoring/list/statehistorysummary', 'priority' => 50 )); -$section->add($this->translate('Notifications'), array( +$section->add('notifications', $this->translate('Notifications'), array( 'url' => 'monitoring/list/notifications' )); -$section->add($this->translate('Events'), array( +$section->add('events', $this->translate('Events'), array( 'title' => $this->translate('All Events'), 'url' => 'monitoring/list/eventhistory?timestamp>=-7%20days' )); -$section->add($this->translate('Timeline'))->setUrl('monitoring/timeline'); +$section->add('timeline', $this->translate('Timeline'))->setUrl('monitoring/timeline'); /* * System Section */ -$section = $this->menuSection($this->translate('System')); -$section->add($this->translate('Process Info'), array( +$section = $this->menuSection('system', $this->translate('System')); +$section->add('process info', $this->translate('Process Info'), array( 'url' => 'monitoring/process/info', 'priority' => 120 )); -$section->add($this->translate('Performance Info'), array( +$section->add('performance info', $this->translate('Performance Info'), array( 'url' => 'monitoring/process/performance', 'priority' => 130 )); @@ -127,16 +130,19 @@ $section->add($this->translate('Performance Info'), array( /* * Dashboard */ -$dashboard = $this->dashboard($this->translate('Current Incidents')); +$dashboard = $this->dashboard('current-incidents', $this->translate('Current Incidents')); $dashboard->add( + 'service problems', $this->translate('Service Problems'), 'monitoring/list/services?service_problem=1&limit=10&sort=service_severity' ); $dashboard->add( + 'recently recovered services', $this->translate('Recently Recovered Services'), 'monitoring/list/services?service_state=0&limit=10&sort=service_last_state_change&dir=desc' ); $dashboard->add( + 'host problems', $this->translate('Host Problems'), 'monitoring/list/hosts?host_problem=1&sort=host_severity' ); From 66031ed6bf733896c72e070719d4f585dc54988d Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 27 Aug 2014 15:02:46 +0200 Subject: [PATCH 047/257] Use Source instead of Source0 in the spec file refs #6401 --- icingaweb2.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icingaweb2.spec b/icingaweb2.spec index 270e18fff..5d5b9ec9c 100644 --- a/icingaweb2.spec +++ b/icingaweb2.spec @@ -83,7 +83,7 @@ BuildArch: noarch AutoReqProv: Off %endif -Source0: icingaweb2-%{version}.tar.gz +Source: icingaweb2-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root From 968fa36cfd5123137b2d8189b3df723974c6a46d Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Wed, 27 Aug 2014 15:02:23 +0200 Subject: [PATCH 048/257] Fixes dashboard title configuration fixes #7011 --- modules/monitoring/configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/configuration.php b/modules/monitoring/configuration.php index 9b12049e4..ed5251ec1 100644 --- a/modules/monitoring/configuration.php +++ b/modules/monitoring/configuration.php @@ -130,7 +130,7 @@ $section->add('performance info', $this->translate('Performance Info'), array( /* * Dashboard */ -$dashboard = $this->dashboard('current-incidents', $this->translate('Current Incidents')); +$dashboard = $this->dashboard('current incidents')->setTitle($this->translate('Current Incidents')); $dashboard->add( 'service problems', $this->translate('Service Problems'), From 7ff51caed0ad1a1db9940605024778c80499e685 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 27 Aug 2014 15:51:49 +0200 Subject: [PATCH 049/257] Remove leading backslashes from the targets of use statements - use \Exception; + use Exception; --- .../controllers/DashboardController.php | 2 +- application/controllers/StaticController.php | 2 +- .../Config/Authentication/BaseBackendForm.php | 4 ++-- .../Config/Authentication/DbBackendForm.php | 4 ++-- .../Config/Authentication/LdapBackendForm.php | 4 ++-- .../Config/Authentication/ReorderForm.php | 2 +- application/forms/Config/LoggingForm.php | 2 +- application/forms/Preference/GeneralForm.php | 18 +++++++++--------- application/views/helpers/FormDateTime.php | 2 +- .../views/helpers/FormTriStateCheckbox.php | 2 +- library/Icinga/Application/functions.php | 2 +- library/Icinga/Chart/Primitive/Rect.php | 4 ++-- .../Commandpipe/Transport/Transport.php | 2 +- library/Icinga/Protocol/Ldap/Connection.php | 2 +- .../Statusdat/View/MonitoringObjectList.php | 8 ++++---- .../User/Preferences/PreferencesStore.php | 2 +- .../Web/Form/Decorator/ConditionalHidden.php | 2 +- .../Icinga/Web/Form/Element/DateTimePicker.php | 6 +++--- .../Web/Form/Element/TriStateCheckbox.php | 4 ++-- .../Web/Form/Validator/DateFormatValidator.php | 2 +- .../Web/Form/Validator/DateTimeValidator.php | 6 +++--- .../Web/Form/Validator/TimeFormatValidator.php | 2 +- .../Web/Form/Validator/TriStateValidator.php | 2 +- .../Form/Validator/WritablePathValidator.php | 4 ++-- library/Icinga/Web/Hook/TopBarHook.php | 4 ++-- .../Icinga/Web/Session/SessionNamespace.php | 6 +++--- .../controllers/IcingawebController.php | 2 +- .../controllers/ModuleController.php | 2 +- .../controllers/ConfigController.php | 2 +- .../controllers/MonitoringCommands.php | 2 +- .../controllers/TimelineController.php | 6 +++--- .../forms/Command/AcknowledgeForm.php | 8 ++++---- .../forms/Command/MultiCommandFlagForm.php | 8 ++++---- .../Command/SingleArgumentCommandForm.php | 2 +- .../Command/SubmitPassiveCheckResultForm.php | 2 +- .../forms/Config/Backend/CreateBackendForm.php | 2 +- .../Config/Instance/CreateInstanceForm.php | 4 ++-- .../forms/Config/Instance/EditInstanceForm.php | 4 ++-- modules/monitoring/bin/action/list.inc.php | 2 +- .../Backend/Ido/Query/StatusSummaryQuery.php | 2 +- .../Exception/UnsupportedBackendException.php | 2 +- .../library/Monitoring/Timeline/TimeEntry.php | 2 +- .../library/Monitoring/Timeline/TimeLine.php | 8 ++++---- .../views/helpers/MonitoringFlagsTest.php | 2 +- .../views/helpers/MonitoringPropertiesTest.php | 2 +- .../views/helpers/ResolveMacrosTest.php | 4 ++-- .../Translation/Cli/TranslationCommand.php | 2 +- .../Config/Authentication/ReorderFormTest.php | 4 ++-- .../library/Icinga/Application/ConfigTest.php | 2 +- .../library/Icinga/Chart/GraphChartTest.php | 4 ++-- test/php/library/Icinga/Chart/PieChartTest.php | 4 ++-- .../Protocol/Commandpipe/CommandPipeTest.php | 2 +- .../library/Icinga/Protocol/Ldap/QueryTest.php | 2 +- 53 files changed, 94 insertions(+), 94 deletions(-) diff --git a/application/controllers/DashboardController.php b/application/controllers/DashboardController.php index 108117959..dc48dd7f3 100644 --- a/application/controllers/DashboardController.php +++ b/application/controllers/DashboardController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Zend_Config; +use Zend_Config; use Icinga\Web\Url; use Icinga\Logger\Logger; use Icinga\Config\PreservingIniWriter; diff --git a/application/controllers/StaticController.php b/application/controllers/StaticController.php index 3a15b1b1e..51b5fdb62 100644 --- a/application/controllers/StaticController.php +++ b/application/controllers/StaticController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Zend_Controller_Action_Exception as ActionException; +use Zend_Controller_Action_Exception as ActionException; use Icinga\Web\Controller\ActionController; use Icinga\Application\Icinga; use Icinga\Logger\Logger; diff --git a/application/forms/Config/Authentication/BaseBackendForm.php b/application/forms/Config/Authentication/BaseBackendForm.php index 7a34f236a..f670b25c1 100644 --- a/application/forms/Config/Authentication/BaseBackendForm.php +++ b/application/forms/Config/Authentication/BaseBackendForm.php @@ -4,8 +4,8 @@ namespace Icinga\Form\Config\Authentication; -use \Zend_Config; -use \Zend_Form_Element_Checkbox; +use Zend_Config; +use Zend_Form_Element_Checkbox; use Icinga\Web\Form; use Icinga\Data\ResourceFactory; use Icinga\Web\Form\Decorator\HelpText; diff --git a/application/forms/Config/Authentication/DbBackendForm.php b/application/forms/Config/Authentication/DbBackendForm.php index 2c57b82e2..82594280b 100644 --- a/application/forms/Config/Authentication/DbBackendForm.php +++ b/application/forms/Config/Authentication/DbBackendForm.php @@ -4,8 +4,8 @@ namespace Icinga\Form\Config\Authentication; -use \Exception; -use \Zend_Config; +use Exception; +use Zend_Config; use Icinga\Data\ResourceFactory; use Icinga\Authentication\DbConnection; use Icinga\Authentication\Backend\DbUserBackend; diff --git a/application/forms/Config/Authentication/LdapBackendForm.php b/application/forms/Config/Authentication/LdapBackendForm.php index ee90fa95c..89f446795 100644 --- a/application/forms/Config/Authentication/LdapBackendForm.php +++ b/application/forms/Config/Authentication/LdapBackendForm.php @@ -4,8 +4,8 @@ namespace Icinga\Form\Config\Authentication; -use \Exception; -use \Zend_Config; +use Exception; +use Zend_Config; use Icinga\Web\Form; use Icinga\Data\ResourceFactory; use Icinga\Authentication\Backend\LdapUserBackend; diff --git a/application/forms/Config/Authentication/ReorderForm.php b/application/forms/Config/Authentication/ReorderForm.php index a074febea..b4c3cd9b7 100644 --- a/application/forms/Config/Authentication/ReorderForm.php +++ b/application/forms/Config/Authentication/ReorderForm.php @@ -4,7 +4,7 @@ namespace Icinga\Form\Config\Authentication; -use \Zend_Config; +use Zend_Config; use Icinga\Web\Form; /** diff --git a/application/forms/Config/LoggingForm.php b/application/forms/Config/LoggingForm.php index b3b4089c8..1fcb30fa5 100644 --- a/application/forms/Config/LoggingForm.php +++ b/application/forms/Config/LoggingForm.php @@ -4,7 +4,7 @@ namespace Icinga\Form\Config; -use \Zend_Config; +use Zend_Config; use Icinga\Web\Form; use Icinga\Application\Icinga; use Icinga\Web\Form\Validator\WritablePathValidator; diff --git a/application/forms/Preference/GeneralForm.php b/application/forms/Preference/GeneralForm.php index 204ddc51d..5b9a1b95f 100644 --- a/application/forms/Preference/GeneralForm.php +++ b/application/forms/Preference/GeneralForm.php @@ -4,15 +4,15 @@ namespace Icinga\Form\Preference; -use \DateTimeZone; -use \Zend_Config; -use \Zend_Form_Element_Text; -use \Zend_Form_Element_Select; -use \Zend_View_Helper_DateFormat; -use \Icinga\Web\Form; -use \Icinga\Web\Form\Validator\TimeFormatValidator; -use \Icinga\Web\Form\Validator\DateFormatValidator; -use \Icinga\Util\Translator; +use DateTimeZone; +use Zend_Config; +use Zend_Form_Element_Text; +use Zend_Form_Element_Select; +use Zend_View_Helper_DateFormat; +use Icinga\Web\Form; +use Icinga\Web\Form\Validator\TimeFormatValidator; +use Icinga\Web\Form\Validator\DateFormatValidator; +use Icinga\Util\Translator; /** * General user preferences diff --git a/application/views/helpers/FormDateTime.php b/application/views/helpers/FormDateTime.php index 07d5fb930..19a9cc3c5 100644 --- a/application/views/helpers/FormDateTime.php +++ b/application/views/helpers/FormDateTime.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Zend_View_Helper_FormElement; +use Zend_View_Helper_FormElement; /** * Helper to generate a "datetime" element diff --git a/application/views/helpers/FormTriStateCheckbox.php b/application/views/helpers/FormTriStateCheckbox.php index 695c9af56..b69114a11 100644 --- a/application/views/helpers/FormTriStateCheckbox.php +++ b/application/views/helpers/FormTriStateCheckbox.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Zend_View_Helper_FormElement; +use Zend_View_Helper_FormElement; /** * Helper to generate a "datetime" element diff --git a/library/Icinga/Application/functions.php b/library/Icinga/Application/functions.php index cfa5620ba..422dfeab7 100644 --- a/library/Icinga/Application/functions.php +++ b/library/Icinga/Application/functions.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Icinga\Util\Translator; +use Icinga\Util\Translator; if (extension_loaded('gettext')) { function t($messageId) diff --git a/library/Icinga/Chart/Primitive/Rect.php b/library/Icinga/Chart/Primitive/Rect.php index 36b63912f..fc389e204 100644 --- a/library/Icinga/Chart/Primitive/Rect.php +++ b/library/Icinga/Chart/Primitive/Rect.php @@ -4,8 +4,8 @@ namespace Icinga\Chart\Primitive; -use \DomElement; -use \Icinga\Chart\Render\RenderContext; +use DomElement; +use Icinga\Chart\Render\RenderContext; use Icinga\Chart\Format; /** diff --git a/library/Icinga/Protocol/Commandpipe/Transport/Transport.php b/library/Icinga/Protocol/Commandpipe/Transport/Transport.php index c5a5b3883..59119cf13 100644 --- a/library/Icinga/Protocol/Commandpipe/Transport/Transport.php +++ b/library/Icinga/Protocol/Commandpipe/Transport/Transport.php @@ -4,7 +4,7 @@ namespace Icinga\Protocol\Commandpipe\Transport; -use \Zend_Config; +use Zend_Config; /** * Interface for Transport classes handling the concrete access to the command pipe diff --git a/library/Icinga/Protocol/Ldap/Connection.php b/library/Icinga/Protocol/Ldap/Connection.php index edd99d021..531a399c8 100644 --- a/library/Icinga/Protocol/Ldap/Connection.php +++ b/library/Icinga/Protocol/Ldap/Connection.php @@ -8,7 +8,7 @@ use Icinga\Protocol\Ldap\Exception as LdapException; use Icinga\Application\Platform; use Icinga\Application\Config; use Icinga\Logger\Logger; -use \Zend_Config; +use Zend_Config; /** * Backend class managing all the LDAP stuff for you. diff --git a/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php b/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php index 8c6fdf0bc..e9a7e1bc9 100644 --- a/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php +++ b/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php @@ -4,10 +4,10 @@ namespace Icinga\Protocol\Statusdat\View; -use \Iterator; -use \Countable; -use \ArrayAccess; -use \Exception; +use Iterator; +use Countable; +use ArrayAccess; +use Exception; /** * Wrapper around an array of monitoring objects that can be enhanced with an optional diff --git a/library/Icinga/User/Preferences/PreferencesStore.php b/library/Icinga/User/Preferences/PreferencesStore.php index 749d054dc..b8121eb25 100644 --- a/library/Icinga/User/Preferences/PreferencesStore.php +++ b/library/Icinga/User/Preferences/PreferencesStore.php @@ -4,7 +4,7 @@ namespace Icinga\User\Preferences; -use \Zend_Config; +use Zend_Config; use Icinga\User; use Icinga\User\Preferences; use Icinga\Data\ResourceFactory; diff --git a/library/Icinga/Web/Form/Decorator/ConditionalHidden.php b/library/Icinga/Web/Form/Decorator/ConditionalHidden.php index 5d29caee4..c24f637ba 100644 --- a/library/Icinga/Web/Form/Decorator/ConditionalHidden.php +++ b/library/Icinga/Web/Form/Decorator/ConditionalHidden.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Form\Decorator; -use \Zend_Form_Decorator_Abstract; +use Zend_Form_Decorator_Abstract; /** * Decorator to hide elements using a >noscript< tag instead of diff --git a/library/Icinga/Web/Form/Element/DateTimePicker.php b/library/Icinga/Web/Form/Element/DateTimePicker.php index 911e26322..dd48bd7f2 100644 --- a/library/Icinga/Web/Form/Element/DateTimePicker.php +++ b/library/Icinga/Web/Form/Element/DateTimePicker.php @@ -5,9 +5,9 @@ namespace Icinga\Web\Form\Element; use Icinga\Web\Form\Validator\DateTimeValidator; -use \Zend_Form_Element_Text; -use \Zend_Form_Element; -use \Icinga\Util\DateTimeFactory; +use Zend_Form_Element_Text; +use Zend_Form_Element; +use Icinga\Util\DateTimeFactory; /** * Datetime form element which returns the input as Unix timestamp after the input has been proven valid. Utilizes diff --git a/library/Icinga/Web/Form/Element/TriStateCheckbox.php b/library/Icinga/Web/Form/Element/TriStateCheckbox.php index fb6ffb692..45763880d 100644 --- a/library/Icinga/Web/Form/Element/TriStateCheckbox.php +++ b/library/Icinga/Web/Form/Element/TriStateCheckbox.php @@ -4,8 +4,8 @@ namespace Icinga\Web\Form\Element; -use \Icinga\Web\Form\Validator\TriStateValidator; -use \Zend_Form_Element_Xhtml; +use Icinga\Web\Form\Validator\TriStateValidator; +use Zend_Form_Element_Xhtml; /** * A checkbox that can display three different states: diff --git a/library/Icinga/Web/Form/Validator/DateFormatValidator.php b/library/Icinga/Web/Form/Validator/DateFormatValidator.php index 2b2a413fd..b11629cbf 100644 --- a/library/Icinga/Web/Form/Validator/DateFormatValidator.php +++ b/library/Icinga/Web/Form/Validator/DateFormatValidator.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Form\Validator; -use \Zend_Validate_Abstract; +use Zend_Validate_Abstract; /** * Validator that checks if a textfield contains a correct date format diff --git a/library/Icinga/Web/Form/Validator/DateTimeValidator.php b/library/Icinga/Web/Form/Validator/DateTimeValidator.php index 952ac6c86..f1952f7d4 100644 --- a/library/Icinga/Web/Form/Validator/DateTimeValidator.php +++ b/library/Icinga/Web/Form/Validator/DateTimeValidator.php @@ -4,9 +4,9 @@ namespace Icinga\Web\Form\Validator; -use \Icinga\Util\DateTimeFactory; -use \Zend_Validate_Abstract; -use \Icinga\Exception\ProgrammingError; +use Icinga\Util\DateTimeFactory; +use Zend_Validate_Abstract; +use Icinga\Exception\ProgrammingError; /** * Validator that checks if a textfield contains a correct date format diff --git a/library/Icinga/Web/Form/Validator/TimeFormatValidator.php b/library/Icinga/Web/Form/Validator/TimeFormatValidator.php index 1715f7fdb..a02581cfa 100644 --- a/library/Icinga/Web/Form/Validator/TimeFormatValidator.php +++ b/library/Icinga/Web/Form/Validator/TimeFormatValidator.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Form\Validator; -use \Zend_Validate_Abstract; +use Zend_Validate_Abstract; /** * Validator that checks if a textfield contains a correct time format diff --git a/library/Icinga/Web/Form/Validator/TriStateValidator.php b/library/Icinga/Web/Form/Validator/TriStateValidator.php index f05f35b27..e51e00e21 100644 --- a/library/Icinga/Web/Form/Validator/TriStateValidator.php +++ b/library/Icinga/Web/Form/Validator/TriStateValidator.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Form\Validator; -use \Zend_Validate_Abstract; +use Zend_Validate_Abstract; class TriStateValidator extends Zend_Validate_Abstract { diff --git a/library/Icinga/Web/Form/Validator/WritablePathValidator.php b/library/Icinga/Web/Form/Validator/WritablePathValidator.php index 1381da9c7..8387c5cf5 100644 --- a/library/Icinga/Web/Form/Validator/WritablePathValidator.php +++ b/library/Icinga/Web/Form/Validator/WritablePathValidator.php @@ -4,8 +4,8 @@ namespace Icinga\Web\Form\Validator; -use \Zend_Validate_Abstract; -use \Icinga\Application\Config as IcingaConfig; +use Zend_Validate_Abstract; +use Icinga\Application\Config as IcingaConfig; /** * Validator that interprets the value as a path and checks if it's writable diff --git a/library/Icinga/Web/Hook/TopBarHook.php b/library/Icinga/Web/Hook/TopBarHook.php index 867b4f721..183a0ca07 100644 --- a/library/Icinga/Web/Hook/TopBarHook.php +++ b/library/Icinga/Web/Hook/TopBarHook.php @@ -4,8 +4,8 @@ namespace Icinga\Web\Hook; -use \Icinga\Web\Request; -use \Zend_View; +use Icinga\Web\Request; +use Zend_View; /** * Hook to extend topbar items diff --git a/library/Icinga/Web/Session/SessionNamespace.php b/library/Icinga/Web/Session/SessionNamespace.php index 8862d343f..682991aed 100644 --- a/library/Icinga/Web/Session/SessionNamespace.php +++ b/library/Icinga/Web/Session/SessionNamespace.php @@ -4,9 +4,9 @@ namespace Icinga\Web\Session; -use \Exception; -use \ArrayIterator; -use \IteratorAggregate; +use Exception; +use ArrayIterator; +use IteratorAggregate; /** * Container for session values diff --git a/modules/doc/application/controllers/IcingawebController.php b/modules/doc/application/controllers/IcingawebController.php index 967a2b768..ecbe3a6ee 100644 --- a/modules/doc/application/controllers/IcingawebController.php +++ b/modules/doc/application/controllers/IcingawebController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Zend_Controller_Action_Exception; +use Zend_Controller_Action_Exception; use Icinga\Application\Icinga; use Icinga\Module\Doc\DocController; diff --git a/modules/doc/application/controllers/ModuleController.php b/modules/doc/application/controllers/ModuleController.php index 40913368c..fa6c69d19 100644 --- a/modules/doc/application/controllers/ModuleController.php +++ b/modules/doc/application/controllers/ModuleController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Zend_Controller_Action_Exception; +use Zend_Controller_Action_Exception; use Icinga\Application\Icinga; use Icinga\Module\Doc\DocController; use Icinga\Module\Doc\Exception\DocException; diff --git a/modules/monitoring/application/controllers/ConfigController.php b/modules/monitoring/application/controllers/ConfigController.php index f0982c29a..f0322dc3f 100644 --- a/modules/monitoring/application/controllers/ConfigController.php +++ b/modules/monitoring/application/controllers/ConfigController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Exception; +use Exception; use Icinga\Config\PreservingIniWriter; use Icinga\Web\Controller\ModuleActionController; diff --git a/modules/monitoring/application/controllers/MonitoringCommands.php b/modules/monitoring/application/controllers/MonitoringCommands.php index faa04114e..16b713d4c 100644 --- a/modules/monitoring/application/controllers/MonitoringCommands.php +++ b/modules/monitoring/application/controllers/MonitoringCommands.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Icinga\Module\Monitoring\Command\Meta; +use Icinga\Module\Monitoring\Command\Meta; /** * Class MonitoringCommands diff --git a/modules/monitoring/application/controllers/TimelineController.php b/modules/monitoring/application/controllers/TimelineController.php index 3fa621f3e..2f9b1339d 100644 --- a/modules/monitoring/application/controllers/TimelineController.php +++ b/modules/monitoring/application/controllers/TimelineController.php @@ -2,9 +2,9 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \DateTime; -use \DateInterval; -use \Zend_Config; +use DateTime; +use DateInterval; +use Zend_Config; use Icinga\Web\Url; use Icinga\Util\Format; use Icinga\Application\Config; diff --git a/modules/monitoring/application/forms/Command/AcknowledgeForm.php b/modules/monitoring/application/forms/Command/AcknowledgeForm.php index 364c3c20a..4ac4901b0 100644 --- a/modules/monitoring/application/forms/Command/AcknowledgeForm.php +++ b/modules/monitoring/application/forms/Command/AcknowledgeForm.php @@ -4,10 +4,10 @@ namespace Icinga\Module\Monitoring\Form\Command; -use \Icinga\Web\Form\Element\DateTimePicker; -use \Icinga\Protocol\Commandpipe\Comment; -use \Icinga\Util\DateTimeFactory; -use \Icinga\Module\Monitoring\Command\AcknowledgeCommand; +use Icinga\Web\Form\Element\DateTimePicker; +use Icinga\Protocol\Commandpipe\Comment; +use Icinga\Util\DateTimeFactory; +use Icinga\Module\Monitoring\Command\AcknowledgeCommand; /** * Form for problem acknowledgements diff --git a/modules/monitoring/application/forms/Command/MultiCommandFlagForm.php b/modules/monitoring/application/forms/Command/MultiCommandFlagForm.php index 6d49580a0..e413848c8 100644 --- a/modules/monitoring/application/forms/Command/MultiCommandFlagForm.php +++ b/modules/monitoring/application/forms/Command/MultiCommandFlagForm.php @@ -4,10 +4,10 @@ namespace Icinga\Module\Monitoring\Form\Command; -use \Icinga\Web\Form\Element\TriStateCheckbox; -use \Icinga\Web\Form; -use \Zend_Form_Element_Hidden; -use \Zend_Form; +use Icinga\Web\Form\Element\TriStateCheckbox; +use Icinga\Web\Form; +use Zend_Form_Element_Hidden; +use Zend_Form; /** * A form to edit multiple command flags of multiple commands at once. When some commands have diff --git a/modules/monitoring/application/forms/Command/SingleArgumentCommandForm.php b/modules/monitoring/application/forms/Command/SingleArgumentCommandForm.php index 7333ccdac..d7228ebdf 100644 --- a/modules/monitoring/application/forms/Command/SingleArgumentCommandForm.php +++ b/modules/monitoring/application/forms/Command/SingleArgumentCommandForm.php @@ -5,7 +5,7 @@ namespace Icinga\Module\Monitoring\Form\Command; use Zend_Controller_Request_Abstract; -use \Zend_Form_Element_Hidden; +use Zend_Form_Element_Hidden; use Icinga\Module\Monitoring\Command\AcknowledgeCommand; use Icinga\Module\Monitoring\Command\SingleArgumentCommand; diff --git a/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php b/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php index de2965565..c2c9151f3 100644 --- a/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php +++ b/modules/monitoring/application/forms/Command/SubmitPassiveCheckResultForm.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Form\Command; -use \Icinga\Exception\ProgrammingError; +use Icinga\Exception\ProgrammingError; /** * Form for submitting passive check results diff --git a/modules/monitoring/application/forms/Config/Backend/CreateBackendForm.php b/modules/monitoring/application/forms/Config/Backend/CreateBackendForm.php index 513dea238..6acc210ae 100644 --- a/modules/monitoring/application/forms/Config/Backend/CreateBackendForm.php +++ b/modules/monitoring/application/forms/Config/Backend/CreateBackendForm.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Form\Config\Backend; -use \Zend_Config; +use Zend_Config; /** * Extended EditBackendForm for creating new Backends diff --git a/modules/monitoring/application/forms/Config/Instance/CreateInstanceForm.php b/modules/monitoring/application/forms/Config/Instance/CreateInstanceForm.php index 705804bb9..077e02183 100644 --- a/modules/monitoring/application/forms/Config/Instance/CreateInstanceForm.php +++ b/modules/monitoring/application/forms/Config/Instance/CreateInstanceForm.php @@ -4,8 +4,8 @@ namespace Icinga\Module\Monitoring\Form\Config\Instance; -use \Icinga\Web\Form; -use \Zend_Config; +use Icinga\Web\Form; +use Zend_Config; /** * Form for creating new instances diff --git a/modules/monitoring/application/forms/Config/Instance/EditInstanceForm.php b/modules/monitoring/application/forms/Config/Instance/EditInstanceForm.php index e2a091c0f..f74b091df 100644 --- a/modules/monitoring/application/forms/Config/Instance/EditInstanceForm.php +++ b/modules/monitoring/application/forms/Config/Instance/EditInstanceForm.php @@ -4,8 +4,8 @@ namespace Icinga\Module\Monitoring\Form\Config\Instance; -use \Zend_Config; -use \Icinga\Web\Form; +use Zend_Config; +use Icinga\Web\Form; /** * Form for editing existing instances diff --git a/modules/monitoring/bin/action/list.inc.php b/modules/monitoring/bin/action/list.inc.php index 65a0ca61d..01fd35131 100644 --- a/modules/monitoring/bin/action/list.inc.php +++ b/modules/monitoring/bin/action/list.inc.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Icinga\Module\Monitoring\Backend; +use Icinga\Module\Monitoring\Backend; use Icinga\Util\Format; $backend = Backend::getInstance($params->shift('backend')); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php index ce61c8f1b..75db67b55 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Backend\Ido\Query; -use \Zend_Db_Select; +use Zend_Db_Select; class StatusSummaryQuery extends IdoQuery { diff --git a/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php b/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php index b0cd1b445..3e1468e36 100644 --- a/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php +++ b/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Exception; -use \Exception; +use Exception; class UnsupportedBackendException extends Exception { diff --git a/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php b/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php index 615999bdb..bd83a42cd 100644 --- a/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php +++ b/modules/monitoring/library/Monitoring/Timeline/TimeEntry.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Monitoring\Timeline; -use \DateTime; +use DateTime; use Icinga\Web\Url; use Icinga\Exception\ProgrammingError; diff --git a/modules/monitoring/library/Monitoring/Timeline/TimeLine.php b/modules/monitoring/library/Monitoring/Timeline/TimeLine.php index fa5af9141..2b0158bf1 100644 --- a/modules/monitoring/library/Monitoring/Timeline/TimeLine.php +++ b/modules/monitoring/library/Monitoring/Timeline/TimeLine.php @@ -4,10 +4,10 @@ namespace Icinga\Module\Monitoring\Timeline; -use \DateTime; -use \Exception; -use \ArrayIterator; -use \IteratorAggregate; +use DateTime; +use Exception; +use ArrayIterator; +use IteratorAggregate; use Icinga\Data\Filter\Filter; use Icinga\Web\Hook; use Icinga\Web\Session; diff --git a/modules/monitoring/test/php/application/views/helpers/MonitoringFlagsTest.php b/modules/monitoring/test/php/application/views/helpers/MonitoringFlagsTest.php index 961aefca5..f50b07893 100644 --- a/modules/monitoring/test/php/application/views/helpers/MonitoringFlagsTest.php +++ b/modules/monitoring/test/php/application/views/helpers/MonitoringFlagsTest.php @@ -4,7 +4,7 @@ namespace Tests\Icinga\Module\Monitoring\Application\Views\Helpers; -use \Zend_View_Helper_MonitoringFlags; +use Zend_View_Helper_MonitoringFlags; use Icinga\Test\BaseTestCase; require_once realpath(BaseTestCase::$moduleDir . '/monitoring/application/views/helpers/MonitoringFlags.php'); diff --git a/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php b/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php index aa13df35e..5a476aaef 100644 --- a/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php +++ b/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php @@ -4,7 +4,7 @@ namespace Test\Modules\Monitoring\Application\Views\Helpers; -use \Zend_View_Helper_MonitoringProperties; +use Zend_View_Helper_MonitoringProperties; use Icinga\Test\BaseTestCase; require_once realpath(BaseTestCase::$moduleDir . '/monitoring/application/views/helpers/MonitoringProperties.php'); diff --git a/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php b/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php index 374578947..a14f64ae7 100644 --- a/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php +++ b/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php @@ -4,8 +4,8 @@ namespace Tests\Icinga\Modules\Monitoring\Application\Views\Helpers; -use \Mockery; -use \Zend_View_Helper_ResolveMacros; +use Mockery; +use Zend_View_Helper_ResolveMacros; use Icinga\Test\BaseTestCase; require_once realpath(BaseTestCase::$moduleDir . '/monitoring/application/views/helpers/ResolveMacros.php'); diff --git a/modules/translation/library/Translation/Cli/TranslationCommand.php b/modules/translation/library/Translation/Cli/TranslationCommand.php index 417d9d6ed..b3cfc6de4 100644 --- a/modules/translation/library/Translation/Cli/TranslationCommand.php +++ b/modules/translation/library/Translation/Cli/TranslationCommand.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Translation\Cli; -use \Exception; +use Exception; use Icinga\Cli\Command; /** diff --git a/test/php/application/forms/Config/Authentication/ReorderFormTest.php b/test/php/application/forms/Config/Authentication/ReorderFormTest.php index a61efc48a..808806f1a 100644 --- a/test/php/application/forms/Config/Authentication/ReorderFormTest.php +++ b/test/php/application/forms/Config/Authentication/ReorderFormTest.php @@ -4,8 +4,8 @@ namespace Tests\Icinga\Form\Config\Authentication; -use \Mockery; -use \Zend_Config; +use Mockery; +use Zend_Config; use Icinga\Test\BaseTestCase; use Icinga\Form\Config\Authentication\ReorderForm; diff --git a/test/php/library/Icinga/Application/ConfigTest.php b/test/php/library/Icinga/Application/ConfigTest.php index bc39afecd..e99b17b2e 100644 --- a/test/php/library/Icinga/Application/ConfigTest.php +++ b/test/php/library/Icinga/Application/ConfigTest.php @@ -5,7 +5,7 @@ namespace Tests\Icinga\Application; use Icinga\Test\BaseTestCase; -use \Icinga\Application\Config as IcingaConfig; +use Icinga\Application\Config as IcingaConfig; class ConfigTest extends BaseTestCase { diff --git a/test/php/library/Icinga/Chart/GraphChartTest.php b/test/php/library/Icinga/Chart/GraphChartTest.php index 25870791a..6a7f73864 100644 --- a/test/php/library/Icinga/Chart/GraphChartTest.php +++ b/test/php/library/Icinga/Chart/GraphChartTest.php @@ -4,8 +4,8 @@ namespace Tests\Icinga\Chart; -use \DOMXPath; -use \DOMDocument; +use DOMXPath; +use DOMDocument; use Icinga\Chart\GridChart; use Icinga\Test\BaseTestCase; diff --git a/test/php/library/Icinga/Chart/PieChartTest.php b/test/php/library/Icinga/Chart/PieChartTest.php index c09f29e57..756fdf6e6 100644 --- a/test/php/library/Icinga/Chart/PieChartTest.php +++ b/test/php/library/Icinga/Chart/PieChartTest.php @@ -4,8 +4,8 @@ namespace Tests\Icinga\Chart; -use \DOMXPath; -use \DOMDocument; +use DOMXPath; +use DOMDocument; use Icinga\Chart\PieChart; use Icinga\Test\BaseTestCase; diff --git a/test/php/library/Icinga/Protocol/Commandpipe/CommandPipeTest.php b/test/php/library/Icinga/Protocol/Commandpipe/CommandPipeTest.php index 0ec9a4da6..7d3fd94f6 100644 --- a/test/php/library/Icinga/Protocol/Commandpipe/CommandPipeTest.php +++ b/test/php/library/Icinga/Protocol/Commandpipe/CommandPipeTest.php @@ -4,7 +4,7 @@ namespace Tests\Icinga\Protocol\Commandpipe; -use \Zend_Config; +use Zend_Config; use Icinga\Test\BaseTestCase; use Icinga\Protocol\Commandpipe\Comment; use Icinga\Protocol\Commandpipe\CommandPipe; diff --git a/test/php/library/Icinga/Protocol/Ldap/QueryTest.php b/test/php/library/Icinga/Protocol/Ldap/QueryTest.php index 0fa155202..b710a0934 100644 --- a/test/php/library/Icinga/Protocol/Ldap/QueryTest.php +++ b/test/php/library/Icinga/Protocol/Ldap/QueryTest.php @@ -4,7 +4,7 @@ namespace Tests\Icinga\Protocol\Ldap; -use \Zend_Config; +use Zend_Config; use Icinga\Test\BaseTestCase; use Icinga\Protocol\Ldap\Connection; From 45638b218c04a984a2dce9b33a2a519d5492e81c Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 27 Aug 2014 16:03:15 +0200 Subject: [PATCH 050/257] Throw IcingaException rather than Exception fixes #7014 --- application/clicommands/WebCommand.php | 12 +-- .../controllers/DashboardController.php | 3 +- .../Config/Authentication/LdapBackendForm.php | 2 +- .../Application/ApplicationBootstrap.php | 7 +- library/Icinga/Application/Modules/Module.php | 11 ++- .../Authentication/Backend/DbUserBackend.php | 6 +- library/Icinga/Authentication/Manager.php | 13 +++- library/Icinga/Chart/Chart.php | 7 +- library/Icinga/Chart/Inline/PieChart.php | 3 +- library/Icinga/Cli/AnsiScreen.php | 11 ++- library/Icinga/Cli/Command.php | 3 +- library/Icinga/Data/Db/DbQuery.php | 8 +- library/Icinga/Data/SimpleQuery.php | 3 +- library/Icinga/Logger/Writer/FileWriter.php | 8 +- library/Icinga/Logger/Writer/SyslogWriter.php | 6 +- library/Icinga/Protocol/Ldap/Query.php | 14 ++-- library/Icinga/Protocol/Ldap/Root.php | 34 ++++---- .../Icinga/Protocol/Livestatus/Connection.php | 77 ++++++++----------- library/Icinga/Protocol/Livestatus/Query.php | 21 +++-- library/Icinga/Protocol/Nrpe/Connection.php | 14 ++-- library/Icinga/Protocol/Statusdat/Query.php | 17 ++-- .../Protocol/Statusdat/Query/Expression.php | 10 ++- .../Icinga/Protocol/Statusdat/Query/Group.php | 11 ++- .../Statusdat/View/MonitoringObjectList.php | 3 +- library/Icinga/Util/Translator.php | 16 +++- .../Web/Controller/ActionController.php | 8 +- .../Icinga/Web/Session/SessionNamespace.php | 8 +- .../Icinga/Web/Widget/Dashboard/Component.php | 9 +-- .../controllers/CommandController.php | 8 +- .../Monitoring/Backend/Ido/Query/IdoQuery.php | 6 +- .../library/Monitoring/Timeline/TimeLine.php | 16 +++- .../Translation/Cli/TranslationCommand.php | 11 ++- .../Util/GettextTranslationHelper.php | 11 ++- 33 files changed, 240 insertions(+), 157 deletions(-) diff --git a/application/clicommands/WebCommand.php b/application/clicommands/WebCommand.php index 4124cd731..11e7f002a 100644 --- a/application/clicommands/WebCommand.php +++ b/application/clicommands/WebCommand.php @@ -5,7 +5,7 @@ namespace Icinga\Clicommands; use Icinga\Cli\Command; -use Exception; +use Icinga\Exception\IcingaException; class WebCommand extends Command { @@ -13,11 +13,11 @@ class WebCommand extends Command { $minVersion = '5.4.0'; if (version_compare(PHP_VERSION, $minVersion) < 0) { - throw new Exception(sprintf( + throw new IcingaException( 'You are running PHP %s, internal webserver requires %s.', PHP_VERSION, $minVersion - )); + ); } $fork = $this->params->get('daemonize'); @@ -27,12 +27,12 @@ class WebCommand extends Command // TODO: Sanity check!! if ($socket === null) { $socket = '0.0.0.0:80'; - // throw new Exception('Socket is required'); + // throw new IcingaException('Socket is required'); } if ($basedir === null) { $basedir = dirname(ICINGAWEB_APPDIR) . '/public'; if (! file_exists($basedir) || ! is_dir($basedir)) { - throw new Exception('Basedir is required'); + throw new IcingaException('Basedir is required'); } } $basedir = realpath($basedir); @@ -68,7 +68,7 @@ class WebCommand extends Command { $pid = pcntl_fork(); if ($pid == -1) { - throw new Exception('Could not fork'); + throw new IcingaException('Could not fork'); } else if ($pid) { echo $this->screen->colorize('[OK]') . " Icinga Web server forked successfully\n"; diff --git a/application/controllers/DashboardController.php b/application/controllers/DashboardController.php index dc48dd7f3..72824178d 100644 --- a/application/controllers/DashboardController.php +++ b/application/controllers/DashboardController.php @@ -12,6 +12,7 @@ use Icinga\Form\Dashboard\AddUrlForm; use Icinga\Exception\NotReadableError; use Icinga\Exception\ConfigurationError; use Icinga\Web\Controller\ActionController; +use Icinga\Exception\IcingaException; /** * Handle creation, removal and displaying of dashboards, panes and components @@ -42,7 +43,7 @@ class DashboardController extends ActionController } $dashboard->readConfig($dashboardConfig); } catch (NotReadableError $e) { - Logger::error(new Exception('Cannot load dashboard configuration. An exception was thrown:', 0, $e)); + Logger::error(new IcingaException('Cannot load dashboard configuration. An exception was thrown:', $e)); return null; } return $dashboard; diff --git a/application/forms/Config/Authentication/LdapBackendForm.php b/application/forms/Config/Authentication/LdapBackendForm.php index 89f446795..6dd0d9bd3 100644 --- a/application/forms/Config/Authentication/LdapBackendForm.php +++ b/application/forms/Config/Authentication/LdapBackendForm.php @@ -157,7 +157,7 @@ class LdapBackendForm extends BaseBackendForm $testConn->assertAuthenticationPossible(); /* if ($testConn->count() === 0) { - throw new Exception('No Users Found On Directory Server'); + throw new IcingaException('No Users Found On Directory Server'); } */ } catch (Exception $exc) { diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php index 19fb48b58..3f68ce43b 100644 --- a/library/Icinga/Application/ApplicationBootstrap.php +++ b/library/Icinga/Application/ApplicationBootstrap.php @@ -14,6 +14,7 @@ use Icinga\Exception\NotReadableError; use Icinga\Logger\Logger; use Icinga\Util\DateTimeFactory; use Icinga\Util\Translator; +use Icinga\Exception\IcingaException; /** * This class bootstraps a thin Icinga application layer @@ -332,7 +333,7 @@ abstract class ApplicationBootstrap try { $this->moduleManager->loadEnabledModules(); } catch (NotReadableError $e) { - Logger::error(new Exception('Cannot load enabled modules. An exception was thrown:', 0, $e)); + Logger::error(new IcingaException('Cannot load enabled modules. An exception was thrown:', $e)); } return $this; } @@ -369,7 +370,7 @@ abstract class ApplicationBootstrap try { $this->config = Config::app(); } catch (NotReadableError $e) { - Logger::error(new Exception('Cannot load application configuration. An exception was thrown:', 0, $e)); + Logger::error(new IcingaException('Cannot load application configuration. An exception was thrown:', $e)); $this->config = new Zend_Config(array()); } return $this; @@ -417,7 +418,7 @@ abstract class ApplicationBootstrap ResourceFactory::setConfig($config); } catch (NotReadableError $e) { Logger::error( - new Exception('Cannot load resource configuration. An exception was thrown:', 0, $e) + new IcingaException('Cannot load resource configuration. An exception was thrown:', $e) ); } diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index ebc939f49..fc7c25b17 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -19,6 +19,7 @@ use Icinga\Web\Widget; use Icinga\Web\Widget\Dashboard\Pane; use Icinga\Util\File; use Icinga\Exception\ProgrammingError; +use Icinga\Exception\IcingaException; /** * Module handling @@ -630,8 +631,9 @@ class Module protected function providePermission($name, $description) { if ($this->providesPermission($name)) { - throw new Exception( - sprintf('Cannot provide permission "%s" twice', $name) + throw new IcingaException( + 'Cannot provide permission "%s" twice', + $name ); } $this->permissionList[$name] = (object) array( @@ -651,8 +653,9 @@ class Module protected function provideRestriction($name, $description) { if ($this->providesRestriction($name)) { - throw new Exception( - sprintf('Cannot provide restriction "%s" twice', $name) + throw new IcingaException( + 'Cannot provide restriction "%s" twice', + $name ); } $this->restrictionList[$name] = (object) array( diff --git a/library/Icinga/Authentication/Backend/DbUserBackend.php b/library/Icinga/Authentication/Backend/DbUserBackend.php index 95c99c346..a89a07c81 100644 --- a/library/Icinga/Authentication/Backend/DbUserBackend.php +++ b/library/Icinga/Authentication/Backend/DbUserBackend.php @@ -11,6 +11,7 @@ use Icinga\Exception\AuthenticationException; use Exception; use Zend_Db_Expr; use Zend_Db_Select; +use Icinga\Exception\IcingaException; class DbUserBackend extends UserBackend { @@ -60,7 +61,10 @@ class DbUserBackend extends UserBackend return false; } if ($salt === '') { - throw new Exception('Cannot find salt for user ' . $user->getUsername()); + throw new IcingaException( + 'Cannot find salt for user %s', + $user->getUsername() + ); } $select = new Zend_Db_Select($this->conn->getConnection()); diff --git a/library/Icinga/Authentication/Manager.php b/library/Icinga/Authentication/Manager.php index ec49aa416..75cf81481 100644 --- a/library/Icinga/Authentication/Manager.php +++ b/library/Icinga/Authentication/Manager.php @@ -13,6 +13,7 @@ use Icinga\Exception\NotReadableError; use Icinga\Application\Config as IcingaConfig; use Icinga\User\Preferences; use Icinga\User\Preferences\PreferencesStore; +use Icinga\Exception\IcingaException; class Manager { @@ -55,7 +56,11 @@ class Manager $config = IcingaConfig::app(); } catch (NotReadableError $e) { Logger::error( - new Exception('Cannot load preferences for user "' . $username . '". An exception was thrown', 0, $e) + new IcingaException( + 'Cannot load preferences for user "%s". An exception was thrown', + $username, + $e + ) ); $config = new Zend_Config(array()); } @@ -68,8 +73,10 @@ class Manager $preferences = new Preferences($preferencesStore->load()); } catch (NotReadableError $e) { Logger::error( - new Exception( - 'Cannot load preferences for user "' . $username . '". An exception was thrown', 0, $e + new IcingaException( + 'Cannot load preferences for user "%s". An exception was thrown', + $username, + $e ) ); $preferences = new Preferences(); diff --git a/library/Icinga/Chart/Chart.php b/library/Icinga/Chart/Chart.php index be436df2a..0974850ed 100644 --- a/library/Icinga/Chart/Chart.php +++ b/library/Icinga/Chart/Chart.php @@ -9,6 +9,7 @@ use Icinga\Chart\Legend; use Icinga\Chart\Palette; use Icinga\Chart\Primitive\Drawable; use Icinga\Chart\SVGRenderer; +use Icinga\Exception\IcingaException; /** * Base class for charts, extended by all other Chart classes. @@ -87,15 +88,15 @@ abstract class Chart implements Drawable * * Render this graph and return the created SVG * - * @return string The SVG created by the SvgRenderer + * @return string The SVG created by the SvgRenderer * - * @throws Exception Thrown wen the dataset is not valid for this graph + * @throws IcingaException Thrown wen the dataset is not valid for this graph * @see SVGRenderer::render */ public function render() { if (!$this->isValidDataFormat()) { - throw new Exception('Dataset for graph doesn\'t have the proper structure'); + throw new IcingaException('Dataset for graph doesn\'t have the proper structure'); } $this->build(); diff --git a/library/Icinga/Chart/Inline/PieChart.php b/library/Icinga/Chart/Inline/PieChart.php index 573c5e05d..7b2108720 100644 --- a/library/Icinga/Chart/Inline/PieChart.php +++ b/library/Icinga/Chart/Inline/PieChart.php @@ -7,6 +7,7 @@ namespace Icinga\Chart\Inline; use Icinga\Chart\PieChart as PieChartRenderer; use Imagick; use Exception; +use Icinga\Exception\IcingaException; /** * Draw an inline pie-chart directly from the available request parameters. @@ -33,7 +34,7 @@ class PieChart extends Inline { if (! class_exists('Imagick')) { // TODO: This is quick & dirty. 404? - throw new Exception('Cannot render PNGs without Imagick'); + throw new IcingaException('Cannot render PNGs without Imagick'); } $image = new Imagick(); $image->readImageBlob($this->render(false)); diff --git a/library/Icinga/Cli/AnsiScreen.php b/library/Icinga/Cli/AnsiScreen.php index d3eeed44e..f3b2b6654 100644 --- a/library/Icinga/Cli/AnsiScreen.php +++ b/library/Icinga/Cli/AnsiScreen.php @@ -5,6 +5,7 @@ namespace Icinga\Cli; use Icinga\Cli\Screen; +use Icinga\Exception\IcingaException; // @see http://en.wikipedia.org/wiki/ANSI_escape_code @@ -74,7 +75,10 @@ class AnsiScreen extends Screen protected function fgColor($color) { if (! array_key_exists($color, $this->fgColors)) { - throw new \Exception(sprintf('There is no such foreground color: %s', $color)); + throw new IcingaException( + 'There is no such foreground color: %s', + $color + ); } return $this->fgColors[$color]; } @@ -82,7 +86,10 @@ class AnsiScreen extends Screen protected function bgColor($color) { if (! array_key_exists($color, $this->bgColors)) { - throw new \Exception(sprintf('There is no such background color: %s', $color)); + throw new IcingaException( + 'There is no such background color: %s', + $color + ); } return $this->bgColors[$color]; } diff --git a/library/Icinga/Cli/Command.php b/library/Icinga/Cli/Command.php index acb2462e4..7546f871f 100644 --- a/library/Icinga/Cli/Command.php +++ b/library/Icinga/Cli/Command.php @@ -10,6 +10,7 @@ use Icinga\Cli\Params; use Icinga\Application\Config; use Icinga\Application\ApplicationBootstrap as App; use Exception; +use Icinga\Exception\IcingaException; abstract class Command { @@ -123,7 +124,7 @@ abstract class Command public function fail($msg) { - throw new Exception($msg); + throw new IcingaException('%s', $msg); } public function getDefaultActionName() diff --git a/library/Icinga/Data/Db/DbQuery.php b/library/Icinga/Data/Db/DbQuery.php index 3fb74a656..605e36af9 100644 --- a/library/Icinga/Data/Db/DbQuery.php +++ b/library/Icinga/Data/Db/DbQuery.php @@ -11,6 +11,7 @@ use Icinga\Data\Filter\FilterExpression; use Icinga\Data\Filter\FilterOr; use Icinga\Data\Filter\FilterAnd; use Icinga\Data\Filter\FilterNot; +use Icinga\Exception\IcingaException; use Zend_Db_Select; /** @@ -124,7 +125,10 @@ class DbQuery extends SimpleQuery $op = ' AND '; $str .= ' NOT '; } else { - throw new \Exception('Cannot render filter: ' . $filter); + throw new IcingaException( + 'Cannot render filter: %s', + $filter + ); } $parts = array(); if (! $filter->isEmpty()) { @@ -177,7 +181,7 @@ class DbQuery extends SimpleQuery if (! $value) { /* NOTE: It's too late to throw exceptions, we might finish in __toString - throw new \Exception(sprintf( + throw new IcingaException(sprintf( '"%s" is not a valid time expression', $value )); diff --git a/library/Icinga/Data/SimpleQuery.php b/library/Icinga/Data/SimpleQuery.php index b70bc0e5d..6a0b71c35 100644 --- a/library/Icinga/Data/SimpleQuery.php +++ b/library/Icinga/Data/SimpleQuery.php @@ -9,6 +9,7 @@ use Icinga\Data\Filter\Filter; use Icinga\Web\Paginator\Adapter\QueryAdapter; use Zend_Paginator; use Exception; +use Icinga\Exception\IcingaException; class SimpleQuery implements QueryInterface, Queryable { @@ -158,7 +159,7 @@ class SimpleQuery implements QueryInterface, Queryable public function setOrderColumns(array $orderColumns) { - throw new Exception('This function does nothing and will be removed'); + throw new IcingaException('This function does nothing and will be removed'); } /** diff --git a/library/Icinga/Logger/Writer/FileWriter.php b/library/Icinga/Logger/Writer/FileWriter.php index 2795b3541..2a50ca36b 100644 --- a/library/Icinga/Logger/Writer/FileWriter.php +++ b/library/Icinga/Logger/Writer/FileWriter.php @@ -5,6 +5,7 @@ namespace Icinga\Logger\Writer; use Exception; +use Icinga\Exception\IcingaException; use Zend_Config; use Icinga\Util\File; use Icinga\Logger\Logger; @@ -68,7 +69,7 @@ class FileWriter extends LogWriter * * @return string The string representation of the severity * - * @throws Exception In case the given severity is unknown + * @throws IcingaException In case the given severity is unknown */ protected function getSeverityString($severity) { @@ -82,7 +83,10 @@ class FileWriter extends LogWriter case Logger::$DEBUG: return '- DEBUG -'; default: - throw new Exception('Unknown severity "' . $severity . '"'); + throw new IcingaException( + 'Unknown severity "%s"', + $severity + ); } } diff --git a/library/Icinga/Logger/Writer/SyslogWriter.php b/library/Icinga/Logger/Writer/SyslogWriter.php index 8f7711a8a..d176e1cbb 100644 --- a/library/Icinga/Logger/Writer/SyslogWriter.php +++ b/library/Icinga/Logger/Writer/SyslogWriter.php @@ -9,6 +9,7 @@ use Zend_Config; use Icinga\Logger\Logger; use Icinga\Logger\LogWriter; use Icinga\Exception\ConfigurationError; +use Icinga\Exception\IcingaException; /** * Class to write messages to syslog @@ -72,7 +73,10 @@ class SyslogWriter extends LogWriter ); if (!array_key_exists($severity, $priorities)) { - throw new Exception('Severity "' . $severity . '" cannot be mapped to a valid syslog priority'); + throw new IcingaException( + 'Severity "%s" cannot be mapped to a valid syslog priority', + $severity + ); } $this->open(); diff --git a/library/Icinga/Protocol/Ldap/Query.php b/library/Icinga/Protocol/Ldap/Query.php index 3d380f9c7..ca8f5519f 100644 --- a/library/Icinga/Protocol/Ldap/Query.php +++ b/library/Icinga/Protocol/Ldap/Query.php @@ -4,6 +4,8 @@ namespace Icinga\Protocol\Ldap; +use Icinga\Exception\IcingaException; + /** * Search class * @@ -82,12 +84,10 @@ class Query public function limit($count = null, $offset = null) { if (! preg_match('~^\d+~', $count . $offset)) { - throw new Exception( - sprintf( - 'Got invalid limit: %s, %s', - $count, - $offset - ) + throw new IcingaException( + 'Got invalid limit: %s, %s', + $count, + $offset ); } $this->limit_count = (int) $count; @@ -316,7 +316,7 @@ class Query { $parts = array(); if (! isset($this->filters['objectClass']) || $this->filters['objectClass'] === null) { - // throw new Exception('Object class is mandatory'); + // throw new IcingaException('Object class is mandatory'); } foreach ($this->filters as $key => $value) { $parts[] = sprintf( diff --git a/library/Icinga/Protocol/Ldap/Root.php b/library/Icinga/Protocol/Ldap/Root.php index 46062c9d6..56abb4175 100644 --- a/library/Icinga/Protocol/Ldap/Root.php +++ b/library/Icinga/Protocol/Ldap/Root.php @@ -4,6 +4,8 @@ namespace Icinga\Protocol\Ldap; +use Icinga\Exception\IcingaException; + /** * This class is a special node object, representing your connections root node * @@ -95,16 +97,14 @@ class Root /** * @param $rdn * @return mixed - * @throws Exception + * @throws IcingaException */ public function getChildByRDN($rdn) { if (!$this->hasChildRDN($rdn)) { - throw new Exception( - sprintf( - 'The child RDN "%s" is not available', - $rdn - ) + throw new IcingaException( + 'The child RDN "%s" is not available', + $rdn ); } return $this->children[strtolower($rdn)]; @@ -154,28 +154,24 @@ class Root /** * @param $dn * @return $this - * @throws Exception + * @throws IcingaException */ protected function assertSubDN($dn) { $mydn = $this->getDN(); $end = substr($dn, -1 * strlen($mydn)); if (strtolower($end) !== strtolower($mydn)) { - throw new Exception( - sprintf( - '"%s" is not a child of "%s"', - $dn, - $mydn - ) + throw new IcingaException( + '"%s" is not a child of "%s"', + $dn, + $mydn ); } if (strlen($dn) === strlen($mydn)) { - throw new Exception( - sprintf( - '"%s" is not a child of "%s", they are equal', - $dn, - $mydn - ) + throw new IcingaException( + '"%s" is not a child of "%s", they are equal', + $dn, + $mydn ); } return $this; diff --git a/library/Icinga/Protocol/Livestatus/Connection.php b/library/Icinga/Protocol/Livestatus/Connection.php index 0b37f3fcf..c014ba70f 100644 --- a/library/Icinga/Protocol/Livestatus/Connection.php +++ b/library/Icinga/Protocol/Livestatus/Connection.php @@ -6,6 +6,7 @@ namespace Icinga\Protocol\Livestatus; use Icinga\Application\Benchmark; use Exception; +use Icinga\Exception\IcingaException; /** * Backend class managing handling MKI Livestatus connections @@ -73,22 +74,18 @@ class Connection $this->assertPhpExtensionLoaded('sockets'); if ($socket[0] === '/') { if (! is_writable($socket)) { - throw new \Exception( - sprintf( - 'Cannot write to livestatus socket "%s"', - $socket - ) + throw new IcingaException( + 'Cannot write to livestatus socket "%s"', + $socket ); } $this->socket_type = self::TYPE_UNIX; $this->socket_path = $socket; } else { if (! preg_match('~^tcp://([^:]+):(\d+)~', $socket, $m)) { - throw new \Exception( - sprintf( - 'Invalid TCP socket syntax: "%s"', - $socket - ) + throw new IcingaException( + 'Invalid TCP socket syntax: "%s"', + $socket ); } // TODO: Better syntax checks @@ -156,17 +153,15 @@ class Connection $length = (int) trim(substr($header, 4)); $body = $this->readFromSocket($length); if ($status !== 200) { - throw new Exception( - sprintf( - 'Problem while reading %d bytes from livestatus: %s', - $length, - $body - ) + throw new IcingaException( + 'Problem while reading %d bytes from livestatus: %s', + $length, + $body ); } $result = json_decode($body); if ($result === null) { - throw new Exception('Got invalid response body from livestatus'); + throw new IcingaException('Got invalid response body from livestatus'); } return $result; @@ -180,11 +175,9 @@ class Connection while ($offset < $length) { $data = socket_read($this->connection, $length - $offset); if ($data === false) { - throw new Exception( - sprintf( - 'Failed to read from livestatus socket: %s', - socket_strerror(socket_last_error($this->connection)) - ) + throw new IcingaException( + 'Failed to read from livestatus socket: %s', + socket_strerror(socket_last_error($this->connection)) ); } $size = strlen($data); @@ -196,12 +189,10 @@ class Connection } } if ($offset !== $length) { - throw new \Exception( - sprintf( - 'Got only %d instead of %d bytes from livestatus socket', - $offset, - $length - ) + throw new IcingaException( + 'Got only %d instead of %d bytes from livestatus socket', + $offset, + $length ); } @@ -212,7 +203,7 @@ class Connection { $res = socket_write($this->connection, $data); if ($res === false) { - throw new \Exception('Writing to livestatus socket failed'); + throw new IcingaException('Writing to livestatus socket failed'); } return true; } @@ -220,11 +211,9 @@ class Connection protected function assertPhpExtensionLoaded($name) { if (! extension_loaded($name)) { - throw new \Exception( - sprintf( - 'The extension "%s" is not loaded', - $name - ) + throw new IcingaException( + 'The extension "%s" is not loaded', + $name ); } } @@ -250,13 +239,11 @@ class Connection $this->connection = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if (! @socket_connect($this->connection, $this->socket_host, $this->socket_port)) { - throw new \Exception( - sprintf( - 'Cannot connect to livestatus TCP socket "%s:%d": %s', - $this->socket_host, - $this->socket_port, - socket_strerror(socket_last_error($this->connection)) - ) + throw new IcingaException( + 'Cannot connect to livestatus TCP socket "%s:%d": %s', + $this->socket_host, + $this->socket_port, + socket_strerror(socket_last_error($this->connection)) ); } socket_set_option($this->connection, SOL_TCP, TCP_NODELAY, 1); @@ -266,11 +253,9 @@ class Connection { $this->connection = socket_create(AF_UNIX, SOCK_STREAM, 0); if (! socket_connect($this->connection, $this->socket_path)) { - throw new \Exception( - sprintf( - 'Cannot connect to livestatus local socket "%s"', - $this->socket_path - ) + throw new IcingaException( + 'Cannot connect to livestatus local socket "%s"', + $this->socket_path ); } } diff --git a/library/Icinga/Protocol/Livestatus/Query.php b/library/Icinga/Protocol/Livestatus/Query.php index 73e287bd6..7c1e73c8a 100644 --- a/library/Icinga/Protocol/Livestatus/Query.php +++ b/library/Icinga/Protocol/Livestatus/Query.php @@ -5,6 +5,7 @@ namespace Icinga\Protocol\Livestatus; use Icinga\Protocol\AbstractQuery; +use Icinga\Exception\IcingaException; class Query extends AbstractQuery { @@ -86,12 +87,10 @@ class Query extends AbstractQuery public function limit($count = null, $offset = null) { if (! preg_match('~^\d+~', $count . $offset)) { - throw new Exception( - sprintf( - 'Got invalid limit: %s, %s', - $count, - $offset - ) + throw new IcingaException( + 'Got invalid limit: %s, %s', + $count, + $offset ); } $this->limit_count = (int) $count; @@ -122,11 +121,9 @@ class Query extends AbstractQuery public function from($table, $columns = null) { if (! $this->connection->hasTable($table)) { - throw new Exception( - sprintf( - 'This livestatus connection does not provide "%s"', - $table - ) + throw new IcingaException( + 'This livestatus connection does not provide "%s"', + $table ); } $this->table = $table; @@ -169,7 +166,7 @@ class Query extends AbstractQuery public function __toString() { if ($this->table === null) { - throw new Exception('Table is required'); + throw new IcingaException('Table is required'); } $default_headers = array( 'OutputFormat: json', diff --git a/library/Icinga/Protocol/Nrpe/Connection.php b/library/Icinga/Protocol/Nrpe/Connection.php index 3c06e259b..84a754e91 100644 --- a/library/Icinga/Protocol/Nrpe/Connection.php +++ b/library/Icinga/Protocol/Nrpe/Connection.php @@ -4,6 +4,8 @@ namespace Icinga\Protocol\Nrpe; +use Icinga\Exception\IcingaException; + class Connection { protected $host; @@ -47,11 +49,10 @@ class Connection // TODO: Check result checksum! $result = fread($conn, 8192); if ($result === false) { - throw new \Exception('CHECK_NRPE: Error receiving data from daemon.'); + throw new IcingaException('CHECK_NRPE: Error receiving data from daemon.'); } elseif (strlen($result) === 0) { - throw new \Exception( - 'CHECK_NRPE: Received 0 bytes from daemon.' - . ' Check the remote server logs for error messages' + throw new IcingaException( + 'CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages' ); } // TODO: CHECK_NRPE: Receive underflow - only %d bytes received (%d expected) @@ -80,7 +81,10 @@ class Connection $ctx ); if (! $this->connection) { - throw new \Exception(sprintf('NRPE Connection failed: ' . $errstr)); + throw new IcingaException( + 'NRPE Connection failed: %s', + $errstr + ); } } diff --git a/library/Icinga/Protocol/Statusdat/Query.php b/library/Icinga/Protocol/Statusdat/Query.php index ed8928b6f..f3b5ea85e 100644 --- a/library/Icinga/Protocol/Statusdat/Query.php +++ b/library/Icinga/Protocol/Statusdat/Query.php @@ -9,6 +9,7 @@ use Icinga\Exception\ProgrammingError; use Icinga\Data\SimpleQuery; use Icinga\Protocol\Statusdat\View\MonitoringObjectList; use Icinga\Protocol\Statusdat\Query\IQueryPart; +use Icinga\Exception\IcingaException; /** * Base implementation for Statusdat queries. @@ -163,7 +164,7 @@ class Query extends SimpleQuery * @param array $columns An array of attributes to use (required for fetchPairs()) * * @return $this Fluent interface - * @throws \Exception If the target is unknonw + * @throws IcingaException If the target is unknonw */ public function from($table, array $attributes = null) { @@ -173,7 +174,10 @@ class Query extends SimpleQuery if (isset(self::$VALID_TARGETS[$table])) { $this->source = $table; } else { - throw new \Exception('Unknown from target for status.dat :' . $table); + throw new IcingaException( + 'Unknown from target for status.dat :%s', + $table + ); } return $this; } @@ -397,16 +401,15 @@ class Query extends SimpleQuery /** * Fetch the result as an associative array using the first column as the key and the second as the value * - * @return array An associative array with the result - * @throws \Exception If no attributes are defined + * @return array An associative array with the result + * @throws IcingaException If no attributes are defined */ public function fetchPairs() { $result = array(); if (count($this->getColumns()) < 2) { - throw new Exception( - 'Status.dat "fetchPairs()" query expects at least' . - ' columns to be set in the query expression' + throw new IcingaException( + 'Status.dat "fetchPairs()" query expects at least columns to be set in the query expression' ); } $attributes = $this->getColumns(); diff --git a/library/Icinga/Protocol/Statusdat/Query/Expression.php b/library/Icinga/Protocol/Statusdat/Query/Expression.php index 1a04f07ff..1db48df33 100644 --- a/library/Icinga/Protocol/Statusdat/Query/Expression.php +++ b/library/Icinga/Protocol/Statusdat/Query/Expression.php @@ -4,6 +4,8 @@ namespace Icinga\Protocol\Statusdat\Query; +use Icinga\Exception\IcingaException; + class Expression implements IQueryPart { /** @@ -70,7 +72,7 @@ class Expression implements IQueryPart /** * @param $token - * @throws \Exception + * @throws IcingaException */ private function getOperatorType($token) { @@ -106,7 +108,11 @@ class Expression implements IQueryPart $this->CB = "isNotIn"; break; default: - throw new \Exception("Unknown operator $token in expression $this->expression !"); + throw new IcingaException( + 'Unknown operator %s in expression %s !', + $token, + $this->expression + ); } } diff --git a/library/Icinga/Protocol/Statusdat/Query/Group.php b/library/Icinga/Protocol/Statusdat/Query/Group.php index 51f4c2cf8..2e110843f 100644 --- a/library/Icinga/Protocol/Statusdat/Query/Group.php +++ b/library/Icinga/Protocol/Statusdat/Query/Group.php @@ -4,6 +4,8 @@ namespace Icinga\Protocol\Statusdat\Query; +use Icinga\Exception\IcingaException; + /** * Class Group * @package Icinga\Protocol\Statusdat\Query @@ -130,7 +132,7 @@ class Group implements IQueryPart } /** - * @throws \Exception + * @throws IcingaException */ private function tokenize() { @@ -154,7 +156,10 @@ class Group implements IQueryPart } if ($token === self::GROUP_END) { if ($subgroupCount < 1) { - throw new \Exception("Invalid Query: unexpected ')' at pos " . $this->parsePos); + throw new IcingaException( + 'Invalid Query: unexpected \')\' at pos %s', + $this->parsePos + ); } $subgroupCount--; /* @@ -192,7 +197,7 @@ class Group implements IQueryPart $this->subExpressionLength = $this->parsePos - $this->subExpressionStart; } if ($subgroupCount > 0) { - throw new \Exception("Unexpected end of query, are you missing a parenthesis?"); + throw new IcingaException('Unexpected end of query, are you missing a parenthesis?'); } $this->startNewSubExpression(); diff --git a/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php b/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php index e9a7e1bc9..bde4ded04 100644 --- a/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php +++ b/library/Icinga/Protocol/Statusdat/View/MonitoringObjectList.php @@ -8,6 +8,7 @@ use Iterator; use Countable; use ArrayAccess; use Exception; +use Icinga\Exception\IcingaException; /** * Wrapper around an array of monitoring objects that can be enhanced with an optional @@ -115,7 +116,7 @@ class MonitoringObjectList implements Iterator, Countable, ArrayAccess public function __set($name, $value) { - throw new Exception("Setting is currently not available for objects"); + throw new IcingaException('Setting is currently not available for objects'); } public function offsetExists($offset) diff --git a/library/Icinga/Util/Translator.php b/library/Icinga/Util/Translator.php index fd01812b3..b6cf533d9 100644 --- a/library/Icinga/Util/Translator.php +++ b/library/Icinga/Util/Translator.php @@ -5,6 +5,7 @@ namespace Icinga\Util; use Exception; +use Icinga\Exception\IcingaException; /** * Helper class to ease internationalization when using gettext @@ -53,12 +54,16 @@ class Translator * @param string $name The name of the domain to register * @param string $directory The directory where message catalogs can be found * - * @throws Exception In case the domain was not successfully registered + * @throws IcingaException In case the domain was not successfully registered */ public static function registerDomain($name, $directory) { if (bindtextdomain($name, $directory) === false) { - throw new Exception("Cannot register domain '$name' with path '$directory'"); + throw new IcingaException( + 'Cannot register domain \'%s\' with path \'%s\'', + $name, + $directory + ); } bind_textdomain_codeset($name, 'UTF-8'); self::$knownDomains[$name] = $directory; @@ -69,14 +74,17 @@ class Translator * * @param string $localeName The name of the locale to use * - * @throws Exception In case the locale's name is invalid + * @throws IcingaException In case the locale's name is invalid */ public static function setupLocale($localeName) { if (setlocale(LC_ALL, $localeName . '.UTF-8') === false && setlocale(LC_ALL, $localeName) === false) { setlocale(LC_ALL, 'C'); // C == "use whatever is hardcoded" if ($localeName !== self::DEFAULT_LOCALE) { - throw new Exception("Cannot set locale '$localeName' for category 'LC_ALL'"); + throw new IcingaException( + 'Cannot set locale \'%s\' for category \'LC_ALL\'', + $localeName + ); } } else { $locale = setlocale(LC_ALL, 0); diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php index 13809e83d..bfbb35b77 100644 --- a/library/Icinga/Web/Controller/ActionController.php +++ b/library/Icinga/Web/Controller/ActionController.php @@ -8,6 +8,7 @@ use Exception; use Icinga\Authentication\Manager as AuthManager; use Icinga\Application\Benchmark; use Icinga\Application\Config; +use Icinga\Exception\IcingaException; use Icinga\Util\Translator; use Icinga\Web\Widget\Tabs; use Icinga\Web\Window; @@ -177,7 +178,10 @@ class ActionController extends Zend_Controller_Action { if (! $this->Auth()->hasPermission($name)) { // TODO: Shall this be an Auth Exception? Or a 404? - throw new Exception(sprintf('Auth error, no permission for "%s"', $name)); + throw new IcingaException( + 'Auth error, no permission for "%s"', + $name + ); } } @@ -381,7 +385,7 @@ class ActionController extends Zend_Controller_Action if ($this->view->title) { if (preg_match('~[\r\n]~', $this->view->title)) { // TODO: Innocent exception and error log for hack attempts - throw new Exception('No way, guy'); + throw new IcingaException('No way, guy'); } $resp->setHeader( 'X-Icinga-Title', diff --git a/library/Icinga/Web/Session/SessionNamespace.php b/library/Icinga/Web/Session/SessionNamespace.php index 682991aed..b7495683b 100644 --- a/library/Icinga/Web/Session/SessionNamespace.php +++ b/library/Icinga/Web/Session/SessionNamespace.php @@ -6,6 +6,7 @@ namespace Icinga\Web\Session; use Exception; use ArrayIterator; +use Icinga\Exception\IcingaException; use IteratorAggregate; /** @@ -76,7 +77,10 @@ class SessionNamespace implements IteratorAggregate public function __get($key) { if (!array_key_exists($key, $this->values)) { - throw new Exception('Cannot access non-existent session value "' . $key . '"'); + throw new IcingaException( + 'Cannot access non-existent session value "%s"', + $key + ); } return $this->get($key); @@ -178,7 +182,7 @@ class SessionNamespace implements IteratorAggregate public function write() { if (!$this->session) { - throw new Exception('Cannot save, session not set'); + throw new IcingaException('Cannot save, session not set'); } $this->session->write(); diff --git a/library/Icinga/Web/Widget/Dashboard/Component.php b/library/Icinga/Web/Widget/Dashboard/Component.php index 56f499dc1..71615c572 100644 --- a/library/Icinga/Web/Widget/Dashboard/Component.php +++ b/library/Icinga/Web/Widget/Dashboard/Component.php @@ -4,6 +4,7 @@ namespace Icinga\Web\Widget\Dashboard; +use Icinga\Exception\IcingaException; use Icinga\Util\Dimension; use Icinga\Web\Form; use Icinga\Web\Url; @@ -81,11 +82,9 @@ EOD; } elseif ($url) { $this->url = Url::fromPath($url); } else { - throw new Exception( - sprintf( - 'Cannot create dashboard component "%s" without valid URL', - $title - ) + throw new IcingaException( + 'Cannot create dashboard component "%s" without valid URL', + $title ); } } diff --git a/modules/monitoring/application/controllers/CommandController.php b/modules/monitoring/application/controllers/CommandController.php index f3055371a..36d3d62ca 100644 --- a/modules/monitoring/application/controllers/CommandController.php +++ b/modules/monitoring/application/controllers/CommandController.php @@ -25,6 +25,7 @@ use Icinga\Module\Monitoring\Form\Command\DelayNotificationForm; use Icinga\Module\Monitoring\Form\Command\RescheduleNextCheckForm; use Icinga\Module\Monitoring\Form\Command\ScheduleDowntimeForm; use Icinga\Module\Monitoring\Form\Command\SubmitPassiveCheckResultForm; +use Icinga\Exception\IcingaException; /** * Class Monitoring_CommandController @@ -238,13 +239,16 @@ class Monitoring_CommandController extends Controller $given = array_intersect_key($supported, $this->getRequest()->getParams()); if (empty($given)) { - throw new \Exception('Missing parameter, supported: '.implode(', ', array_flip($supported))); + throw new IcingaException( + 'Missing parameter, supported: %s', + implode(', ', array_flip($supported)) + ); } if (isset($given['host'])) { $objects = $this->selectCommandTargets(!in_array("service", $supported)); if (empty($objects)) { - throw new \Exception("No objects found for your command"); + throw new IcingaException('No objects found for your command'); } } diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php index df7118fe0..06472b44d 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php @@ -4,6 +4,7 @@ namespace Icinga\Module\Monitoring\Backend\Ido\Query; +use Icinga\Exception\IcingaException; use Icinga\Logger\Logger; use Icinga\Data\Db\DbQuery; use Icinga\Exception\ProgrammingError; @@ -272,7 +273,10 @@ abstract class IdoQuery extends DbQuery $this->requireColumn($condition); $col = $this->getMappedField($condition); if ($col === null) { - throw new \Exception("No such field: $condition"); + throw new IcingaException( + 'No such field: %s', + $condition + ); } return parent::where($col, $value); } diff --git a/modules/monitoring/library/Monitoring/Timeline/TimeLine.php b/modules/monitoring/library/Monitoring/Timeline/TimeLine.php index 2b0158bf1..be3820e19 100644 --- a/modules/monitoring/library/Monitoring/Timeline/TimeLine.php +++ b/modules/monitoring/library/Monitoring/Timeline/TimeLine.php @@ -7,6 +7,7 @@ namespace Icinga\Module\Monitoring\Timeline; use DateTime; use Exception; use ArrayIterator; +use Icinga\Exception\IcingaException; use IteratorAggregate; use Icinga\Data\Filter\Filter; use Icinga\Web\Hook; @@ -166,7 +167,10 @@ class TimeLine implements IteratorAggregate $this->circleDiameter = floatval($matches[1]); $this->diameterUnit = $matches[2]; } else { - throw new Exception('Width "' . $width . '" is not a valid width'); + throw new IcingaException( + 'Width "%s" is not a valid width', + $width + ); } } @@ -184,10 +188,16 @@ class TimeLine implements IteratorAggregate if ($matches[2] === $this->diameterUnit) { $this->minCircleDiameter = floatval($matches[1]); } else { - throw new Exception('Unit needs to be in "' . $this->diameterUnit . '"'); + throw new IcingaException( + 'Unit needs to be in "%s"', + $this->diameterUnit + ); } } else { - throw new Exception('Width "' . $width . '" is not a valid width'); + throw new IcingaException( + 'Width "%s" is not a valid width', + $width + ); } } diff --git a/modules/translation/library/Translation/Cli/TranslationCommand.php b/modules/translation/library/Translation/Cli/TranslationCommand.php index b3cfc6de4..bae20cc5e 100644 --- a/modules/translation/library/Translation/Cli/TranslationCommand.php +++ b/modules/translation/library/Translation/Cli/TranslationCommand.php @@ -6,6 +6,7 @@ namespace Icinga\Module\Translation\Cli; use Exception; use Icinga\Cli\Command; +use Icinga\Exception\IcingaException; /** * Base class for translation commands @@ -24,7 +25,10 @@ class TranslationCommand extends Command public function validateLocaleCode($code) { if (! preg_match('@[a-z]{2}_[A-Z]{2}@', $code)) { - throw new Exception("Locale code '$code' is not valid. Expected format is: ll_CC"); + throw new IcingaException( + 'Locale code \'%s\' is not valid. Expected format is: ll_CC', + $code + ); } return $code; @@ -44,7 +48,10 @@ class TranslationCommand extends Command $enabledModules = $this->app->getModuleManager()->listEnabledModules(); if (!in_array($name, $enabledModules)) { - throw new Exception("Module with name '$name' not found or is not enabled"); + throw new IcingaException( + 'Module with name \'%s\' not found or is not enabled', + $name + ); } return $name; diff --git a/modules/translation/library/Translation/Util/GettextTranslationHelper.php b/modules/translation/library/Translation/Util/GettextTranslationHelper.php index a19353f33..68e07fbcd 100644 --- a/modules/translation/library/Translation/Util/GettextTranslationHelper.php +++ b/modules/translation/library/Translation/Util/GettextTranslationHelper.php @@ -5,6 +5,7 @@ namespace Icinga\Module\Translation\Util; use Exception; +use Icinga\Exception\IcingaException; use Icinga\Util\File; use Icinga\Application\Modules\Manager; use Icinga\Application\ApplicationBootstrap; @@ -215,7 +216,10 @@ class GettextTranslationHelper } else { if ((!is_dir(dirname($this->tablePath)) && !@mkdir(dirname($this->tablePath), 0755, true)) || !rename($this->templatePath, $this->tablePath)) { - throw new Exception('Unable to create ' . $this->tablePath); + throw new IcingaException( + 'Unable to create %s', + $this->tablePath + ); } } $this->updateHeader($this->tablePath); @@ -364,7 +368,10 @@ class GettextTranslationHelper { $directoryHandle = opendir($directory); if (!$directoryHandle) { - throw new Exception('Unable to read files from ' . $directory); + throw new IcingaException( + 'Unable to read files from %s', + $directory + ); } $subdirs = array(); From afd0c20c42b1eef2b8adcd1ed2697ca2cf6cec2e Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 27 Aug 2014 16:23:44 +0200 Subject: [PATCH 051/257] FilterException: extend IcingaException refs #6931 --- library/Icinga/Data/Filter/FilterException.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Data/Filter/FilterException.php b/library/Icinga/Data/Filter/FilterException.php index e70ee6b77..8f770810f 100644 --- a/library/Icinga/Data/Filter/FilterException.php +++ b/library/Icinga/Data/Filter/FilterException.php @@ -4,11 +4,11 @@ namespace Icinga\Data\Filter; -use Exception; +use Icinga\Exception\IcingaException; /** * Filter Exception Class * * Filter Exceptions should be thrown on filter parse errors or similar */ -class FilterException extends Exception {} +class FilterException extends IcingaException {} From e6612fefe7d97c0cccdaaf195c4f387b052ad333 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 27 Aug 2014 16:26:43 +0200 Subject: [PATCH 052/257] FilterParseException: extend IcingaException refs #6931 --- library/Icinga/Data/Filter/FilterParseException.php | 4 ++-- library/Icinga/Data/Filter/FilterQueryString.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library/Icinga/Data/Filter/FilterParseException.php b/library/Icinga/Data/Filter/FilterParseException.php index bb90067b8..5633b5adf 100644 --- a/library/Icinga/Data/Filter/FilterParseException.php +++ b/library/Icinga/Data/Filter/FilterParseException.php @@ -4,8 +4,8 @@ namespace Icinga\Data\Filter; -use Exception; +use Icinga\Exception\IcingaException; -class FilterParseException extends Exception +class FilterParseException extends IcingaException { } diff --git a/library/Icinga/Data/Filter/FilterQueryString.php b/library/Icinga/Data/Filter/FilterQueryString.php index 88d3f0a37..3dbcce473 100644 --- a/library/Icinga/Data/Filter/FilterQueryString.php +++ b/library/Icinga/Data/Filter/FilterQueryString.php @@ -15,7 +15,7 @@ class FilterQueryString protected $reportDebug = false; protected $length; - + protected function __construct() { } @@ -111,13 +111,13 @@ class FilterQueryString $extra .= "\n" . implode("\n", $this->debug); } - throw new FilterParseException(sprintf( + throw new FilterParseException( 'Invalid filter "%s", unexpected %s at pos %d%s', $this->string, $char, $this->pos, $extra - )); + ); } protected function readFilters($nestingLevel = 0, $op = null) From 8b0df6c9f782f42e09c74e0ef1c7af59e754b2a1 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 27 Aug 2014 16:29:56 +0200 Subject: [PATCH 053/257] UnsupportedBackendException: extend IcingaException refs #6931 --- .../Monitoring/Exception/UnsupportedBackendException.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php b/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php index 3e1468e36..169fa2cfd 100644 --- a/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php +++ b/modules/monitoring/library/Monitoring/Exception/UnsupportedBackendException.php @@ -4,8 +4,9 @@ namespace Icinga\Module\Monitoring\Exception; -use Exception; -class UnsupportedBackendException extends Exception +use Icinga\Exception\IcingaException; + +class UnsupportedBackendException extends IcingaException { -} \ No newline at end of file +} From 9465c3ffb6064b12fc32fab466ba4baf4d5a5600 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Wed, 27 Aug 2014 16:13:25 +0200 Subject: [PATCH 054/257] Show/Contact: Add commands to view Create a new command query and join contact information into. refs #4804 --- .../controllers/ShowController.php | 25 ++++++-- .../views/scripts/show/contact.phtml | 21 ++++--- .../Backend/Ido/Query/CommandQuery.php | 60 +++++++++++++++++++ .../library/Monitoring/DataView/Command.php | 28 +++++++++ 4 files changed, 120 insertions(+), 14 deletions(-) create mode 100644 modules/monitoring/library/Monitoring/Backend/Ido/Query/CommandQuery.php create mode 100644 modules/monitoring/library/Monitoring/DataView/Command.php diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 55b57cd52..19c1b7bef 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -108,13 +108,15 @@ class Monitoring_ShowController extends Controller public function contactAction() { - $contact = $this->getParam('contact'); - if (! $contact) { + $contactName = $this->getParam('contact'); + + if (! $contactName) { throw new Zend_Controller_Action_Exception( $this->translate('The parameter `contact\' is required'), 404 ); } + $query = $this->backend->select()->from('contact', array( 'contact_name', 'contact_id', @@ -135,9 +137,22 @@ class Monitoring_ShowController extends Controller 'contact_notify_host_flapping', 'contact_notify_host_downtime', )); - $query->where('contact_name', $contact); - $this->view->contacts = $query->paginate(); - $this->view->contact_name = $contact; + + $query->where('contact_name', $contactName); + + $contact = $query->getQuery()->fetchRow(); + + if ($contact) { + $commands = $this->backend->select()->from('command', array( + 'command_line', + 'command_name' + ))->where('contact_id', $contact->contact_id); + + $this->view->commands = $commands->paginate(); + } + + $this->view->contact = $contact; + $this->view->contactName = $contactName; } /** diff --git a/modules/monitoring/application/views/scripts/show/contact.phtml b/modules/monitoring/application/views/scripts/show/contact.phtml index a7b691eb4..fff03a106 100644 --- a/modules/monitoring/application/views/scripts/show/contact.phtml +++ b/modules/monitoring/application/views/scripts/show/contact.phtml @@ -2,7 +2,7 @@ $contactHelper = $this->getHelper('ContactFlags'); ?>
- + @@ -45,12 +45,15 @@ $contactHelper = $this->getHelper('ContactFlags');
- + +

translate('Commands'); ?>:

+
    + +
  • command_name; ?>
  • + +
+ + + translate('No such contact'); ?>: +
diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommandQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommandQuery.php new file mode 100644 index 000000000..664cb3576 --- /dev/null +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommandQuery.php @@ -0,0 +1,60 @@ + array( + 'command_id' => 'c.command_id', + 'command_instance_id' => 'c.instance_id', + 'command_config_type' => 'c.config_type', + 'command_line' => 'c.command_line', + 'command_name' => 'co.name1' + ), + + 'contacts' => array( + 'contact_id' => 'con.contact_id', + 'contact_alias' => 'con.contact_alias' + ) + ); + + /** + * Fetch basic information about commands + */ + protected function joinBaseTables() + { + $this->select->from( + array('c' => $this->prefix . 'commands'), + array() + )->join( + array('co' => $this->prefix . 'objects'), + 'co.object_id = c.object_id', + array() + ); + + $this->joinedVirtualTables = array('commands' => true); + } + + /** + * Join contacts + */ + protected function joinContacts() + { + $this->select->join( + array('cnc' => $this->prefix . 'contact_notificationcommands'), + 'cnc.command_object_id = co.object_id' + )->join( + array('con' => $this->prefix . 'contacts'), + 'con.contact_id = cnc.contact_id' + ); + } +} \ No newline at end of file diff --git a/modules/monitoring/library/Monitoring/DataView/Command.php b/modules/monitoring/library/Monitoring/DataView/Command.php new file mode 100644 index 000000000..a21c48ee0 --- /dev/null +++ b/modules/monitoring/library/Monitoring/DataView/Command.php @@ -0,0 +1,28 @@ + Date: Wed, 27 Aug 2014 16:36:52 +0200 Subject: [PATCH 055/257] Show/Contact: Add notification history to view refs #4804 --- .../application/controllers/ShowController.php | 15 +++++++++++++++ .../application/views/scripts/show/contact.phtml | 3 +++ .../Monitoring/Backend/Ido/Query/ContactQuery.php | 1 + .../Backend/Ido/Query/NotificationQuery.php | 3 ++- .../library/Monitoring/DataView/Contact.php | 1 + 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 19c1b7bef..1ad0f29dd 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -123,6 +123,7 @@ class Monitoring_ShowController extends Controller 'contact_alias', 'contact_email', 'contact_pager', + 'contact_object_id', 'contact_notify_service_timeperiod', 'contact_notify_service_recovery', 'contact_notify_service_warning', @@ -149,6 +150,20 @@ class Monitoring_ShowController extends Controller ))->where('contact_id', $contact->contact_id); $this->view->commands = $commands->paginate(); + + $notifications = $this->backend->select()->from('notification', array( + 'host', + 'service', + 'notification_output', + 'notification_contact', + 'notification_start_time', + 'notification_state' + )); + + $notifications->where('contact_object_id', $contact->contact_object_id); + + $this->view->compact = true; + $this->view->notifications = $notifications->paginate(); } $this->view->contact = $contact; diff --git a/modules/monitoring/application/views/scripts/show/contact.phtml b/modules/monitoring/application/views/scripts/show/contact.phtml index fff03a106..45d751fd5 100644 --- a/modules/monitoring/application/views/scripts/show/contact.phtml +++ b/modules/monitoring/application/views/scripts/show/contact.phtml @@ -53,6 +53,9 @@ $contactHelper = $this->getHelper('ContactFlags'); +

translate('Notifications'); ?>:

+ render('list/notifications.phtml') ?> + translate('No such contact'); ?>: diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php index a868d5479..89fa37fcd 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php @@ -13,6 +13,7 @@ class ContactQuery extends IdoQuery 'contact_alias' => 'c.alias COLLATE latin1_general_ci', 'contact_email' => 'c.email_address COLLATE latin1_general_ci', 'contact_pager' => 'c.pager_address', + 'contact_object_id' => 'c.contact_object_id', 'contact_has_host_notfications' => 'c.host_notifications_enabled', 'contact_has_service_notfications' => 'c.service_notifications_enabled', 'contact_can_submit_commands' => 'c.can_submit_commands', diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php index 68a37d83c..882600240 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php @@ -25,7 +25,8 @@ class NotificationQuery extends IdoQuery 'service' => 'o.name2' ), 'contact' => array( - 'notification_contact' => 'c_o.name1' + 'notification_contact' => 'c_o.name1', + 'contact_object_id' => 'c_o.object_id' ), 'command' => array( 'notification_command' => 'cmd_o.name1' diff --git a/modules/monitoring/library/Monitoring/DataView/Contact.php b/modules/monitoring/library/Monitoring/DataView/Contact.php index 7d24d1255..9f78a3b6a 100644 --- a/modules/monitoring/library/Monitoring/DataView/Contact.php +++ b/modules/monitoring/library/Monitoring/DataView/Contact.php @@ -38,6 +38,7 @@ class Contact extends DataView 'contact_notify_host_unreachable', 'contact_notify_host_flapping', 'contact_notify_host_downtime', + 'contact_object_id', 'host_object_id', 'host_name', 'service_object_id', From 6a32c3a8abbad32a42bd3e64c89e2d43f3d300a3 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Wed, 27 Aug 2014 14:00:01 +0200 Subject: [PATCH 056/257] Make charts responsive Let pie and grid charts of the chart controller automatically adapt to changing viewport sizes. --- .../monitoring/application/controllers/ChartController.php | 4 ++++ .../application/views/scripts/chart/hostgroup.phtml | 2 +- .../application/views/scripts/chart/servicegroup.phtml | 2 +- public/css/icinga/widgets.less | 5 +++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/application/controllers/ChartController.php b/modules/monitoring/application/controllers/ChartController.php index 4b5dd109d..a5d85851e 100644 --- a/modules/monitoring/application/controllers/ChartController.php +++ b/modules/monitoring/application/controllers/ChartController.php @@ -25,6 +25,7 @@ class Monitoring_ChartController extends Controller public function testAction() { $this->chart = new GridChart(); + $this->chart->alignTopLeft(); $this->chart->setAxisLabel('X axis label', 'Y axis label')->setXAxis(new StaticAxis()); $data1 = array(); $data2 = array(); @@ -139,6 +140,7 @@ class Monitoring_ChartController extends Controller $unknownBars[] = array($servicegroup->servicegroup, $servicegroup->services_unknown_unhandled); } $this->view->chart = new GridChart(); + $this->view->chart->alignTopLeft(); $this->view->chart->setAxisLabel('', t('Services')) ->setXAxis(new \Icinga\Chart\Unit\StaticAxis()) ->setAxisMin(null, 0); @@ -191,6 +193,7 @@ class Monitoring_ChartController extends Controller ); } $this->view->chart = new GridChart(); + $this->view->chart->alignTopLeft(); $this->view->chart->setAxisLabel('', t('Hosts')) ->setXAxis(new StaticAxis()) ->setAxisMin(null, 0); @@ -219,6 +222,7 @@ class Monitoring_ChartController extends Controller private function drawGroupPie($query) { $this->view->chart = new PieChart(); + $this->view->chart->alignTopLeft(); if (isset($query->hosts_up)) { $this->view->chart->drawPie(array( 'data' => array( diff --git a/modules/monitoring/application/views/scripts/chart/hostgroup.phtml b/modules/monitoring/application/views/scripts/chart/hostgroup.phtml index 1f98bb8db..b319d9a06 100644 --- a/modules/monitoring/application/views/scripts/chart/hostgroup.phtml +++ b/modules/monitoring/application/views/scripts/chart/hostgroup.phtml @@ -1,5 +1,5 @@ -
+
render(); ?> diff --git a/modules/monitoring/application/views/scripts/chart/servicegroup.phtml b/modules/monitoring/application/views/scripts/chart/servicegroup.phtml index 1f98bb8db..b319d9a06 100644 --- a/modules/monitoring/application/views/scripts/chart/servicegroup.phtml +++ b/modules/monitoring/application/views/scripts/chart/servicegroup.phtml @@ -1,5 +1,5 @@ -
+
render(); ?> diff --git a/public/css/icinga/widgets.less b/public/css/icinga/widgets.less index f68925cc0..8e0a624bb 100644 --- a/public/css/icinga/widgets.less +++ b/public/css/icinga/widgets.less @@ -173,3 +173,8 @@ ul.tree li a:hover { ul.tree li a.error:hover { color: @colorCritical; } + +/* charts should grow as much as possible but never beyond the current viewport's size */ +div.chart { + height: 90vh; +} From 66062c87b6d369f1fc1e738000c58e185abc641e Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Thu, 28 Aug 2014 10:55:06 +0200 Subject: [PATCH 057/257] Remove unused use Zend_Config --- application/controllers/DashboardController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/application/controllers/DashboardController.php b/application/controllers/DashboardController.php index 72824178d..45be7aced 100644 --- a/application/controllers/DashboardController.php +++ b/application/controllers/DashboardController.php @@ -2,7 +2,6 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Zend_Config; use Icinga\Web\Url; use Icinga\Logger\Logger; use Icinga\Config\PreservingIniWriter; From fdef695896d44c1c217a7ac4966aa93549d02fde Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 28 Aug 2014 11:34:08 +0200 Subject: [PATCH 058/257] Fix: The use statement with non-compound name 'Exception' has no effect --- .../monitoring/application/controllers/ConfigController.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/monitoring/application/controllers/ConfigController.php b/modules/monitoring/application/controllers/ConfigController.php index f0322dc3f..193a66044 100644 --- a/modules/monitoring/application/controllers/ConfigController.php +++ b/modules/monitoring/application/controllers/ConfigController.php @@ -2,13 +2,10 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Exception; - +use \Exception; use Icinga\Config\PreservingIniWriter; use Icinga\Web\Controller\ModuleActionController; use Icinga\Web\Notification; -use Icinga\Web\Url; - use Icinga\Module\Monitoring\Form\Config\ConfirmRemovalForm; use Icinga\Module\Monitoring\Form\Config\Backend\EditBackendForm; use Icinga\Module\Monitoring\Form\Config\Backend\CreateBackendForm; From c194c02435efee8fdb83af384312d3c6939082c2 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Thu, 28 Aug 2014 11:45:26 +0200 Subject: [PATCH 059/257] Remove useless 'use \Exception' --- modules/monitoring/application/controllers/ConfigController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/monitoring/application/controllers/ConfigController.php b/modules/monitoring/application/controllers/ConfigController.php index 193a66044..e5ba316d0 100644 --- a/modules/monitoring/application/controllers/ConfigController.php +++ b/modules/monitoring/application/controllers/ConfigController.php @@ -2,7 +2,6 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use \Exception; use Icinga\Config\PreservingIniWriter; use Icinga\Web\Controller\ModuleActionController; use Icinga\Web\Notification; From 22e17e9901278893947e89fb5700c438a117759a Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 28 Aug 2014 11:04:13 +0200 Subject: [PATCH 060/257] ResourceFactory: Move available function to platform refs #5514 --- .../Config/Authentication/LdapBackendForm.php | 3 ++- application/forms/Config/ResourceForm.php | 5 +++-- library/Icinga/Application/Platform.php | 15 +++++++++++++++ library/Icinga/Data/ResourceFactory.php | 15 --------------- .../Config/Authentication/LdapBackendFormTest.php | 2 -- .../forms/Config/Resource/ResourceFormTest.php | 2 -- 6 files changed, 20 insertions(+), 22 deletions(-) diff --git a/application/forms/Config/Authentication/LdapBackendForm.php b/application/forms/Config/Authentication/LdapBackendForm.php index 6dd0d9bd3..cf0afd631 100644 --- a/application/forms/Config/Authentication/LdapBackendForm.php +++ b/application/forms/Config/Authentication/LdapBackendForm.php @@ -5,6 +5,7 @@ namespace Icinga\Form\Config\Authentication; use Exception; +use Icinga\Application\Platform; use Zend_Config; use Icinga\Web\Form; use Icinga\Data\ResourceFactory; @@ -135,7 +136,7 @@ class LdapBackendForm extends BaseBackendForm */ public function isValidAuthenticationBackend() { - if (! ResourceFactory::ldapAvailable()) { + if (! Platform::ldapAvailable()) { /* * It should be possible to run icingaweb without the php ldap extension, when * no ldap backends are needed. When the user tries to create an ldap backend diff --git a/application/forms/Config/ResourceForm.php b/application/forms/Config/ResourceForm.php index 9a48c1f56..9ac85fadc 100644 --- a/application/forms/Config/ResourceForm.php +++ b/application/forms/Config/ResourceForm.php @@ -5,6 +5,7 @@ namespace Icinga\Form\Config; use Exception; +use Icinga\Application\Platform; use Zend_Config; use Zend_Form_Element_Checkbox; use Icinga\Web\Form; @@ -405,14 +406,14 @@ class ResourceForm extends Form * in case they aren't actually used. When the user tries to create a resource that depends on an * uninstalled extension, an error should be displayed. */ - if ($config->db === 'mysql' && !ResourceFactory::mysqlAvailable()) { + if ($config->db === 'mysql' && ! Platform::mysqlAvailable()) { $this->addErrorMessage( t('You need to install the php extension "mysql" and the ' . 'Zend_Pdo_Mysql classes to use MySQL database resources.') ); return false; } - if ($config->db === 'pgsql' && !ResourceFactory::pgsqlAvailable()) { + if ($config->db === 'pgsql' && ! Platform::pgsqlAvailable()) { $this->addErrorMessage( t('You need to install the php extension "pgsql" and the ' . 'Zend_Pdo_Pgsql classes to use PostgreSQL database resources.') diff --git a/library/Icinga/Application/Platform.php b/library/Icinga/Application/Platform.php index 30db869cf..258586da6 100644 --- a/library/Icinga/Application/Platform.php +++ b/library/Icinga/Application/Platform.php @@ -66,4 +66,19 @@ class Platform self::$domain = array_shift(preg_split('~\.~', self::$hostname, 2)); } } + + public static function ldapAvailable() + { + return extension_loaded('ldap'); + } + + public static function pgsqlAvailable() + { + return extension_loaded('pgsql'); + } + + public static function mysqlAvailable() + { + return extension_loaded('mysql'); + } } diff --git a/library/Icinga/Data/ResourceFactory.php b/library/Icinga/Data/ResourceFactory.php index 87f99c0e4..202e1005e 100644 --- a/library/Icinga/Data/ResourceFactory.php +++ b/library/Icinga/Data/ResourceFactory.php @@ -121,19 +121,4 @@ class ResourceFactory implements ConfigAwareFactory } return $resource; } - - public static function ldapAvailable() - { - return extension_loaded('ldap'); - } - - public static function pgsqlAvailable() - { - return extension_loaded('pgsql'); - } - - public static function mysqlAvailable() - { - return extension_loaded('mysql'); - } } diff --git a/test/php/application/forms/Config/Authentication/LdapBackendFormTest.php b/test/php/application/forms/Config/Authentication/LdapBackendFormTest.php index 1255b5957..ebd176099 100644 --- a/test/php/application/forms/Config/Authentication/LdapBackendFormTest.php +++ b/test/php/application/forms/Config/Authentication/LdapBackendFormTest.php @@ -68,8 +68,6 @@ class LdapBackendFormTest extends BaseTestCase protected function setUpResourceFactoryMock() { Mockery::mock('alias:Icinga\Data\ResourceFactory') - ->shouldReceive('ldapAvailable') - ->andReturn(true) ->shouldReceive('getResourceConfig') ->andReturn(new \Zend_Config(array())) ->shouldReceive('createResource') diff --git a/test/php/application/forms/Config/Resource/ResourceFormTest.php b/test/php/application/forms/Config/Resource/ResourceFormTest.php index ccfa9531a..6dba6ce54 100644 --- a/test/php/application/forms/Config/Resource/ResourceFormTest.php +++ b/test/php/application/forms/Config/Resource/ResourceFormTest.php @@ -261,8 +261,6 @@ class ResourceFormTest extends BaseTestCase protected function setUpResourceFactoryMock($resourceMock) { Mockery::mock('alias:Icinga\Data\ResourceFactory') - ->shouldReceive('mysqlAvailable') - ->andReturn(true) ->shouldReceive('createResource') ->with(Mockery::type('\Zend_Config')) ->andReturn($resourceMock); From 9b83074cc9ffd4e091c741c0d3c0053d8635963c Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 28 Aug 2014 11:08:57 +0200 Subject: [PATCH 061/257] Class doc for ResourceFactory refs #5514 --- library/Icinga/Data/ResourceFactory.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/library/Icinga/Data/ResourceFactory.php b/library/Icinga/Data/ResourceFactory.php index 202e1005e..7f166f066 100644 --- a/library/Icinga/Data/ResourceFactory.php +++ b/library/Icinga/Data/ResourceFactory.php @@ -14,13 +14,23 @@ use Icinga\Protocol\Statusdat\Reader as StatusdatReader; use Icinga\Protocol\Ldap\Connection as LdapConnection; use Icinga\Protocol\File\Reader as FileReader; +/** + * Create resources from names or resource configuration + */ class ResourceFactory implements ConfigAwareFactory { /** + * Resource configuration + * * @var Zend_Config */ private static $resources; + /** + * Set resource configurations + * + * @param Zend_Config $config + */ public static function setConfig($config) { self::$resources = $config; @@ -29,10 +39,11 @@ class ResourceFactory implements ConfigAwareFactory /** * Get the configuration for a specific resource * - * @param $resourceName String The resource's name + * @param $resourceName String The resource's name * - * @return Zend_Config The configuration of the resource - * @throws \Icinga\Exception\ConfigurationError + * @return Zend_Config The configuration of the resource + * + * @throws ConfigurationError */ public static function getResourceConfig($resourceName) { @@ -72,7 +83,7 @@ class ResourceFactory implements ConfigAwareFactory /** * Check if the existing resources are set. If not, throw an error. * - * @throws \Icinga\Exception\ProgrammingError + * @throws ProgrammingError */ private static function assertResourcesExist() { @@ -93,7 +104,7 @@ class ResourceFactory implements ConfigAwareFactory * * @return DbConnection|LdapConnection|LivestatusConnection|StatusdatReader An objects that can be used to access * the given resource. The returned class depends on the configuration property 'type'. - * @throws \Icinga\Exception\ConfigurationError When an unsupported type is given + * @throws ConfigurationError When an unsupported type is given */ public static function createResource(Zend_Config $config) { From 35d11bd1453b366d22a4b004ca8be6093b325bd9 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 28 Aug 2014 11:13:18 +0200 Subject: [PATCH 062/257] Class doc for Platform refs #5514 --- library/Icinga/Application/Platform.php | 68 +++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/library/Icinga/Application/Platform.php b/library/Icinga/Application/Platform.php index 258586da6..98f5acc44 100644 --- a/library/Icinga/Application/Platform.php +++ b/library/Icinga/Application/Platform.php @@ -4,22 +4,57 @@ namespace Icinga\Application; +/** + * Platform tests for icingaweb + */ class Platform { + /** + * Domain name + * + * @var string + */ protected static $domain; + + /** + * Host name + * + * @var string + */ protected static $hostname; + + /** + * Fully qualified domain name + * + * @var string + */ protected static $fqdn; + /** + * Test of windows + * + * @return bool + */ public static function isWindows() { return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'; } + /** + * Test of linux + * + * @return bool + */ public static function isLinux() { return strtoupper(substr(PHP_OS, 0, 5)) === 'LINUX'; } + /** + * Test of CLI environment + * + * @return bool + */ public static function isCli() { if (PHP_SAPI == 'cli') { @@ -31,6 +66,11 @@ class Platform return false; } + /** + * Get the hostname + * + * @return string + */ public static function getHostname() { if (self::$hostname === null) { @@ -39,6 +79,11 @@ class Platform return self::$hostname; } + /** + * Get the domain name + * + * @return string + */ public static function getDomain() { if (self::$domain === null) { @@ -47,6 +92,11 @@ class Platform return self::$domain; } + /** + * Get the fully qualified domain name + * + * @return string + */ public static function getFqdn() { if (self::$fqdn === null) { @@ -55,6 +105,9 @@ class Platform return self::$fqdn; } + /** + * Initialize domain and host strings + */ protected static function discoverHostname() { self::$hostname = gethostname(); @@ -67,16 +120,31 @@ class Platform } } + /** + * Test of php ldap support + * + * @return bool + */ public static function ldapAvailable() { return extension_loaded('ldap'); } + /** + * Test of php pgsql support + * + * @return bool + */ public static function pgsqlAvailable() { return extension_loaded('pgsql'); } + /** + * Test of php mysql support + * + * @return bool + */ public static function mysqlAvailable() { return extension_loaded('mysql'); From 9d0037a53a1cee3f659c7033c8993fc53553851c Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 28 Aug 2014 11:22:02 +0200 Subject: [PATCH 063/257] ResourceFactory: Add function create() The ConfigAwareFactory is an interface forcing "backend-type" classes to call ResourceFactory::createResource() passing a config they got in the constructor. That's kind of overdesigned, if the ResourceFactory wants to be something like a service locator it's responsabilities should include object instantiation. refs #5514 --- library/Icinga/Data/ResourceFactory.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/library/Icinga/Data/ResourceFactory.php b/library/Icinga/Data/ResourceFactory.php index 7f166f066..66127ff03 100644 --- a/library/Icinga/Data/ResourceFactory.php +++ b/library/Icinga/Data/ResourceFactory.php @@ -132,4 +132,15 @@ class ResourceFactory implements ConfigAwareFactory } return $resource; } + + /** + * Create a resource from name + * + * @param string $resourceName + * @return DbConnection|LdapConnection|LivestatusConnection|StatusdatReader + */ + public static function create($resourceName) + { + return self::createResource(self::getResourceConfig($resourceName)); + } } From 436a4d296541e50e073bcfe4934217c3454b10ba Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 28 Aug 2014 11:42:22 +0200 Subject: [PATCH 064/257] ResourceConfig: Chance createResouce to create Not useful everywhere. Changed on the best suitable places. refs #5514 --- application/controllers/ListController.php | 3 +-- application/forms/Config/Authentication/DbBackendForm.php | 3 +-- application/forms/Config/Authentication/LdapBackendForm.php | 2 +- modules/monitoring/library/Monitoring/Backend.php | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/application/controllers/ListController.php b/application/controllers/ListController.php index b790418f7..dac0cc68b 100644 --- a/application/controllers/ListController.php +++ b/application/controllers/ListController.php @@ -45,8 +45,7 @@ class ListController extends Controller file_exists($config_ini['logging']['target']) ) ) { - $config = ResourceFactory::getResourceConfig('logfile'); - $resource = ResourceFactory::createResource($config); + $resource = ResourceFactory::create('logfile'); $this->view->logData = $resource->select()->order('DESC')->paginate(); } else { $this->view->logData = null; diff --git a/application/forms/Config/Authentication/DbBackendForm.php b/application/forms/Config/Authentication/DbBackendForm.php index 82594280b..7184debdb 100644 --- a/application/forms/Config/Authentication/DbBackendForm.php +++ b/application/forms/Config/Authentication/DbBackendForm.php @@ -111,10 +111,9 @@ class DbBackendForm extends BaseBackendForm public function isValidAuthenticationBackend() { try { - $testConnection = ResourceFactory::createResource(ResourceFactory::getResourceConfig( + $dbUserBackend = new DbUserBackend(ResourceFactory::create( $this->getValue('backend_' . $this->filterName($this->getBackendName()) . '_resource') )); - $dbUserBackend = new DbUserBackend($testConnection); if ($dbUserBackend->count() < 1) { $this->addErrorMessage(t("No users found under the specified database backend")); return false; diff --git a/application/forms/Config/Authentication/LdapBackendForm.php b/application/forms/Config/Authentication/LdapBackendForm.php index cf0afd631..111824b9f 100644 --- a/application/forms/Config/Authentication/LdapBackendForm.php +++ b/application/forms/Config/Authentication/LdapBackendForm.php @@ -149,7 +149,7 @@ class LdapBackendForm extends BaseBackendForm $cfg = $this->getConfig(); $backendName = 'backend_' . $this->filterName($this->getBackendName()) . '_name'; $backendConfig = new Zend_Config($cfg[$this->getValue($backendName)]); - $backend = ResourceFactory::createResource(ResourceFactory::getResourceConfig($backendConfig->resource)); + $backend = ResourceFactory::create($backendConfig->resource); $testConn = new LdapUserBackend( $backend, $backendConfig->user_class, diff --git a/modules/monitoring/library/Monitoring/Backend.php b/modules/monitoring/library/Monitoring/Backend.php index e10c70d4e..34be4aff5 100644 --- a/modules/monitoring/library/Monitoring/Backend.php +++ b/modules/monitoring/library/Monitoring/Backend.php @@ -97,7 +97,7 @@ class Backend implements Selectable, Queryable, ConnectionInterface ); } } - $resource = ResourceFactory::createResource(ResourceFactory::getResourceConfig($backendConfig->resource)); + $resource = ResourceFactory::create($backendConfig->resource); if ($backendConfig->type === 'ido' && $resource->getDbType() !== 'oracle') { // TODO(el): The resource should set the table prefix $resource->setTablePrefix('icinga_'); From e345aa257aa580cd5513789e95ea229c50cc676b Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 28 Aug 2014 11:54:45 +0200 Subject: [PATCH 065/257] Platform: Drop *Available function Create a function extensionLoaded and change usages. refs #5514 --- .../Config/Authentication/LdapBackendForm.php | 2 +- application/forms/Config/ResourceForm.php | 4 +-- library/Icinga/Application/Platform.php | 28 ++++--------------- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/application/forms/Config/Authentication/LdapBackendForm.php b/application/forms/Config/Authentication/LdapBackendForm.php index 111824b9f..6eaea137c 100644 --- a/application/forms/Config/Authentication/LdapBackendForm.php +++ b/application/forms/Config/Authentication/LdapBackendForm.php @@ -136,7 +136,7 @@ class LdapBackendForm extends BaseBackendForm */ public function isValidAuthenticationBackend() { - if (! Platform::ldapAvailable()) { + if (! Platform::extensionLoaded('ldap')) { /* * It should be possible to run icingaweb without the php ldap extension, when * no ldap backends are needed. When the user tries to create an ldap backend diff --git a/application/forms/Config/ResourceForm.php b/application/forms/Config/ResourceForm.php index 9ac85fadc..de6be7699 100644 --- a/application/forms/Config/ResourceForm.php +++ b/application/forms/Config/ResourceForm.php @@ -406,14 +406,14 @@ class ResourceForm extends Form * in case they aren't actually used. When the user tries to create a resource that depends on an * uninstalled extension, an error should be displayed. */ - if ($config->db === 'mysql' && ! Platform::mysqlAvailable()) { + if ($config->db === 'mysql' && ! Platform::extensionLoaded('mysql')) { $this->addErrorMessage( t('You need to install the php extension "mysql" and the ' . 'Zend_Pdo_Mysql classes to use MySQL database resources.') ); return false; } - if ($config->db === 'pgsql' && ! Platform::pgsqlAvailable()) { + if ($config->db === 'pgsql' && ! Platform::extensionLoaded('pgsql')) { $this->addErrorMessage( t('You need to install the php extension "pgsql" and the ' . 'Zend_Pdo_Pgsql classes to use PostgreSQL database resources.') diff --git a/library/Icinga/Application/Platform.php b/library/Icinga/Application/Platform.php index 98f5acc44..1ca738741 100644 --- a/library/Icinga/Application/Platform.php +++ b/library/Icinga/Application/Platform.php @@ -121,32 +121,14 @@ class Platform } /** - * Test of php ldap support + * Test for php extension * - * @return bool - */ - public static function ldapAvailable() - { - return extension_loaded('ldap'); - } - - /** - * Test of php pgsql support + * @param string $extensionName E.g. mysql, ldap * - * @return bool + * @return bool */ - public static function pgsqlAvailable() + public static function extensionLoaded($extensionName) { - return extension_loaded('pgsql'); - } - - /** - * Test of php mysql support - * - * @return bool - */ - public static function mysqlAvailable() - { - return extension_loaded('mysql'); + return extension_loaded($extensionName); } } From 4e83bb098a6f0d246f2ce3f522bf5064cde5b262 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 28 Aug 2014 12:13:30 +0200 Subject: [PATCH 066/257] LdapBackendFormTest: Fix mock refs #5514 --- .../forms/Config/Authentication/LdapBackendFormTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/php/application/forms/Config/Authentication/LdapBackendFormTest.php b/test/php/application/forms/Config/Authentication/LdapBackendFormTest.php index ebd176099..209b7a675 100644 --- a/test/php/application/forms/Config/Authentication/LdapBackendFormTest.php +++ b/test/php/application/forms/Config/Authentication/LdapBackendFormTest.php @@ -70,8 +70,7 @@ class LdapBackendFormTest extends BaseTestCase Mockery::mock('alias:Icinga\Data\ResourceFactory') ->shouldReceive('getResourceConfig') ->andReturn(new \Zend_Config(array())) - ->shouldReceive('createResource') - ->with(Mockery::type('\Zend_Config')) + ->shouldReceive('create') ->andReturn(Mockery::mock('Icinga\Protocol\Ldap\Connection')); } } From c4c5bcdd48449661afe1ad88df0e9b1ffaf51c59 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 28 Aug 2014 13:39:49 +0200 Subject: [PATCH 067/257] ContactQuery: Change timeperiod joins to joinLeft() refs #7020 --- .../views/scripts/list/contacts.phtml | 4 ++++ .../views/scripts/show/contact.phtml | 21 ++++++++++++------- .../Backend/Ido/Query/ContactQuery.php | 4 ++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/contacts.phtml b/modules/monitoring/application/views/scripts/list/contacts.phtml index 9fc05de8e..e4647e95b 100644 --- a/modules/monitoring/application/views/scripts/list/contacts.phtml +++ b/modules/monitoring/application/views/scripts/list/contacts.phtml @@ -36,14 +36,18 @@ $contactHelper = $this->getHelper('ContactFlags');
+ contact_notify_service_timeperiod): ?>
: escape($contact->contact_notify_service_timeperiod) ?>
+ + contact_notify_host_timeperiod): ?>
: escape($contact->contact_notify_host_timeperiod) ?>
+
getHelper('ContactFlags'); -

translate('Commands'); ?>:

-
    - -
  • command_name; ?>
  • - -
+ +

translate('Commands'); ?>:

+
    + +
  • command_name; ?>
  • + +
+ +

translate('Notifications'); ?>:

- render('list/notifications.phtml') ?> + + render('list/notifications.phtml') ?> + +

translate('No notifications for this contact'); ?>

+ translate('No such contact'); ?>: diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php index 89fa37fcd..467e40fc0 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php @@ -95,12 +95,12 @@ class ContactQuery extends IdoQuery protected function joinTimeperiods() { - $this->select->join( + $this->select->joinLeft( array('ht' => $this->prefix . 'timeperiods'), 'ht.timeperiod_object_id = c.host_timeperiod_object_id', array() ); - $this->select->join( + $this->select->joinLeft( array('st' => $this->prefix . 'timeperiods'), 'st.timeperiod_object_id = c.service_timeperiod_object_id', array() From 0a2b504db85a8be8609e17cad31eef346c82f995 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 28 Aug 2014 13:41:21 +0200 Subject: [PATCH 068/257] Gracatar: Pre sized with 60px because of display latency refs #7020 --- .../monitoring/application/views/scripts/list/contacts.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/views/scripts/list/contacts.phtml b/modules/monitoring/application/views/scripts/list/contacts.phtml index e4647e95b..a31a79553 100644 --- a/modules/monitoring/application/views/scripts/list/contacts.phtml +++ b/modules/monitoring/application/views/scripts/list/contacts.phtml @@ -18,7 +18,7 @@ $contactHelper = $this->getHelper('ContactFlags'); } foreach ($contacts as $contact): ?> +compact) { ?> +
+ render(); ?> + render() : ''; ?> +
+ + render(); ?> + diff --git a/modules/monitoring/application/views/scripts/chart/servicegroup.phtml b/modules/monitoring/application/views/scripts/chart/servicegroup.phtml index b319d9a06..f24efe5ba 100644 --- a/modules/monitoring/application/views/scripts/chart/servicegroup.phtml +++ b/modules/monitoring/application/views/scripts/chart/servicegroup.phtml @@ -1,6 +1,8 @@ -
-render(); -?> -
+compact) { ?> +
+ render(); ?> +
+ + render(); ?> + diff --git a/public/css/icinga/widgets.less b/public/css/icinga/widgets.less index 7ea480a73..a5c540a1e 100644 --- a/public/css/icinga/widgets.less +++ b/public/css/icinga/widgets.less @@ -175,6 +175,7 @@ ul.tree li a.error:hover { } /* charts should grow as much as possible but never beyond the current viewport's size */ -div.chart { - height: 90vh; +.svg-container-responsive { + padding: 1.5em; + height: 80vh; } From a26370bb121a842ea9f485a2d9277915e6c98a0a Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 28 Aug 2014 18:25:19 +0200 Subject: [PATCH 077/257] Adjust PieCharts that are rendered without labels Center and resize PieCharts to use the full width and height of the available view port --- library/Icinga/Chart/Inline/PieChart.php | 2 +- library/Icinga/Chart/PieChart.php | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Chart/Inline/PieChart.php b/library/Icinga/Chart/Inline/PieChart.php index 7b2108720..f42034ebd 100644 --- a/library/Icinga/Chart/Inline/PieChart.php +++ b/library/Icinga/Chart/Inline/PieChart.php @@ -18,11 +18,11 @@ class PieChart extends Inline public function render($output = true) { $pie = new PieChartRenderer(); + $pie->alignTopLeft(); $pie->disableLegend(); $pie->drawPie(array( 'data' => $this->data, 'colors' => $this->colors, 'labels' => $this->labels )); - $pie->setWidth($this->width)->setHeight($this->height); if ($output) { echo $pie->render(); } else { diff --git a/library/Icinga/Chart/PieChart.php b/library/Icinga/Chart/PieChart.php index ac3772428..cc51f85b3 100644 --- a/library/Icinga/Chart/PieChart.php +++ b/library/Icinga/Chart/PieChart.php @@ -122,11 +122,16 @@ class PieChart extends Chart */ public function toSvg(RenderContext $ctx) { - $outerBox = new Canvas('outerGraph', new LayoutBox(33, -5, 40, 40)); - $innerBox = new Canvas('graph', new LayoutBox(0, 0, 100, 100)); $labelBox = $ctx->getDocument()->createElement('g'); if (!$this->noCaption) { + // Scale SVG to make room for captions + $outerBox = new Canvas('outerGraph', new LayoutBox(33, -5, 40, 40)); + $innerBox = new Canvas('graph', new LayoutBox(0, 0, 100, 100)); $innerBox->getLayout()->setPadding(10, 10, 10, 10); + } else { + $outerBox = new Canvas('outerGraph', new LayoutBox(1.5, -10, 124, 124)); + $innerBox = new Canvas('graph', new LayoutBox(0, 0, 100, 100)); + $innerBox->getLayout()->setPadding(0, 0, 0, 0); } $this->createContentClipBox($innerBox); $this->renderPies($innerBox, $labelBox); From 3642b7b6fc3ad0c66be78c3d4d190fe2418cecff Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 28 Aug 2014 18:27:30 +0200 Subject: [PATCH 078/257] Adjust CSS for inlinePies to be centered on the current line --- library/Icinga/Web/Widget/Chart/InlinePie.php | 2 +- modules/monitoring/application/views/helpers/Perfdata.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Web/Widget/Chart/InlinePie.php b/library/Icinga/Web/Widget/Chart/InlinePie.php index e4621ba09..da63ec403 100644 --- a/library/Icinga/Web/Widget/Chart/InlinePie.php +++ b/library/Icinga/Web/Widget/Chart/InlinePie.php @@ -50,7 +50,7 @@ class InlinePie extends AbstractWidget sparkType="pie"> diff --git a/modules/monitoring/application/views/helpers/Perfdata.php b/modules/monitoring/application/views/helpers/Perfdata.php index f4cffaea7..3c3c411b9 100644 --- a/modules/monitoring/application/views/helpers/Perfdata.php +++ b/modules/monitoring/application/views/helpers/Perfdata.php @@ -34,7 +34,7 @@ class Zend_View_Helper_Perfdata extends Zend_View_Helper_Abstract // TODO: Should we trust sprintf-style placeholders in perfdata titles? $pieChart->setTooltipFormat('{{label}}: {{formatted}} ({{percent}}%)'); } - $pieChart->setStyle('margin: 0.2em 0.5em 0.2em 0.5em;'); + // $pieChart->setStyle('margin: 0.2em 0.5em 0.2em 0.5em;'); $table[] = '' . $pieChart->render() . htmlspecialchars($perfdata->getLabel()) . ' ' From 62f502d2768ac2c351cbab8fab6ce02b28d78c7e Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 28 Aug 2014 15:13:15 +0200 Subject: [PATCH 079/257] Postgres/StatusQuery: Fix concatenation and group by refs #5896 --- .../Monitoring/Backend/Ido/Query/StatusQuery.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php index 2006228b1..d5da738a0 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php @@ -487,10 +487,10 @@ class StatusQuery extends IdoQuery { $sub = '(SELECT' . ' lc.object_id,' - . " CASE WHEN lc.entry_type = 1 THEN CONCAT('[' || c.author_name || '] ' || c.comment_data) ELSE NULL END AS last_comment_data," - . " CASE WHEN lc.entry_type = 2 THEN CONCAT('[' || c.author_name || '] ' || c.comment_data) ELSE NULL END AS last_downtime_data," - . " CASE WHEN lc.entry_type = 3 THEN CONCAT('[' || c.author_name || '] ' || c.comment_data) ELSE NULL END AS last_flapping_data," - . " CASE WHEN lc.entry_type = 4 THEN CONCAT('[' || c.author_name || '] ' || c.comment_data) ELSE NULL END AS last_ack_data" + . " CASE WHEN lc.entry_type = 1 THEN '[' || c.author_name || '] ' || c.comment_data ELSE NULL END AS last_comment_data," + . " CASE WHEN lc.entry_type = 2 THEN '[' || c.author_name || '] ' || c.comment_data ELSE NULL END AS last_downtime_data," + . " CASE WHEN lc.entry_type = 3 THEN '[' || c.author_name || '] ' || c.comment_data ELSE NULL END AS last_flapping_data," + . " CASE WHEN lc.entry_type = 4 THEN '[' || c.author_name || '] ' || c.comment_data ELSE NULL END AS last_ack_data" . ' FROM icinga_comments c' . ' JOIN (SELECT' . ' MAX(comment_id) as comment_id,' @@ -499,7 +499,8 @@ class StatusQuery extends IdoQuery . ' FROM icinga_comments' . ' WHERE entry_type = 1 OR entry_type = 4' . ' GROUP BY object_id, entry_type' - . ') lc ON lc.comment_id = c.comment_id GROUP BY lc.object_id)'; + . ') lc ON lc.comment_id = c.comment_id' + . ' GROUP BY lc.object_id, lc.entry_type, c.author_name, c.comment_data)'; return new Zend_Db_Expr($sub); } From 751d2e6d119cf6c8cfe1a578f49c9176b075b9e5 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Fri, 29 Aug 2014 10:57:05 +0200 Subject: [PATCH 080/257] ErrorController: Log exception and stacktrace refe #5896 --- application/controllers/ErrorController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index 7d30d62e5..074e2fdc2 100644 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -4,6 +4,7 @@ // namespace Icinga\Application\Controllers; +use Icinga\Logger\Logger; use Icinga\Web\Controller\ActionController; use Icinga\Application\Icinga; @@ -21,6 +22,10 @@ class ErrorController extends ActionController { $error = $this->_getParam('error_handler'); $exception = $error->exception; + + Logger::error($exception); + Logger::error('Stacktrace: %s', $exception->getTraceAsString()); + switch ($error->type) { case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE: case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER: From e46dd4bdfd000dea4aa259f011638ef61385d8c6 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Fri, 29 Aug 2014 11:37:20 +0200 Subject: [PATCH 081/257] DowntimeQuery: Postgres fixes Change is_fixed to boolean check and illegal postgres timerange of '0000-00-00 00:00:00'. refs #5896 --- .../library/Monitoring/Backend/Ido/Query/DowntimeQuery.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php index 1f5e17c6c..fe1152076 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php @@ -23,8 +23,8 @@ class DowntimeQuery extends IdoQuery 'downtime_triggered_by_id' => 'sd.triggered_by_id', 'downtime_scheduled_start' => 'UNIX_TIMESTAMP(sd.scheduled_start_time)', 'downtime_scheduled_end' => 'UNIX_TIMESTAMP(sd.scheduled_end_time)', - 'downtime_start' => "UNIX_TIMESTAMP(CASE WHEN sd.trigger_time != '0000-00-00 00:00:00' then sd.trigger_time ELSE sd.scheduled_start_time END)", - 'downtime_end' => 'CASE WHEN sd.is_fixed THEN UNIX_TIMESTAMP(sd.scheduled_end_time) ELSE UNIX_TIMESTAMP(sd.trigger_time) + sd.duration END', + 'downtime_start' => "UNIX_TIMESTAMP(CASE WHEN UNIX_TIMESTAMP(sd.trigger_time) > 0 then sd.trigger_time ELSE sd.scheduled_start_time END)", + 'downtime_end' => 'CASE WHEN sd.is_fixed > 0 THEN UNIX_TIMESTAMP(sd.scheduled_end_time) ELSE UNIX_TIMESTAMP(sd.trigger_time) + sd.duration END', 'downtime_duration' => 'sd.duration', 'downtime_is_in_effect' => 'sd.is_in_effect', 'downtime_internal_id' => 'sd.internal_downtime_id', From b4e9bad87a6b04a023289fb6d2e189c79f0edcea Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Fri, 29 Aug 2014 11:45:06 +0200 Subject: [PATCH 082/257] NotificationHistoryQuery: Add missing field to group statement refs #5896 --- .../Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php index e557f4c7b..64c7e69b8 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php @@ -85,7 +85,8 @@ class NotificationhistoryQuery extends IdoQuery $this->select->group('n.object_id') ->group('n.start_time') ->group('n.output') - ->group('n.state'); + ->group('n.state') + ->group('o.objecttype_id'); } $this->joinedVirtualTables = array('history' => true); From 30f391035c0c497e046e29ffa82766042750a80c Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Fri, 29 Aug 2014 13:41:41 +0200 Subject: [PATCH 083/257] Postgres/DbQuery: Add orderfields to select refs #6896 --- library/Icinga/Data/Db/DbQuery.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/library/Icinga/Data/Db/DbQuery.php b/library/Icinga/Data/Db/DbQuery.php index 605e36af9..a89544be8 100644 --- a/library/Icinga/Data/Db/DbQuery.php +++ b/library/Icinga/Data/Db/DbQuery.php @@ -89,6 +89,17 @@ class DbQuery extends SimpleQuery public function getSelectQuery() { $select = $this->dbSelect(); + + // Add order fields to select for postgres distinct queries (#6351) + if ($this->hasOrder() + && $this->getDatasource()->getDbType() === 'pgsql' + && $select->getPart(Zend_Db_Select::DISTINCT) === true) { + foreach ($this->getOrder() as $fieldAndDirection) { + list($alias, $field) = explode('.', $fieldAndDirection[0]); + $this->columns[$field] = $fieldAndDirection[0]; + } + } + $select->columns($this->columns); $this->applyFilterSql($select); @@ -102,6 +113,7 @@ class DbQuery extends SimpleQuery ); } } + return $select; } From 21f0b4c925ed133f1f253994b31f29ae419b118d Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Fri, 29 Aug 2014 16:52:09 +0200 Subject: [PATCH 084/257] CommandQuery: Remove select * from joins (Postgres) refs #5896 --- .../library/Monitoring/Backend/Ido/Query/CommandQuery.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommandQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommandQuery.php index 664cb3576..c730c078e 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommandQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommandQuery.php @@ -51,10 +51,12 @@ class CommandQuery extends IdoQuery { $this->select->join( array('cnc' => $this->prefix . 'contact_notificationcommands'), - 'cnc.command_object_id = co.object_id' + 'cnc.command_object_id = co.object_id', + array() )->join( array('con' => $this->prefix . 'contacts'), - 'con.contact_id = cnc.contact_id' + 'con.contact_id = cnc.contact_id', + array() ); } } \ No newline at end of file From f47bc466547e5bfe5d7b666e4af68292da4f16fc Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Mon, 1 Sep 2014 09:53:17 +0200 Subject: [PATCH 085/257] GroupSummary/Postgres: Fix group by in initial join query refs #5896 --- .../Monitoring/Backend/Ido/Query/GroupsummaryQuery.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php index 914441d03..3b7fdaa06 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php @@ -4,6 +4,7 @@ namespace Icinga\Module\Monitoring\Backend\Ido\Query; +use Icinga\Logger\Logger; use Zend_Db_Select; class GroupSummaryQuery extends IdoQuery @@ -69,8 +70,15 @@ class GroupSummaryQuery extends IdoQuery ) ); + $groupColumn = 'hostgroup'; + + if (in_array('servicegroup', $this->desiredColumns)) { + $groupColumn = 'servicegroup'; + } + $union = $this->db->select()->union(array($hosts, $services), Zend_Db_Select::SQL_UNION_ALL); - $this->select->from(array('statussummary' => $union), '*')->group($columns[0]); + $this->select->from(array('statussummary' => $union), array($groupColumn))->group(array($groupColumn)); + $this->joinedVirtualTables = array( 'servicestatussummary' => true, 'hoststatussummary' => true From 160fc900d0090c601d3e95a2fb696c746f6e27bc Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Mon, 1 Sep 2014 14:46:06 +0200 Subject: [PATCH 086/257] Backend: Set name if create default backend fixes #7043 --- .../monitoring/library/Monitoring/Backend.php | 3 ++ .../test/php/regression/Bug7043Test.php | 31 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 modules/monitoring/test/php/regression/Bug7043Test.php diff --git a/modules/monitoring/library/Monitoring/Backend.php b/modules/monitoring/library/Monitoring/Backend.php index 34be4aff5..f739b1a25 100644 --- a/modules/monitoring/library/Monitoring/Backend.php +++ b/modules/monitoring/library/Monitoring/Backend.php @@ -74,6 +74,9 @@ class Backend implements Selectable, Queryable, ConnectionInterface foreach (IcingaConfig::module('monitoring', 'backends') as $name => $config) { if (!(bool) $config->get('disabled', false) && $defaultBackend === null) { $defaultBackend = $config; + if ($backendName === null) { + $backendName = $name; + } } $allBackends[$name] = $config; } diff --git a/modules/monitoring/test/php/regression/Bug7043Test.php b/modules/monitoring/test/php/regression/Bug7043Test.php new file mode 100644 index 000000000..8759b4377 --- /dev/null +++ b/modules/monitoring/test/php/regression/Bug7043Test.php @@ -0,0 +1,31 @@ + array( + 'type' => 'db', + 'db' => 'mysql', + 'host' => 'localhost', + 'port' => '3306', + 'password' => 'icinga', + 'username' => 'icinga', + 'dbname' => 'icinga' + ) + )); + + ResourceFactory::setConfig($config); + + $defaultBackend = Backend::createBackend(); + + $this->assertNotNull($defaultBackend->getName(), 'Default backend has a name property set'); + } +} \ No newline at end of file From 6b6826f737ae486756736f9e98ed015cf7472c7a Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Mon, 1 Sep 2014 15:53:32 +0200 Subject: [PATCH 087/257] Bug7043Test: Fix test to run without ini configuration fixes #7043 --- library/Icinga/Application/Config.php | 12 +++++ .../test/php/regression/Bug7043Test.php | 49 +++++++++++++------ 2 files changed, 46 insertions(+), 15 deletions(-) diff --git a/library/Icinga/Application/Config.php b/library/Icinga/Application/Config.php index f794d46a0..f30684883 100644 --- a/library/Icinga/Application/Config.php +++ b/library/Icinga/Application/Config.php @@ -85,6 +85,18 @@ class Config extends Zend_Config return self::$app[$configname]; } + /** + * Set module config + * + * @param string $moduleName + * @param string $configName + * @param Zend_Config $config + */ + public static function setModuleConfig($moduleName, $configName, Zend_Config $config) + { + self::$modules[$moduleName][$configName] = $config; + } + /** * Retrieve a module config instance * diff --git a/modules/monitoring/test/php/regression/Bug7043Test.php b/modules/monitoring/test/php/regression/Bug7043Test.php index 8759b4377..37618a348 100644 --- a/modules/monitoring/test/php/regression/Bug7043Test.php +++ b/modules/monitoring/test/php/regression/Bug7043Test.php @@ -2,30 +2,49 @@ namespace Tests\Icinga\Module\Monitoring\Regression; -use Icinga\Data\ResourceFactory; +// Necessary as some of these tests disable phpunit's preservation +// of the global state (e.g. autoloaders are in the global state) +require_once realpath(dirname(__FILE__) . '/../../../../../test/php/bootstrap.php'); + +use Icinga\Application\Config; use Icinga\Module\Monitoring\Backend; use Icinga\Test\BaseTestCase; +use Mockery; +use Zend_Config; -class Bug7043 extends BaseTestCase +class Bug7043Test extends BaseTestCase { + public function tearDown() + { + parent::tearDown(); + Mockery::close(); // Necessary because some tests run in a separate process + } + + /** + * @runInSeparateProcess + * @preserveGlobalState disabled + */ public function testBackendDefaultName() { - $config = new \Zend_Config(array( - 'ido' => array( - 'type' => 'db', - 'db' => 'mysql', - 'host' => 'localhost', - 'port' => '3306', - 'password' => 'icinga', - 'username' => 'icinga', - 'dbname' => 'icinga' - ) - )); + Mockery::mock('alias:Icinga\Data\ResourceFactory') + ->shouldReceive('create') + ->andReturn( + Mockery::mock('Icinga\Data\Db\DbConnection') + ->shouldReceive('getDbType') + ->andReturn('mysql') + ->shouldReceive('setTablePrefix') + ->getMock() + ); - ResourceFactory::setConfig($config); + Config::setModuleConfig('monitoring', 'backends', new Zend_Config(array( + 'backendName' => array( + 'type' => 'ido', + 'resource' => 'ido' + ) + ))); $defaultBackend = Backend::createBackend(); - $this->assertNotNull($defaultBackend->getName(), 'Default backend has a name property set'); + $this->assertEquals('backendName', $defaultBackend->getName(), 'Default backend has name set'); } } \ No newline at end of file From 63cb357d48c9291b75dc3e1d9157971d5b6e0ea9 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Mon, 1 Sep 2014 15:58:55 +0200 Subject: [PATCH 088/257] TimelineController: Fix The use statement with non-compound ... fixes #7023 --- .../application/controllers/TimelineController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/monitoring/application/controllers/TimelineController.php b/modules/monitoring/application/controllers/TimelineController.php index 2f9b1339d..3fa621f3e 100644 --- a/modules/monitoring/application/controllers/TimelineController.php +++ b/modules/monitoring/application/controllers/TimelineController.php @@ -2,9 +2,9 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use DateTime; -use DateInterval; -use Zend_Config; +use \DateTime; +use \DateInterval; +use \Zend_Config; use Icinga\Web\Url; use Icinga\Util\Format; use Icinga\Application\Config; From 1c24273c9ba1b9434d7b5537cd422bbe60f06226 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Mon, 1 Sep 2014 16:11:34 +0200 Subject: [PATCH 089/257] Backend: Better implementation for createBackend Thanks eric! fixes #7043 --- .../monitoring/library/Monitoring/Backend.php | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend.php b/modules/monitoring/library/Monitoring/Backend.php index f739b1a25..a36bbe8a2 100644 --- a/modules/monitoring/library/Monitoring/Backend.php +++ b/modules/monitoring/library/Monitoring/Backend.php @@ -69,36 +69,31 @@ class Backend implements Selectable, Queryable, ConnectionInterface */ public static function createBackend($backendName = null) { - $allBackends = array(); - $defaultBackend = null; - foreach (IcingaConfig::module('monitoring', 'backends') as $name => $config) { - if (!(bool) $config->get('disabled', false) && $defaultBackend === null) { - $defaultBackend = $config; - if ($backendName === null) { - $backendName = $name; - } - } - $allBackends[$name] = $config; + $config = IcingaConfig::module('monitoring', 'backends'); + if ($config->count() === 0) { + throw new ConfigurationError(t('No backend has been configured')); } - if (empty($allBackends)) { - throw new ConfigurationError('No backend has been configured'); - } - if ($defaultBackend === null) { - throw new ConfigurationError('All backends are disabled'); - } - if ($backendName === null) { - $backendConfig = $defaultBackend; - } else { - if (!array_key_exists($backendName, $allBackends)) { + if ($backendName !== null) { + $backendConfig = $config->get($backendName); + if ($backendConfig === null) { throw new ConfigurationError('No configuration for backend %s', $backendName); } - $backendConfig = $allBackends[$backendName]; - if ((bool) $backendConfig->get('disabled', false)) { + if ((bool) $backendConfig->get('disabled', false) === true) { throw new ConfigurationError( - 'Configuration for backend %s available but backend is disabled', + t('Configuration for backend %s available but backend is disabled'), $backendName ); } + } else { + foreach ($config as $name => $backendConfig) { + if ((bool) $config->get('disabled', false) === false) { + $backendName = $name; + break; + } + } + if ($backendName === null) { + throw new ConfigurationError(t('All backends are disabled')); + } } $resource = ResourceFactory::create($backendConfig->resource); if ($backendConfig->type === 'ido' && $resource->getDbType() !== 'oracle') { From baf768040f0e9613f0fd8d738e57eb405f06b28c Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Tue, 2 Sep 2014 09:55:57 +0200 Subject: [PATCH 090/257] LdapQuery: Use Ldap/Exception for errors refs #5536 --- library/Icinga/Protocol/Ldap/Query.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/Icinga/Protocol/Ldap/Query.php b/library/Icinga/Protocol/Ldap/Query.php index ca8f5519f..b5c5e6858 100644 --- a/library/Icinga/Protocol/Ldap/Query.php +++ b/library/Icinga/Protocol/Ldap/Query.php @@ -4,8 +4,6 @@ namespace Icinga\Protocol\Ldap; -use Icinga\Exception\IcingaException; - /** * Search class * @@ -84,7 +82,7 @@ class Query public function limit($count = null, $offset = null) { if (! preg_match('~^\d+~', $count . $offset)) { - throw new IcingaException( + throw new Exception( 'Got invalid limit: %s, %s', $count, $offset @@ -316,7 +314,7 @@ class Query { $parts = array(); if (! isset($this->filters['objectClass']) || $this->filters['objectClass'] === null) { - // throw new IcingaException('Object class is mandatory'); + throw new Exception('Object class is mandatory'); } foreach ($this->filters as $key => $value) { $parts[] = sprintf( From ee6145a173671a7ab25785627a45a59983450d89 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Tue, 2 Sep 2014 10:17:01 +0200 Subject: [PATCH 091/257] Ldap/Query: Remove __toString() This is needed because of exception handling. Exceptions can now bubble up for default handling. Method render() was renamed to create() because the method create a query. Adjust the test for method create(). refs #5536 --- library/Icinga/Protocol/Ldap/Connection.php | 4 ++-- library/Icinga/Protocol/Ldap/Query.php | 12 +----------- test/php/library/Icinga/Protocol/Ldap/QueryTest.php | 4 ++-- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/library/Icinga/Protocol/Ldap/Connection.php b/library/Icinga/Protocol/Ldap/Connection.php index 531a399c8..6fa41e2aa 100644 --- a/library/Icinga/Protocol/Ldap/Connection.php +++ b/library/Icinga/Protocol/Ldap/Connection.php @@ -307,7 +307,7 @@ class Connection $results = @ldap_search( $this->ds, $base, - (string) $query, + $query->create(), $fields, 0, // Attributes and values 0 // No limit - at least where possible @@ -619,7 +619,7 @@ class Connection $result = @ldap_read( $ds, '', - (string) $query, + $query->create(), $query->listFields() ); diff --git a/library/Icinga/Protocol/Ldap/Query.php b/library/Icinga/Protocol/Ldap/Query.php index b5c5e6858..462c83d61 100644 --- a/library/Icinga/Protocol/Ldap/Query.php +++ b/library/Icinga/Protocol/Ldap/Query.php @@ -300,17 +300,7 @@ class Query * * @string */ - public function __toString() - { - return $this->render(); - } - - /** - * Returns the LDAP filter that will be applied - * - * @string - */ - protected function render() + public function create() { $parts = array(); if (! isset($this->filters['objectClass']) || $this->filters['objectClass'] === null) { diff --git a/test/php/library/Icinga/Protocol/Ldap/QueryTest.php b/test/php/library/Icinga/Protocol/Ldap/QueryTest.php index b710a0934..f3fa2c727 100644 --- a/test/php/library/Icinga/Protocol/Ldap/QueryTest.php +++ b/test/php/library/Icinga/Protocol/Ldap/QueryTest.php @@ -109,10 +109,10 @@ class QueryTest extends BaseTestCase $this->assertEquals('testIntColumn', $cols[0][0]); } - public function test__toString() + public function testCreateQuery() { $select = $this->prepareSelect(); $res = '(&(objectClass=dummyClass)(testIntColumn=1)(testStringColumn=test)(testWildcard=abc*))'; - $this->assertEquals($res, (string) $select); + $this->assertEquals($res, $select->create()); } } From a47c376fb3f993d0b821196a011dea06bff19f15 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Tue, 2 Sep 2014 04:19:38 -0400 Subject: [PATCH 092/257] Revert "Fixes dashboard title configuration" This reverts commit 968fa36cfd5123137b2d8189b3df723974c6a46d. --- modules/monitoring/configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/configuration.php b/modules/monitoring/configuration.php index ed5251ec1..9b12049e4 100644 --- a/modules/monitoring/configuration.php +++ b/modules/monitoring/configuration.php @@ -130,7 +130,7 @@ $section->add('performance info', $this->translate('Performance Info'), array( /* * Dashboard */ -$dashboard = $this->dashboard('current incidents')->setTitle($this->translate('Current Incidents')); +$dashboard = $this->dashboard('current-incidents', $this->translate('Current Incidents')); $dashboard->add( 'service problems', $this->translate('Service Problems'), From bb0e1dc105a08f14bb32e9aa95d8d2ab2b743516 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Tue, 2 Sep 2014 04:21:56 -0400 Subject: [PATCH 093/257] Revert "Fixes unaccepted behavior in module configuration" This reverts commit 236d384bab3c1b64f3fd9954487accc33aafe48a. --- library/Icinga/Application/Modules/Module.php | 15 ++--- library/Icinga/Web/Menu.php | 20 +++---- .../Icinga/Web/Widget/Dashboard/Component.php | 37 ++---------- library/Icinga/Web/Widget/Dashboard/Pane.php | 56 +++++++++--------- modules/doc/configuration.php | 3 +- modules/monitoring/configuration.php | 58 +++++++++---------- 6 files changed, 74 insertions(+), 115 deletions(-) diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index fc7c25b17..9cda4afdc 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -177,7 +177,6 @@ class Module /** * Add a pane to dashboard * - * @param $id * @param $name * @return Pane */ @@ -201,21 +200,19 @@ class Module /** * Add a menu Section to the Sidebar menu * - * @param string $id - * @param string $name + * @param $name * @param array $properties * @return mixed */ - protected function menuSection($id, $name, array $properties = array()) + protected function menuSection($name, array $properties = array()) { - if (array_key_exists($id, $this->menuItems)) { - $this->menuItems[$id]->setProperties($properties); + if (array_key_exists($name, $this->menuItems)) { + $this->menuItems[$name]->setProperties($properties); } else { - $this->menuItems[$id] = new Menu($id, new Zend_Config($properties)); - $this->menuItems[$id]->setTitle($name); + $this->menuItems[$name] = new Menu($name, new Zend_Config($properties)); } - return $this->menuItems[$id]; + return $this->menuItems[$name]; } /** diff --git a/library/Icinga/Web/Menu.php b/library/Icinga/Web/Menu.php index c5640ac09..2fa49b99c 100644 --- a/library/Icinga/Web/Menu.php +++ b/library/Icinga/Web/Menu.php @@ -5,7 +5,6 @@ namespace Icinga\Web; use Icinga\Exception\ConfigurationError; -use Icinga\Logger\Logger; use Zend_Config; use RecursiveIterator; use Icinga\Application\Config; @@ -173,34 +172,34 @@ class Menu implements RecursiveIterator */ protected function addMainMenuItems() { - $this->add('dashboard', t('Dashboard'), array( + $this->add(t('Dashboard'), array( 'url' => 'dashboard', 'icon' => 'img/icons/dashboard.png', 'priority' => 10 )); - $section = $this->add('system', t('System'), array( + $section = $this->add(t('System'), array( 'icon' => 'img/icons/configuration.png', 'priority' => 200 )); - $section->add('preferences', t('Preferences'), array( + $section->add(t('Preferences'), array( 'url' => 'preference', 'priority' => 200 )); - $section->add('configuration', t('Configuration'), array( + $section->add(t('Configuration'), array( 'url' => 'config', 'priority' => 300 )); - $section->add('modules', t('Modules'), array( + $section->add(t('Modules'), array( 'url' => 'config/modules', 'priority' => 400 )); - $section->add('applicationlog', t('ApplicationLog'), array( + $section->add(t('ApplicationLog'), array( 'url' => 'list/applicationlog', 'priority' => 500 )); - $this->add('logout', t('Logout'), array( + $this->add(t('Logout'), array( 'url' => 'authentication/logout', 'icon' => 'img/icons/logout.png', 'priority' => 300 @@ -428,10 +427,9 @@ class Menu implements RecursiveIterator * @param array $config * @return Menu */ - public function add($id, $name, $config = array()) + public function add($name, $config = array()) { - $config['title'] = $name; - return $this->addSubMenu($id, new Zend_Config($config)); + return $this->addSubMenu($name, new Zend_Config($config)); } /** diff --git a/library/Icinga/Web/Widget/Dashboard/Component.php b/library/Icinga/Web/Widget/Dashboard/Component.php index 71615c572..87f756282 100644 --- a/library/Icinga/Web/Widget/Dashboard/Component.php +++ b/library/Icinga/Web/Widget/Dashboard/Component.php @@ -30,13 +30,6 @@ class Component extends AbstractWidget */ private $url; - /** - * The id of this Component - * - * @var string - */ - private $id; - /** * The title being displayed on top of the component * @var @@ -67,14 +60,12 @@ EOD; /** * Create a new component displaying the given url in the provided pane * - * @param string $id The id to use for this component * @param string $title The title to use for this component * @param Url|string $url The url this component uses for displaying information * @param Pane $pane The pane this Component will be added to */ - public function __construct($id, $title, $url, Pane $pane) + public function __construct($title, $url, Pane $pane) { - $this->id = $id; $this->title = $title; $this->pane = $pane; if ($url instanceof Url) { @@ -195,14 +186,14 @@ EOD; /** * Create a @see Component instance from the given Zend config, using the provided title - * @param $id The id for this component + * * @param $title The title for this component * @param Zend_Config $config The configuration defining url, parameters, height, width, etc. * @param Pane $pane The pane this component belongs to * * @return Component A newly created Component for use in the Dashboard */ - public static function fromIni($id, $title, Zend_Config $config, Pane $pane) + public static function fromIni($title, Zend_Config $config, Pane $pane) { $height = null; $width = null; @@ -210,27 +201,7 @@ EOD; $parameters = $config->toArray(); unset($parameters['url']); // otherwise there's an url = parameter in the Url - $cmp = new Component($id, $title, Url::fromPath($url, $parameters), $pane); + $cmp = new Component($title, Url::fromPath($url, $parameters), $pane); return $cmp; } - - /** - * Set the components id - * - * @param $id string - */ - public function setId($id) - { - $this->id = $id; - } - - /** - * Retrieve the components id - * - * @return string - */ - public function getId() - { - return $this->id; - } } diff --git a/library/Icinga/Web/Widget/Dashboard/Pane.php b/library/Icinga/Web/Widget/Dashboard/Pane.php index edb3b6b77..39ad1fda3 100644 --- a/library/Icinga/Web/Widget/Dashboard/Pane.php +++ b/library/Icinga/Web/Widget/Dashboard/Pane.php @@ -83,44 +83,44 @@ class Pane extends AbstractWidget /** * Return true if a component with the given title exists in this pane * - * @param string $id The id of the component to check for existence + * @param string $title The title of the component to check for existence * * @return bool */ - public function hasComponent($id) + public function hasComponent($title) { - return array_key_exists($id, $this->components); + return array_key_exists($title, $this->components); } /** * Return a component with the given name if existing * - * @param string $id The id of the component to return + * @param string $title The title of the component to return * * @return Component The component with the given title * @throws ProgrammingError If the component doesn't exist */ - public function getComponent($id) + public function getComponent($title) { - if ($this->hasComponent($id)) { - return $this->components[$id]; + if ($this->hasComponent($title)) { + return $this->components[$title]; } throw new ProgrammingError( 'Trying to access invalid component: %s', - $id + $title ); } /** - * Removes the component with the given id if it exists in this pane + * Removes the component with the given title if it exists in this pane * - * @param string $id The pane + * @param string $title The pane * @return Pane $this */ - public function removeComponent($id) + public function removeComponent($title) { - if ($this->hasComponent($id)) { - unset($this->components[$id]); + if ($this->hasComponent($title)) { + unset($this->components[$title]); } return $this; } @@ -146,7 +146,6 @@ class Pane extends AbstractWidget /** * Add a component to this pane, optionally creating it if $component is a string * - * @param string $id An unique Identifier * @param string|Component $component The component object or title * (if a new component will be created) * @param string|null $url An Url to be used when component is a string @@ -154,12 +153,12 @@ class Pane extends AbstractWidget * @return self * @throws \Icinga\Exception\ConfigurationError */ - public function addComponent($id, $component, $url = null) + public function addComponent($component, $url = null) { if ($component instanceof Component) { - $this->components[$component->getId()] = $component; - } elseif (is_string($id) && is_string($component) && $url !== null) { - $this->components[$id] = new Component($id, $component, $url, $this); + $this->components[$component->getTitle()] = $component; + } elseif (is_string($component) && $url !== null) { + $this->components[$component] = new Component($component, $url, $this); } else { throw new ConfigurationError('Invalid component added: %s', $component); } @@ -176,15 +175,15 @@ class Pane extends AbstractWidget { /* @var $component Component */ foreach ($components as $component) { - if (array_key_exists($component->getId(), $this->components)) { - if (preg_match('/-(\d+)$/', $component->getId(), $m)) { - $name = preg_replace('/-\d+$/', $m[1]++, $component->getId()); + if (array_key_exists($component->getTitle(), $this->components)) { + if (preg_match('/_(\d+)$/', $component->getTitle(), $m)) { + $name = preg_replace('/_\d+$/', $m[1]++, $component->getTitle()); } else { - $name = $component->getId() . '-2'; + $name = $component->getTitle() . '_2'; } $this->components[$name] = $component; } else { - $this->components[$component->getId()] = $component; + $this->components[$component->getTitle()] = $component; } } @@ -194,18 +193,17 @@ class Pane extends AbstractWidget /** * Add a component to the current pane * - * @param $id * @param $title - * @param null $url - * @return mixed + * @param $url + * @return Component * * @see addComponent() */ - public function add($id, $title, $url = null) + public function add($title, $url = null) { - $this->addComponent($id, $title, $url); + $this->addComponent($title, $url); - return $this->components[$id]; + return $this->components[$title]; } /** diff --git a/modules/doc/configuration.php b/modules/doc/configuration.php index 06e900300..ce3f99113 100644 --- a/modules/doc/configuration.php +++ b/modules/doc/configuration.php @@ -4,7 +4,8 @@ /* @var $this \Icinga\Application\Modules\Module */ -$section = $this->menuSection('documentation', $this->translate('Documentation'), array( +$section = $this->menuSection($this->translate('Documentation'), array( + 'title' => 'Documentation', 'icon' => 'img/icons/comment.png', 'url' => 'doc', 'priority' => 80 diff --git a/modules/monitoring/configuration.php b/modules/monitoring/configuration.php index 9b12049e4..412581d24 100644 --- a/modules/monitoring/configuration.php +++ b/modules/monitoring/configuration.php @@ -22,73 +22,72 @@ $this->provideConfigTab('security', array( /* * Problems Section */ -$section = $this->menuSection('problems', $this->translate('Problems'), array( +$section = $this->menuSection($this->translate('Problems'), array( 'icon' => 'img/icons/error.png', 'priority' => 20 )); -$section->add('unhandled hosts', $this->translate('Unhandled Hosts'), array( +$section->add($this->translate('Unhandled Hosts'), array( 'url' => 'monitoring/list/hosts?host_problem=1&host_handled=0', 'priority' => 40 )); -$section->add('unhandled services', $this->translate('Unhandled Services'), array( +$section->add($this->translate('Unhandled Services'), array( 'url' => 'monitoring/list/services?service_problem=1&service_handled=0&sort=service_severity', 'priority' => 40 )); -$section->add('host problems', $this->translate('Host Problems'), array( +$section->add($this->translate('Host Problems'), array( 'url' => 'monitoring/list/hosts?host_problem=1&sort=host_severity', 'priority' => 50 )); -$section->add('service prolems', $this->translate('Service Problems'), array( +$section->add($this->translate('Service Problems'), array( 'url' => 'monitoring/list/services?service_problem=1&sort=service_severity&dir=desc', 'priority' => 50 )); -$section->add('current downtimes', $this->translate('Current Downtimes')) - ->setUrl('monitoring/list/downtimes?downtime_is_in_effect=1'); +$section->add($this->translate('Current Downtimes'))->setUrl('monitoring/list/downtimes?downtime_is_in_effect=1'); /* * Overview Section */ -$section = $this->menuSection('overview', $this->translate('Overview'), array( +$section = $this->menuSection($this->translate('Overview'), array( 'icon' => 'img/icons/hostgroup.png', 'priority' => 30 )); -$section->add('tactical overview', $this->translate('Tactical Overview'), array( +$section->add($this->translate('Tactical Overview'), array( 'url' => 'monitoring/tactical', 'priority' => 40 )); -$section->add('hosts', $this->translate('Hosts'), array( +$section->add($this->translate('Hosts'), array( 'url' => 'monitoring/list/hosts', 'priority' => 50 )); -$section->add('services', $this->translate('Services'), array( +$section->add($this->translate('Services'), array( 'url' => 'monitoring/list/services', 'priority' => 50 )); -$section->add('servicematrix', $this->translate('Servicematrix'), array( +$section->add($this->translate('Servicematrix'), array( 'url' => 'monitoring/list/servicematrix?service_problem=1', 'priority' => 51 )); -$section->add('servicegroups', $this->translate('Servicegroups'), array( +$section->add($this->translate('Servicegroups'), array( 'url' => 'monitoring/list/servicegroups', 'priority' => 60 )); -$section->add('hostgroups', $this->translate('Hostgroups'), array( +$section->add($this->translate('Hostgroups'), array( 'url' => 'monitoring/list/hostgroups', 'priority' => 60 )); -$section->add('contactgroups', $this->translate('Contactgroups'), array( +$section->add($this->translate('Contactgroups'), array( 'url' => 'monitoring/list/contactgroups', 'priority' => 61 )); -$section->add('downtimes', $this->translate('Downtimes'), array( +$section->add($this->translate('Downtimes'), array( 'url' => 'monitoring/list/downtimes', 'priority' => 71 )); -$section->add('comments', $this->translate('Comments'), array( +$section->add($this->translate('Comments'), array( 'url' => 'monitoring/list/comments?comment_type=(comment|ack)', 'priority' => 70 )); -$section->add('contacts', $this->translate('Contacts'), array( +$section->add($this->translate('Contacts'), array( 'url' => 'monitoring/list/contacts', 'priority' => 70 )); @@ -96,33 +95,31 @@ $section->add('contacts', $this->translate('Contacts'), array( /* * History Section */ -$section = $this->menuSection('history', $this->translate('History'), array( - 'title' => $this->translate('History'), +$section = $this->menuSection($this->translate('History'), array( 'icon' => 'img/icons/history.png' )); -$section->add('critical events', $this->translate('Critical Events'), array( - 'title' => $this->translate('Critical Events'), +$section->add($this->translate('Critical Events'), array( 'url' => 'monitoring/list/statehistorysummary', 'priority' => 50 )); -$section->add('notifications', $this->translate('Notifications'), array( +$section->add($this->translate('Notifications'), array( 'url' => 'monitoring/list/notifications' )); -$section->add('events', $this->translate('Events'), array( +$section->add($this->translate('Events'), array( 'title' => $this->translate('All Events'), 'url' => 'monitoring/list/eventhistory?timestamp>=-7%20days' )); -$section->add('timeline', $this->translate('Timeline'))->setUrl('monitoring/timeline'); +$section->add($this->translate('Timeline'))->setUrl('monitoring/timeline'); /* * System Section */ -$section = $this->menuSection('system', $this->translate('System')); -$section->add('process info', $this->translate('Process Info'), array( +$section = $this->menuSection($this->translate('System')); +$section->add($this->translate('Process Info'), array( 'url' => 'monitoring/process/info', 'priority' => 120 )); -$section->add('performance info', $this->translate('Performance Info'), array( +$section->add($this->translate('Performance Info'), array( 'url' => 'monitoring/process/performance', 'priority' => 130 )); @@ -130,19 +127,16 @@ $section->add('performance info', $this->translate('Performance Info'), array( /* * Dashboard */ -$dashboard = $this->dashboard('current-incidents', $this->translate('Current Incidents')); +$dashboard = $this->dashboard($this->translate('Current Incidents')); $dashboard->add( - 'service problems', $this->translate('Service Problems'), 'monitoring/list/services?service_problem=1&limit=10&sort=service_severity' ); $dashboard->add( - 'recently recovered services', $this->translate('Recently Recovered Services'), 'monitoring/list/services?service_state=0&limit=10&sort=service_last_state_change&dir=desc' ); $dashboard->add( - 'host problems', $this->translate('Host Problems'), 'monitoring/list/hosts?host_problem=1&sort=host_severity' ); From 8f124051e33ca59dcfddb86ae9034882521bbc8d Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 11:32:48 +0200 Subject: [PATCH 094/257] MonitoringBackend: use correct config object --- modules/monitoring/library/Monitoring/Backend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend.php b/modules/monitoring/library/Monitoring/Backend.php index a36bbe8a2..454a33cef 100644 --- a/modules/monitoring/library/Monitoring/Backend.php +++ b/modules/monitoring/library/Monitoring/Backend.php @@ -86,7 +86,7 @@ class Backend implements Selectable, Queryable, ConnectionInterface } } else { foreach ($config as $name => $backendConfig) { - if ((bool) $config->get('disabled', false) === false) { + if ((bool) $backendConfig->get('disabled', false) === false) { $backendName = $name; break; } From 4b55bcf8b6e86d56aa0ba50faf6166ca0a00e4d6 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Tue, 2 Sep 2014 12:24:29 +0200 Subject: [PATCH 095/257] Add tooltips to bar charts Add a class to format and populate tooltips from graph data sets and implement those tooltips in the ChartController. --- library/Icinga/Chart/Graph/BarGraph.php | 104 ++++++++++--- library/Icinga/Chart/Graph/StackedGraph.php | 4 + library/Icinga/Chart/Graph/Tooltip.php | 144 ++++++++++++++++++ library/Icinga/Chart/GridChart.php | 40 ++++- .../controllers/ChartController.php | 23 ++- 5 files changed, 286 insertions(+), 29 deletions(-) create mode 100644 library/Icinga/Chart/Graph/Tooltip.php diff --git a/library/Icinga/Chart/Graph/BarGraph.php b/library/Icinga/Chart/Graph/BarGraph.php index 968e4c0f7..3d6a5c234 100644 --- a/library/Icinga/Chart/Graph/BarGraph.php +++ b/library/Icinga/Chart/Graph/BarGraph.php @@ -16,6 +16,13 @@ use Icinga\Chart\Render\RenderContext; */ class BarGraph extends Styleable implements Drawable { + /** + * The dataset order + * + * @var int + */ + private $order = 0; + /** * The width of the bars. * @@ -30,14 +37,37 @@ class BarGraph extends Styleable implements Drawable */ private $dataSet; + /** + * The tooltips + * + * @var + */ + private $tooltips; + + /** + * All graphs + * + * @var + */ + private $graphs; + /** * Create a new BarGraph with the given dataset * - * @param array $dataSet An array of datapoints + * @param array $dataSet An array of data points + * @param int $order The graph number displayed by this BarGraph + * @param array $tooltips The tooltips to display for each value */ - public function __construct(array $dataSet) - { + public function __construct( + array $dataSet, + array &$graphs, + $order, + array $tooltips = null + ) { + $this->order = $order; $this->dataSet = $dataSet; + $this->tooltips = $tooltips; + $this->graphs = $graphs; } /** @@ -56,6 +86,30 @@ class BarGraph extends Styleable implements Drawable } } + /** + * Draw a single rectangle + * + * @param array $point The + * @param null $index + * @param string $fill The fill color to use + * @param $strokeWidth + * + * @return Rect + */ + private function drawSingleBar($point, $index = null, $fill, $strokeWidth) + { + $rect = new Rect($point[0] - ($this->barWidth / 2), $point[1], $this->barWidth, 100 - $point[1]); + $rect->setFill($fill); + $rect->setStrokeWidth($strokeWidth); + $rect->setStrokeColor('black'); + if (isset($index)) { + $rect->setAttribute('data-icinga-graph-index', $index); + } + $rect->setAttribute('data-icinga-graph-type', 'bar'); + $rect->setAdditionalStyle('clip-path: url(#clip);'); + return $rect; + } + /** * Render this BarChart * @@ -68,23 +122,33 @@ class BarGraph extends Styleable implements Drawable $doc = $ctx->getDocument(); $group = $doc->createElement('g'); $idx = 0; - foreach ($this->dataSet as $point) { - $rect = new Rect($point[0] - 2, $point[1], 4, 100 - $point[1]); - $rect->setFill($this->fill); - $rect->setStrokeWidth($this->strokeWidth); - $rect->setStrokeColor('black'); - $rect->setAttribute('data-icinga-graph-index', $idx++); - $rect->setAttribute('data-icinga-graph-type', 'bar'); - $rect->setAdditionalStyle('clip-path: url(#clip);'); - /*$rect->setAnimation( - new Animation( - 'y', - $ctx->yToAbsolute(100), - $ctx->yToAbsolute($point[1]), - rand(1, 1.5)/2 - ) - );*/ - $group->appendChild($rect->toSvg($ctx)); + foreach ($this->dataSet as $x => $point) { + // add white background bar, to prevent other bars from altering transparency effects + $bar = $this->drawSingleBar($point, $idx++, 'white', $this->strokeWidth, $idx)->toSvg($ctx); + $group->appendChild($bar); + + // draw actual bar + $bar = $this->drawSingleBar($point, null, $this->fill, $this->strokeWidth, $idx)->toSvg($ctx); + $bar->setAttribute('class', 'chart-data'); + if (isset($this->tooltips[$x])) { + $data = array( + 'label' => isset($this->graphs[$this->order]['label']) ? + strtolower($this->graphs[$this->order]['label']) : '', + 'color' => isset($this->graphs[$this->order]['color']) ? + strtolower($this->graphs[$this->order]['color']) : '#fff' + ); + $format = isset($this->graphs[$this->order]['tooltip']) + ? $this->graphs[$this->order]['tooltip'] : null; + $bar->setAttribute( + 'title', + $this->tooltips[$x]->renderNoHtml($this->order, $data, $format) + ); + $bar->setAttribute( + 'title-rich', + $this->tooltips[$x]->render($this->order, $data, $format) + ); + } + $group->appendChild($bar); } return $group; } diff --git a/library/Icinga/Chart/Graph/StackedGraph.php b/library/Icinga/Chart/Graph/StackedGraph.php index ae4f593e2..4339b8c8d 100644 --- a/library/Icinga/Chart/Graph/StackedGraph.php +++ b/library/Icinga/Chart/Graph/StackedGraph.php @@ -41,6 +41,10 @@ class StackedGraph implements Drawable if (!isset($this->points[$x])) { $this->points[$x] = 0; } + // store old y-value for displaying the actual (non-aggregated) + // value in the tooltip + $point[2] = $point[1]; + $this->points[$x] += $point[1]; $point[1] = $this->points[$x]; } diff --git a/library/Icinga/Chart/Graph/Tooltip.php b/library/Icinga/Chart/Graph/Tooltip.php new file mode 100644 index 000000000..b630c7c61 --- /dev/null +++ b/library/Icinga/Chart/Graph/Tooltip.php @@ -0,0 +1,144 @@ + + *
  • Global properties
  • : Key-value pairs that stay the same every time render is called, and are + * passed to an instance in the constructor. + *
  • Aggregated properties
  • : Global properties that are created automatically from + * all attached data points. + *
  • Local properties
  • : Key-value pairs that only apply to a single data point and + * are passed to the render-function. + * + */ +class Tooltip +{ + /** + * The default format string used + * when no other format is specified + * + * @var string + */ + private $defaultFormat; + + /** + * All aggregated points + * + * @var array + */ + private $points = array(); + + /** + * Contains all static replacements + * + * @var array + */ + private $data = array( + 'sum' => 0 + ); + + /** + * Used to format the displayed tooltip. + * + * @var string + */ + protected $tooltipFormat; + + /** + * Create a new tooltip with the specified default format string + * + * Allows you to set the global data for this tooltip, that is displayed every + * time render is called. + * + * @param array $data Map of global properties + * @param string $format The default format string + */ + public function __construct ( + $data = array(), + $format = '{title}
    {value} of {sum} {label}' + ) { + $this->data = array_merge($this->data, $data); + $this->defaultFormat = $format; + } + + /** + * Add a single data point to update the aggregated properties for this tooltip + * + * @param $point array Contains the (x,y) values of the data set + */ + public function addDataPoint($point) + { + // set x-value + if (!isset($this->data['title'])) { + $this->data['title'] = $point[0]; + } + + // aggregate y-values + $y = (int)$point[1]; + if (isset($point[2])) { + // load original value in case value already aggregated + $y = (int)$point[2]; + } + + if (!isset($this->data['min']) || $this->data['min'] > $y) { + $this->data['min'] = $y; + } + if (!isset($this->data['max']) || $this->data['max'] < $y) { + $this->data['max'] = $y; + } + $this->data['sum'] += $y; + $this->points[] = $y; + } + + /** + * Format the tooltip for a certain data point + * + * @param array $order Which data set to render + * @param array $data The local data for this tooltip + * @param string $format Use a custom format string for this data set + * + * @return mixed|string The tooltip value + */ + public function render($order, $data = array(), $format = null) + { + if (isset($format)) { + $str = $format; + } else { + $str = $this->defaultFormat; + } + $data['value'] = $this->points[$order]; + foreach (array_merge($this->data, $data) as $key => $value) { + $str = str_replace('{' . $key . '}', $value, $str); + } + return $str; + } + + /** + * Format the tooltip for a certain data point but remove all + * occurring html tags + * + * This is useful for rendering clean tooltips on client without JavaScript + * + * @param array $order Which data set to render + * @param array $data The local data for this tooltip + * @param string $format Use a custom format string for this data set + * + * @return mixed|string The tooltip value, without any HTML tags + */ + public function renderNoHtml($order, $data, $format) + { + return strip_tags($this->render($order, $data, $format)); + } +} \ No newline at end of file diff --git a/library/Icinga/Chart/GridChart.php b/library/Icinga/Chart/GridChart.php index ef1682921..190e09bf9 100644 --- a/library/Icinga/Chart/GridChart.php +++ b/library/Icinga/Chart/GridChart.php @@ -10,6 +10,7 @@ use Icinga\Chart\Axis; use Icinga\Chart\Graph\BarGraph; use Icinga\Chart\Graph\LineGraph; use Icinga\Chart\Graph\StackedGraph; +use Icinga\Chart\Graph\Tooltip; use Icinga\Chart\Primitive\Canvas; use Icinga\Chart\Primitive\Rect; use Icinga\Chart\Primitive\Path; @@ -74,6 +75,16 @@ class GridChart extends Chart */ private $stacks = array(); + /** + * An associative array containing all Tooltips used to render the titles + * + * Each tooltip represents the summary for all y-values of a certain x-value + * in the grid chart + * + * @var Tooltip + */ + private $tooltips = array(); + /** * Check if the current dataset has the proper structure for this chart. * @@ -169,6 +180,26 @@ class GridChart extends Chart $this->legend->addDataset($graph); } } + $this->initTooltips($data); + } + + + private function initTooltips($data) + { + foreach ($data as &$graph) { + foreach ($graph['data'] as $x => $point) { + if (!array_key_exists($x, $this->tooltips)) { + $this->tooltips[$x] = new Tooltip( + array( + 'color' => $graph['color'], + + ) + + ); + } + $this->tooltips[$x]->addDataPoint($point); + } + } } /** @@ -353,11 +384,16 @@ class GridChart extends Chart foreach ($this->graphs as $axisName => $graphs) { $axis = $this->axis[$axisName]; $graphObj = null; - foreach ($graphs as $graph) { + foreach ($graphs as $dataset => $graph) { // determine the type and create a graph object for it switch ($graph['graphType']) { case self::TYPE_BAR: - $graphObj = new BarGraph($axis->transform($graph['data'])); + $graphObj = new BarGraph( + $axis->transform($graph['data']), + $graphs, + $dataset, + $this->tooltips + ); break; case self::TYPE_LINE: $graphObj = new LineGraph($axis->transform($graph['data'])); diff --git a/modules/monitoring/application/controllers/ChartController.php b/modules/monitoring/application/controllers/ChartController.php index 305ff92bc..af6240259 100644 --- a/modules/monitoring/application/controllers/ChartController.php +++ b/modules/monitoring/application/controllers/ChartController.php @@ -154,30 +154,35 @@ class Monitoring_ChartController extends Controller ->setXAxis(new \Icinga\Chart\Unit\StaticAxis()) ->setAxisMin(null, 0); + $tooltip = t('{title}:
    {value} of {sum} services are {label}'); $this->view->chart->drawBars( array( 'label' => t('Ok'), 'color' => '#44bb77', 'stack' => 'stack1', - 'data' => $okBars + 'data' => $okBars, + 'tooltip' => $tooltip ), array( 'label' => t('Warning'), 'color' => '#ffaa44', 'stack' => 'stack1', - 'data' => $warningBars + 'data' => $warningBars, + 'tooltip' => $tooltip ), array( 'label' => t('Critical'), 'color' => '#ff5566', 'stack' => 'stack1', - 'data' => $critBars + 'data' => $critBars, + 'tooltip' => $tooltip ), array( 'label' => t('Unknown'), 'color' => '#dd66ff', 'stack' => 'stack1', - 'data' => $unknownBars + 'data' => $unknownBars, + 'tooltip' => $tooltip ) ); } @@ -201,6 +206,7 @@ class Monitoring_ChartController extends Controller $hostgroup->hosts_unreachable_unhandled ); } + $tooltip = t('{title}:
    {value} of {sum} hosts are {label}'); $this->view->chart = new GridChart(); $this->view->chart->alignTopLeft(); $this->view->chart->setAxisLabel('', t('Hosts')) @@ -211,19 +217,22 @@ class Monitoring_ChartController extends Controller 'label' => t('Up'), 'color' => '#44bb77', 'stack' => 'stack1', - 'data' => $upBars + 'data' => $upBars, + 'tooltip' => $tooltip ), array( 'label' => t('Down'), 'color' => '#ff5566', 'stack' => 'stack1', - 'data' => $downBars + 'data' => $downBars, + 'tooltip' => $tooltip ), array( 'label' => t('Unreachable'), 'color' => '#dd66ff', 'stack' => 'stack1', - 'data' => $unreachableBars + 'data' => $unreachableBars, + 'tooltip' => $tooltip ) ); } From 153013bbc6da7d6f056167b19d85d16035bdb5eb Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 12:28:25 +0200 Subject: [PATCH 096/257] Ido\StatusQuery: pending hosts are not problems --- .../library/Monitoring/Backend/Ido/Query/StatusQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php index d5da738a0..af52eb066 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php @@ -41,7 +41,7 @@ class StatusQuery extends IdoQuery 'host_next_check' => 'CASE hs.should_be_scheduled WHEN 1 THEN UNIX_TIMESTAMP(hs.next_check) ELSE NULL END', 'host_check_execution_time' => 'hs.execution_time', 'host_check_latency' => 'hs.latency', - 'host_problem' => 'CASE WHEN hs.current_state = 0 THEN 0 ELSE 1 END', + 'host_problem' => 'CASE WHEN COALESCE(hs.current_state, 0) = 0 THEN 0 ELSE 1 END', 'host_notifications_enabled' => 'hs.notifications_enabled', From 4a95b9d9427e9349c314681d7dca50f8f339530f Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 12:45:15 +0200 Subject: [PATCH 097/257] StatusSummaryQuery: respect pending, add columns --- .../Backend/Ido/Query/StatusSummaryQuery.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php index 75db67b55..6555010c2 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusSummaryQuery.php @@ -33,23 +33,27 @@ class StatusSummaryQuery extends IdoQuery 'hosts_flapping' => 'SUM(CASE WHEN object_type = \'host\' AND is_flapping = 1 THEN 1 ELSE 0 END)' ), 'servicestatussummary' => array( + 'services_total' => 'SUM(CASE WHEN object_type = \'service\' THEN 1 ELSE 0 END)', + 'services_problem' => 'SUM(CASE WHEN object_type = \'service\' AND state > 0 THEN 1 ELSE 0 END)', + 'services_problem_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state > 0 AND (acknowledged + in_downtime + host_problem) > 0 THEN 1 ELSE 0 END)', + 'services_problem_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state > 0 AND (acknowledged + in_downtime + host_problem) = 0 THEN 1 ELSE 0 END)', 'services_ok' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 THEN 1 ELSE 0 END)', 'services_ok_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', 'services_pending' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 THEN 1 ELSE 0 END)', 'services_pending_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', 'services_warning' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 THEN 1 ELSE 0 END)', - 'services_warning_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', - 'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', + 'services_warning_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + host_problem) > 0 THEN 1 ELSE 0 END)', + 'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + host_problem) = 0 THEN 1 ELSE 0 END)', 'services_warning_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', 'services_warning_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', 'services_critical' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 THEN 1 ELSE 0 END)', - 'services_critical_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', - 'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', + 'services_critical_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + host_problem) > 0 THEN 1 ELSE 0 END)', + 'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + host_problem) = 0 THEN 1 ELSE 0 END)', 'services_critical_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', 'services_critical_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', 'services_unknown' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 THEN 1 ELSE 0 END)', - 'services_unknown_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)', - 'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)', + 'services_unknown_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + host_problem) > 0 THEN 1 ELSE 0 END)', + 'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + host_problem) = 0 THEN 1 ELSE 0 END)', 'services_unknown_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND is_passive_checked = 1 THEN 1 ELSE 0 END)', 'services_unknown_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)', 'services_active' => 'SUM(CASE WHEN object_type = \'service\' AND is_active_checked = 1 THEN 1 ELSE 0 END)', @@ -131,6 +135,7 @@ class StatusSummaryQuery extends IdoQuery 'acknowledged' => 'hs.problem_has_been_acknowledged', 'in_downtime' => 'CASE WHEN (hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END', 'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END', + 'host_problem' => 'CASE WHEN COALESCE(hs.current_state, 0) = 0 THEN 0 ELSE 1 END', 'is_passive_checked' => 'CASE WHEN hs.active_checks_enabled = 0 AND hs.passive_checks_enabled = 1 THEN 1 ELSE 0 END', 'is_active_checked' => 'hs.active_checks_enabled', 'is_processing_events' => 'hs.event_handler_enabled', @@ -144,6 +149,7 @@ class StatusSummaryQuery extends IdoQuery 'acknowledged' => 'ss.problem_has_been_acknowledged', 'in_downtime' => 'CASE WHEN (ss.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END', 'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END', + 'host_problem' => 'CASE WHEN COALESCE(hs.current_state, 0) = 0 THEN 0 ELSE 1 END', 'is_passive_checked' => 'CASE WHEN ss.active_checks_enabled = 0 AND ss.passive_checks_enabled = 1 THEN 1 ELSE 0 END', 'is_active_checked' => 'ss.active_checks_enabled', 'is_processing_events' => 'ss.event_handler_enabled', From 6be31f4f51d6f1c6515afe1736861967267a9d59 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 12:47:03 +0200 Subject: [PATCH 098/257] Downtime*Query: use 1970-01-02 as "null" refs #7000 --- .../Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php | 2 +- .../Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php index 5d600be03..f9ec831a7 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php @@ -47,7 +47,7 @@ class DowntimeendhistoryQuery extends IdoQuery array('h' => $this->prefix . 'downtimehistory'), 'o.' . $this->object_id . ' = h.' . $this->object_id . ' AND o.is_active = 1', array() - )->where('h.actual_end_time > ?', '1970-01-01 00:00:00'); + )->where('h.actual_end_time > ?', '1970-01-02 00:00:00'); $this->joinedVirtualTables = array('downtimehistory' => true); } } diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php index e5a1bb8dc..01c56cd4d 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php @@ -47,7 +47,7 @@ class DowntimestarthistoryQuery extends IdoQuery array('h' => $this->prefix . 'downtimehistory'), 'o.' . $this->object_id . ' = h.' . $this->object_id . ' AND o.is_active = 1', array() - )->where('h.actual_start_time > ?', '1970-01-01 00:00:00'); + )->where('h.actual_start_time > ?', '1970-01-02 00:00:00'); $this->joinedVirtualTables = array('downtimehistory' => true); } } From 307787cfb76a2db12bb06be7d830467c776bce1d Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 12:54:38 +0200 Subject: [PATCH 099/257] DataView: use default sort order if none given We should not be forced to order(null) to have the default order, that should be the default in case order has not been called. refs #6644 --- .../library/Monitoring/DataView/DataView.php | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/modules/monitoring/library/Monitoring/DataView/DataView.php b/modules/monitoring/library/Monitoring/DataView/DataView.php index b8ccbb852..b7035a850 100644 --- a/modules/monitoring/library/Monitoring/DataView/DataView.php +++ b/modules/monitoring/library/Monitoring/DataView/DataView.php @@ -31,6 +31,8 @@ abstract class DataView implements Browsable, Filterable, Sortable protected $connection; + protected $isSorted = false; + /** * Create a new view * @@ -99,6 +101,7 @@ public function dump() protected function applyUrlFilter($request = null) { $url = Url::fromRequest(); + $limit = $url->shift('limit'); $sort = $url->shift('sort'); $dir = $url->shift('dir'); @@ -132,20 +135,19 @@ public function dump() } } - $order = isset($params['order']) ? $params['order'] : null; - if ($order !== null) { - if (strtolower($order) === 'desc') { - $order = self::SORT_DESC; - } else { - $order = self::SORT_ASC; + if (isset($params['sort'])) { + + $order = isset($params['order']) ? $params['order'] : null; + if ($order !== null) { + if (strtolower($order) === 'desc') { + $order = self::SORT_DESC; + } else { + $order = self::SORT_ASC; + } } + + $view->sort($params['sort'], $order); } - - $view->sort( - isset($params['sort']) ? $params['sort'] : null, - $order - ); - return $view; } @@ -226,6 +228,7 @@ public function dump() foreach ($sortColumns['columns'] as $column) { $this->query->order($column, $order); } + $this->isSorted = true; } return $this; } @@ -285,6 +288,7 @@ public function dump() */ public function getQuery() { + if (! $this->isSorted) { $this->sort(); } return $this->query; } From 8823db4214a23eb0cbf8ea8dae49d0a3143bd048 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Tue, 2 Sep 2014 12:56:29 +0200 Subject: [PATCH 100/257] Add documentation for bar chart tooltips --- doc/graphs.md | 74 ++++++++++++++++++++++++++++++++++- doc/res/GraphExample#7.1.png | Bin 0 -> 7438 bytes 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 doc/res/GraphExample#7.1.png diff --git a/doc/graphs.md b/doc/graphs.md index 46623f74c..3c898f7a6 100644 --- a/doc/graphs.md +++ b/doc/graphs.md @@ -238,6 +238,77 @@ the labels to show you can use the 'disableLegend()' call on the GridChart objec ![Various Line Graph Options][graph7] + +### Tooltips + +It is possible to specify custom tooltip format strings when creating bar charts. +Tooltips provide information about the points of each bar chart column, by aggregating +the values of all data sets with the same x-coordinate. + +When no custom format string is given, a sane default format string is used, but its usually +clearer for the user to describe the data of each chart more accurately with a custom one. + + +**Example #9.1: Bar Charts with custom tooltips** + + $this->chart->drawBars( + array( + 'label' => 'Hosts critical', + 'palette' => Palette::PROBLEM, + 'stack' => 'stack1', + 'data' => $data2, + 'tooltip' => '{title}
    {value} of {sum} hosts are ok.' + ), + array( + 'label' => 'Hosts warning', + 'stack' => 'stack1', + 'palette' => Palette::WARNING, + 'data' => $data, + 'tooltip' => '{title}
    Oh no, {value} of {sum} hosts are down!' + ) + ); + + +As you can see, you can specify a format string for each data set, which allows you to +pass a custom message for all "down" hosts, one custom message for all "Ok" hosts and so on. +In contrast to that, the aggregation of values works on a column basis and will give you the +sum of all y-values with the same x-coordinate and not the aggregation of all values of the data set. + +#### Rich Tooltips + +It is also possible to use HTML in the tooltip strings to create rich tooltip markups, which can +be useful to provide extended output that spans over multiple lines. Please keep in mind that +users without JavaScript will see the tooltip with all of its html-tags stripped. + +![Various Line Graph Options][graph7.1] + +#### Available replacements + +The available replacements depend on the used chart type, since the tooltip data is + instantiated and populated by the chart. All bar graphs have the following replacements available: + +Aggregated values, are calculated from the data points of each column: + + - sum: The amount of all Y-values of the current column + - max: The biggest occurring Y-value of the current column + - min: The smallest occurring Y-value of the current column + + +Column values are also defined by the current column, but are not +the product of any aggregation + + - title: The x-value of the current column + + +Row values are defined by the properties the current data set, and are only useful for rendering the +generic tooltip correctly, since you could also just directly write +those values into your custom tooltip. + + - label: The name of the current data set + - color: The color of this data set + + + ## Pie Charts ### The PieChart Object @@ -317,5 +388,6 @@ Rendering is straightforward, assuming $svg is the PieChart/GridChart object, yo [graph5]: res/GraphExample#5.png [graph6]: res/GraphExample#6.png [graph7]: res/GraphExample#7.png +[graph7.1]: res/GraphExample#7.1.png [graph8]: res/GraphExample#8.png -[graph9]: res/GraphExample#9.png \ No newline at end of file +[graph9]: res/GraphExample#9.png diff --git a/doc/res/GraphExample#7.1.png b/doc/res/GraphExample#7.1.png new file mode 100644 index 0000000000000000000000000000000000000000..8f678324753383ced2e0e97351cd379be18f3002 GIT binary patch literal 7438 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 literal 0 HcmV?d00001 From e75de8cf60c9be63f4505775cc8789b8d82c0c83 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 13:07:20 +0200 Subject: [PATCH 101/257] monitoring/list: redirect when posting new order refs #6644 --- .../application/controllers/ListController.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index e123cdb0f..bd380a787 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -34,8 +34,21 @@ class Monitoring_ListController extends Controller protected function hasBetterUrl() { + $request = $this->getRequest(); $url = clone($this->url); + if ($this->getRequest()->isPost()) { + + if ($request->getPost('sort')) { + $url->setParam('sort', $request->getPost('sort')); + if ($request->getPost('dir')) { + $url->setParam('dir', $request->getPost('dir')); + } else { + $url->removeParam('dir'); + } + return $url; + } + $q = $this->getRequest()->getPost('q'); } else { $q = $url->shift('q'); From 26339b128a9815f13c27a2042bd59c42c0a58d29 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Tue, 2 Sep 2014 13:16:21 +0200 Subject: [PATCH 102/257] Add disabled property and implement the functionality refs #6986 --- .../Icinga/Web/Widget/Dashboard/Component.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/library/Icinga/Web/Widget/Dashboard/Component.php b/library/Icinga/Web/Widget/Dashboard/Component.php index 87f756282..7410c6210 100644 --- a/library/Icinga/Web/Widget/Dashboard/Component.php +++ b/library/Icinga/Web/Widget/Dashboard/Component.php @@ -42,6 +42,13 @@ class Component extends AbstractWidget */ private $pane; + /** + * The disabled option is used to "delete" default dashlets provided by modules + * + * @var bool + */ + private $disabled = false; + /** * The template string used for rendering this widget * @@ -117,6 +124,26 @@ EOD; return $this; } + /** + * Set the disabled property + * + * @param boolean $disabled + */ + public function setDisabled($disabled) + { + $this->disabled = $disabled; + } + + /** + * Get the disabled property + * + * @return boolean + */ + public function getDisabled() + { + return $this->disabled; + } + /** * Return this component's structure as array * @@ -136,6 +163,10 @@ EOD; */ public function render() { + if ($this->disabled === true) { + return ''; + } + $view = $this->view(); $url = clone($this->url); $url->setParam('view', 'compact'); From 62c0f0be030454bb6a15240995911c84fa9a0c05 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 13:23:15 +0200 Subject: [PATCH 103/257] Web\Session: implement lazy loading fixes #7055 --- library/Icinga/Application/Web.php | 22 ---------------------- library/Icinga/Web/Session.php | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/library/Icinga/Application/Web.php b/library/Icinga/Application/Web.php index 2b45ad683..ecf863e9e 100644 --- a/library/Icinga/Application/Web.php +++ b/library/Icinga/Application/Web.php @@ -13,8 +13,6 @@ use Icinga\Logger\Logger; use Icinga\Web\Request; use Icinga\Web\Response; use Icinga\Web\View; -use Icinga\Web\Session\Session as BaseSession; -use Icinga\Web\Session; use Icinga\User; use Icinga\Util\Translator; use Icinga\Util\DateTimeFactory; @@ -59,13 +57,6 @@ class Web extends ApplicationBootstrap */ private $request; - /** - * Session object - * - * @var BaseSession - */ - private $session; - /** * User object * @@ -92,7 +83,6 @@ class Web extends ApplicationBootstrap ->setupErrorHandling() ->loadConfig() ->setupResourceFactory() - ->setupSession() ->setupUser() ->setupTimezone() ->setupLogger() @@ -172,7 +162,6 @@ class Web extends ApplicationBootstrap $this->setupFrontController(); $this->setupViewRenderer(); - return $this; } @@ -192,17 +181,6 @@ class Web extends ApplicationBootstrap return $this; } - /** - * Initialize a session provider - * - * @return self - */ - private function setupSession() - { - $this->session = Session::create(); - return $this; - } - /** * Inject dependencies into request * diff --git a/library/Icinga/Web/Session.php b/library/Icinga/Web/Session.php index 58bfc70bd..4723903e9 100644 --- a/library/Icinga/Web/Session.php +++ b/library/Icinga/Web/Session.php @@ -47,7 +47,7 @@ class Session public static function getSession() { if (self::$session === null) { - throw new ProgrammingError('No session created yet'); + self::create(); } return self::$session; From 8a5e274c8b41e47b09bf67c40dd4818d67271314 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 13:26:48 +0200 Subject: [PATCH 104/257] monitoring/show: handle format=sql after pagination --- modules/monitoring/application/controllers/ShowController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 1ad0f29dd..0200284ce 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -89,9 +89,8 @@ class Monitoring_ShowController extends Controller $this->getTabs()->activate('history'); //$this->view->object->populate(); $this->view->object->fetchEventHistory(); + $this->view->history = $this->view->object->eventhistory->paginate($this->params->get('limit', 50)); $this->handleFormatRequest($this->view->object->eventhistory); - $this->view->history = $this->view->object->eventhistory - ->paginate($this->params->get('limit', 50)); } public function servicesAction() From 19136b548a572e0141f10dafaf45fb015e868758 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Tue, 2 Sep 2014 13:56:18 +0200 Subject: [PATCH 105/257] StatusQuery: Separate last comment fields fixes #7057 --- .../Backend/Ido/Query/StatusQuery.php | 159 ++++++++++++++---- 1 file changed, 127 insertions(+), 32 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php index af52eb066..db5b316e1 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php @@ -278,20 +278,41 @@ class StatusQuery extends IdoQuery ELSE 0 END' ), + 'serviceproblemsummary' => array( 'host_unhandled_services' => 'sps.unhandled_services_count' ), - 'lasthostcomment' => array( - 'host_last_comment' => 'hlc.last_comment_data', - 'host_last_downtime' => 'hlc.last_downtime_data', - 'host_last_flapping' => 'hlc.last_flapping_data', - 'host_last_ack' => 'hlc.last_ack_data', + + 'lasthostcommentgeneric' => array( + 'host_last_comment' => 'hlcg.last_comment_data' ), - 'lastservicecomment' => array( - 'service_last_comment' => 'slc.last_comment_data', - 'service_last_downtime' => 'slc.last_downtime_data', - 'service_last_flapping' => 'slc.last_flapping_data', - 'service_last_ack' => 'slc.last_ack_data', + + 'lasthostcommentdowntime' => array( + 'host_last_downtime' => 'hlcd.last_downtime_data' + ), + + 'lasthostcommentflapping' => array( + 'host_last_flapping' => 'hlcf.last_flapping_data' + ), + + 'lasthostcommentack' => array( + 'host_last_ack' => 'hlca.last_ack_data' + ), + + 'lastservicecommentgeneric' => array( + 'service_last_comment' => 'slcg.last_comment_data' + ), + + 'lastservicecommentdowntime' => array( + 'service_last_downtime' => 'slcd.last_downtime_data' + ), + + 'lastservicecommentflapping' => array( + 'service_last_flapping' => 'slcf.last_flapping_data' + ), + + 'lastservicecommentack' => array( + 'service_last_ack' => 'slca.last_ack_data' ) ); @@ -483,42 +504,116 @@ class StatusQuery extends IdoQuery ); } - protected function getLastCommentSubQuery() + /** + * Create a subquery to join comments into status query + * @param int $entryType + * @param string $fieldName + * @return Zend_Db_Expr + */ + protected function getLastCommentSubQuery($entryType, $fieldName) { $sub = '(SELECT' - . ' lc.object_id,' - . " CASE WHEN lc.entry_type = 1 THEN '[' || c.author_name || '] ' || c.comment_data ELSE NULL END AS last_comment_data," - . " CASE WHEN lc.entry_type = 2 THEN '[' || c.author_name || '] ' || c.comment_data ELSE NULL END AS last_downtime_data," - . " CASE WHEN lc.entry_type = 3 THEN '[' || c.author_name || '] ' || c.comment_data ELSE NULL END AS last_flapping_data," - . " CASE WHEN lc.entry_type = 4 THEN '[' || c.author_name || '] ' || c.comment_data ELSE NULL END AS last_ack_data" + . ' c.object_id,' + . " '[' || c.author_name || '] ' || c.comment_data AS $fieldName" . ' FROM icinga_comments c' - . ' JOIN (SELECT' - . ' MAX(comment_id) as comment_id,' - . ' object_id,' - . ' entry_type' - . ' FROM icinga_comments' - . ' WHERE entry_type = 1 OR entry_type = 4' - . ' GROUP BY object_id, entry_type' - . ') lc ON lc.comment_id = c.comment_id' - . ' GROUP BY lc.object_id, lc.entry_type, c.author_name, c.comment_data)'; + . ' WHERE c.entry_type = ' . $entryType + . ' ORDER BY c.comment_id DESC LIMIT 1)'; + return new Zend_Db_Expr($sub); } - protected function joinLasthostcomment() + /** + * Join last host comment + */ + protected function joinLasthostcommentgeneric() { $this->select->joinLeft( - array('hlc' => $this->getLastCommentSubQuery()), - 'hlc.object_id = hs.host_object_id', + array('hlcg' => $this->getLastCommentSubQuery(1, 'last_comment_data')), + 'hlcg.object_id = hs.host_object_id', array() ); } - // TODO: Terribly slow. As I have no idea of how to fix this we should remove it. - protected function joinLastservicecomment() + /** + * Join last host downtime comment + */ + protected function joinLasthostcommentdowntime() { $this->select->joinLeft( - array('slc' => $this->getLastCommentSubQuery()), - 'slc.object_id = ss.service_object_id', + array('hlcd' => $this->getLastCommentSubQuery(2, 'last_downtime_data')), + 'hlcg.object_id = hs.host_object_id', + array() + ); + } + + /** + * Join last host flapping comment + */ + protected function joinLastHostcommentflapping() + { + $this->select->joinLeft( + array('hlcf' => $this->getLastCommentSubQuery(3, 'last_flapping_data')), + 'hlcg.object_id = hs.host_object_id', + array() + ); + } + + /** + * Join last host acknowledgement comment + */ + protected function joinLasthostcommentack() + { + $this->select->joinLeft( + array('hlca' => $this->getLastCommentSubQuery(4, 'last_ack_data')), + 'hlca.object_id = hs.host_object_id', + array() + ); + } + + /** + * Join last service comment + */ + protected function joinLastservicecommentgeneric() + { + $this->select->joinLeft( + array('slcg' => $this->getLastCommentSubQuery(1, 'last_comment_data')), + 'slcg.object_id = ss.service_object_id', + array() + ); + } + + /** + * Join last service downtime comment + */ + protected function joinLastservicecommentdowntime() + { + $this->select->joinLeft( + array('slcd' => $this->getLastCommentSubQuery(2, 'last_downtime_data')), + 'slcd.object_id = ss.service_object_id', + array() + ); + } + + /** + * Join last service flapping comment + */ + protected function joinLastservicecommentflapping() + { + $this->select->joinLeft( + array('slcf' => $this->getLastCommentSubQuery(3, 'last_flapping_data')), + 'slcf.object_id = ss.service_object_id', + array() + ); + } + + /** + * Join last service acknowledgement comment + */ + protected function joinLastservicecommentack() + { + $this->select->joinLeft( + array('slca' => $this->getLastCommentSubQuery(4, 'last_ack_data')), + 'slca.object_id = ss.service_object_id', array() ); } From d8e71d379063630a5f99cf63dd99f645fcd96fd4 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 14:07:46 +0200 Subject: [PATCH 106/257] monitoring/list: ignore post in applyFilter refs #6644 --- .../application/controllers/ListController.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index bd380a787..b71d78acf 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -501,15 +501,8 @@ class Monitoring_ListController extends Controller $request = $this->getRequest(); $limit = $params->shift('limit'); - - $sort = null; - $dir = null; - if ($request->isPost()) { - $sort = $request->getPost('sort', null); - $dir = $request->getPost('dir', null); - } - $sort = $params->shift('sort', $sort); - $dir = $params->shift('dir', $dir); + $sort = $params->shift('sort'); + $dir = $params->shift('dir'); $page = $params->shift('page'); $format = $params->shift('format'); $view = $params->shift('view'); @@ -546,7 +539,9 @@ class Monitoring_ListController extends Controller $query->applyFilter($filter); } $this->view->filter = $filter; - $query->order($sort, $dir); + if ($sort) { + $query->order($sort, $dir); + } $this->applyRestrictions($query); $this->handleFormatRequest($query); return $query; From a58b2aac004427dd43cfa549f99f71cb39ecf333 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 15:31:06 +0200 Subject: [PATCH 107/257] Ido\StatusQuery: join ALL latest comment And it was soooo fast :p refs #7057 --- .../library/Monitoring/Backend/Ido/Query/StatusQuery.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php index db5b316e1..d3aca9934 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php @@ -515,9 +515,10 @@ class StatusQuery extends IdoQuery $sub = '(SELECT' . ' c.object_id,' . " '[' || c.author_name || '] ' || c.comment_data AS $fieldName" - . ' FROM icinga_comments c' - . ' WHERE c.entry_type = ' . $entryType - . ' ORDER BY c.comment_id DESC LIMIT 1)'; + . ' FROM icinga_comments c JOIN (' + . ' SELECT MAX(comment_id) AS comment_id, object_id FROM icinga_comments' + . ' WHERE entry_type = ' . $entryType . ' GROUP BY object_id' + . ' ) lc ON c.comment_id = lc.comment_id)'; return new Zend_Db_Expr($sub); } From ff6483cec5793202c9b5f4ddaea3e4abf7fee37e Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 16:22:48 +0200 Subject: [PATCH 108/257] Web\FileCache: initial implementation refs #6927 --- library/Icinga/Web/FileCache.php | 275 +++++++++++++++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 library/Icinga/Web/FileCache.php diff --git a/library/Icinga/Web/FileCache.php b/library/Icinga/Web/FileCache.php new file mode 100644 index 000000000..16c89a2a4 --- /dev/null +++ b/library/Icinga/Web/FileCache.php @@ -0,0 +1,275 @@ +name = $name; + $tmpdir = sys_get_temp_dir(); + $basedir = $tmpdir . '/FileCache_' . $name; + + if (file_exists($basedir) && is_writeable($basedir)) { + + $this->basedir = $basedir; + $this->enabled = true; + + } elseif (file_exists($tmpdir) && is_writeable($tmpdir)) { + + if (mkdir($basedir, '0750', true)) { + $this->enabled = true; + $this->basedir = $basedir; + } + + } + } + + /** + * Store the given content to the desired file name + * + * @param string $file new (relative) filename + * @param string $content the content to be stored + * + * @return bool whether the file has been stored + */ + public function store($file, $content) + { + if (! $this->enabled) { + + return false; + } + + return file_put_contents($this->filename($file), $content); + } + + /** + * Find out whether a given file exists + * + * @param string $file the (relative) filename + * @param int $newerThan optional timestamp to compare against + * + * @return bool whether such file exists + */ + public function has($file, $newerThan = null) + { + if (! $this->enabled) { + + return false; + } + + $filename = $this->filename($file); + + if (! file_exists($filename) || ! is_readable($filename)) { + + return false; + } + + if ($newerThan === null) { + + return true; + } + + $info = stat($file); + + if ($info === false) { + + return false; + } + + return (int) $newerThan < $info['mtime']; + } + + /** + * Get a specific file or false if no such file available + * + * @param string $file the disired file name + * + * @return string|bool Filename content or false + */ + public function get($file) + { + if ($this->has($file)) { + return file_get_contents($this->filename($file)); + } + + return false; + } + + /** + * Send a specific file to the browser (output) + * + * @param string $file the disired file name + * + * @return bool Whether the file has been sent + */ + public function send($file) + { + if ($this->has($file)) { + readfile($this->filename($file)); + + return true; + } + + return false; + } + + /** + * Get absolute filename for a given file + * + * @param string $file the disired file name + * + * @return string absolute filename + */ + protected function filename($file) + { + return $this->basedir . '/' . $file; + } + + /** + * Whether the given ETag matches a cached file + * + * If no ETag is given we'll try to fetch the one from the current + * HTTP request. + * + * @param string $file The cached file you want to check + * @param string $match The ETag to match against + * + * @return string|bool ETag on match, otherwise false + */ + public function etagMatchesCachedFile($file, $match = null) + { + return self::etagMatchesFiles($this->filename($file), $match); + } + + /** + * Create an ETag for the given file + * + * @param string $file The desired cache file + * + * @return string your ETag + */ + public function etagForCachedFile($file) + { + return self::etagForFiles($this->filename($file)); + } + + /** + * Whether the given ETag matchesspecific file(s) on disk + * + * If no ETag is given we'll try to fetch the one from the current + * HTTP request. + * + * @param string|array $files file(s) to check + * @param string $match ETag to match against + * + * @return string|bool ETag on match, otherwise false + */ + public static function etagMatchesFiles($files, $match = null) + { + if ($match === null) { + $match = isset($_SERVER['HTTP_IF_NONE_MATCH']) + ? trim($_SERVER['HTTP_IF_NONE_MATCH'], '"') + : false; + } + if (! $match) { + return false; + } + + $etag = self::etagForFiles($files); + return $match === $etag ? $etag : false; + } + + /** + * Create ETag for the given files + * + * Custom algorithm creating an ETag based on filenames, mtimes + * and file sizes. Supports single files or a list of files. This + * way we are able to create ETags for virtual files depending on + * multiple source files (e.g. compressed JS, CSS). + * + * @param string|array $files Single file or a list of such + * + * @return string The generated ETag + */ + public static function etagForFiles($files) + { + if (is_string($files)) { + $files = array($files); + } + + $sizes = array(); + $mtimes = array(); + + foreach ($files as $file) { + $file = realpath($file); + if ($file !== false && $info = stat($file)) { + $mtimes[] = $info['mtime']; + $sizes[] = $info['size']; + } else { + $mtimes[] = time(); + $sizes[] = 0; + } + } + + return sprintf( + '%s-%s-%s', + hash('crc32', implode('|', $files)), + hash('crc32', implode('|', $sizes)), + hash('crc32', implode('|', $mtimes)) + ); + } + + /** + * Factory creating your cache instance + * + * @param string $name Instance name + * + * @return FileCache + */ + public static function instance($name = 'icingaweb') + { + if ($name !== 'icingaweb') { + $name = 'icingaweb/modules/' . $name; + } + + if (!array_key_exists($name, self::$instances)) { + self::$instances[$name] = new static($name); + } + + return self::$instances[$name]; + } +} From f0d6cf994e56eba3fd370b1b666dabe7f04bfcd5 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 16:24:55 +0200 Subject: [PATCH 109/257] Web\StyleSheet: use Cache and ETags --- library/Icinga/Web/StyleSheet.php | 40 ++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/library/Icinga/Web/StyleSheet.php b/library/Icinga/Web/StyleSheet.php index fedd8207a..808c43c70 100644 --- a/library/Icinga/Web/StyleSheet.php +++ b/library/Icinga/Web/StyleSheet.php @@ -5,6 +5,7 @@ namespace Icinga\Web; use Icinga\Application\Icinga; +use Icinga\Web\FileCache; use Icinga\Web\LessCompiler; class StyleSheet @@ -44,28 +45,45 @@ class StyleSheet public static function send($minified = false) { + $app = Icinga::app(); + $basedir = $app->getBootstrapDirecory(); + foreach (self::$lessFiles as $file) { + $lessFiles[] = $basedir . '/' . $file; + } + $files = $lessFiles; + foreach ($app->getModuleManager()->getLoadedModules() as $name => $module) { + if ($module->hasCss()) { + $files[] = $module->getCssFilename(); + } + } + + if ($etag = FileCache::etagMatchesFiles($files)) { + header("HTTP/1.1 304 Not Modified"); + return; + } else { + $etag = FileCache::etagForFiles($files); + } + header('Cache-Control: public'); + header('ETag: "' . $etag . '"'); header('Content-Type: text/css'); $min = $minified ? '.min' : ''; - $cacheFile = '/tmp/cache_icinga' . $min . '.css'; - if (file_exists($cacheFile)) { - readfile($cacheFile); - exit; + $cacheFile = 'icinga-' . $etag . $min . '.css'; + $cache = FileCache::instance(); + if ($cache->has($cacheFile)) { + $cache->send($cacheFile); + return; } - $less = new LessCompiler(); - $basedir = Icinga::app()->getBootstrapDirecory(); - foreach (self::$lessFiles as $file) { - $less->addFile($basedir . '/' . $file); + foreach ($lessFiles as $file) { + $less->addFile($file); } $less->addLoadedModules(); if ($minified) { $less->compress(); } $out = $less->compile(); - // Not yet, this is for tests only. Waiting for Icinga\Web\Cache - // file_put_contents($cacheFile, $out); + $cache->store($cacheFile, $out); echo $out; - } } From e4687a60f939be8d9a349d00f102e8210953d04b Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 16:25:44 +0200 Subject: [PATCH 110/257] Web\JavaScript: use Cache and ETags refs #6927 --- library/Icinga/Web/JavaScript.php | 51 ++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/library/Icinga/Web/JavaScript.php b/library/Icinga/Web/JavaScript.php index 2f4ef0485..e2b170cec 100644 --- a/library/Icinga/Web/JavaScript.php +++ b/library/Icinga/Web/JavaScript.php @@ -5,6 +5,7 @@ namespace Icinga\Web; use Icinga\Application\Icinga; +use Icinga\Web\FileCache; use JShrink\Minifier; class JavaScript @@ -62,36 +63,58 @@ class JavaScript $js = $out = ''; $min = $minified ? '.min' : ''; - // TODO: Cache header - header('Content-Type: application/javascript'); - $cacheFile = '/tmp/cache_icinga' . $min . '.js'; - if (file_exists($cacheFile)) { - readfile($cacheFile); - exit; - } - - // We do not minify vendor files + // Prepare vendor file list + $vendorFiles = array(); foreach (self::$vendorFiles as $file) { - $out .= file_get_contents($basedir . '/' . $file . $min . '.js'); + $vendorFiles[] = $basedir . '/' . $file . $min . '.js'; } + // Prepare Icinga JS file list + $jsFiles = array(); foreach (self::$jsFiles as $file) { - $js .= file_get_contents($basedir . '/' . $file); + $jsFiles[] = $basedir . '/' . $file; } foreach (Icinga::app()->getModuleManager()->getLoadedModules() as $name => $module) { if ($module->hasJs()) { - $js .= file_get_contents($module->getJsFilename()); + $jsFiles[] = $module->getJsFilename(); } } + $files = array_merge($vendorFiles, $jsFiles); + + if ($etag = FileCache::etagMatchesFiles($files)) { + header("HTTP/1.1 304 Not Modified"); + return; + } else { + $etag = FileCache::etagForFiles($files); + } + header('Cache-Control: public'); + header('ETag: "' . $etag . '"'); + header('Content-Type: application/javascript'); + + $cacheFile = 'icinga-' . $etag . $min . '.js'; + $cache = FileCache::instance(); + if ($cache->has($cacheFile)) { + $cache->send($cacheFile); + return; + } + + // We do not minify vendor files + foreach ($vendorFiles as $file) { + $out .= file_get_contents($file); + } + + foreach ($jsFiles as $file) { + $js .= file_get_contents($file); + } + if ($minified) { require_once 'IcingaVendor/JShrink/Minifier.php'; $out .= Minifier::minify($js, array('flaggedComments' => false)); } else { $out .= $js; } - // Not yet, this is for tests only. Waiting for Icinga\Web\Cache - // file_put_contents($cacheFile, $out); + $cache->store($cacheFile, $out); echo $out; } } From 4cef333add9b12a52b26c14362fcb4dcba286817 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 16:28:27 +0200 Subject: [PATCH 111/257] Modules\Module: implement listLocales fixes #7054 --- library/Icinga/Application/Modules/Module.php | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index 9cda4afdc..d0bf451ee 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -708,12 +708,44 @@ class Module */ protected function registerLocales() { - if (file_exists($this->localedir) && is_dir($this->localedir)) { + if ($this->hasLocales()) { Translator::registerDomain($this->name, $this->localedir); } return $this; } + /** + * return bool Whether this module has translations + */ + public function hasLocales() + { + return file_exists($this->localedir) && is_dir($this->localedir); + } + + /** + * List all available locales + * + * return array Locale list + */ + public function listLocales() + { + $locales = array(); + if (! $this->hasLocales()) { + return $locales; + } + + $dh = opendir($this->localedir); + while (false !== ($file = readdir($dh))) { + $filename = $this->localedir . DIRECTORY_SEPARATOR . $file; + if (preg_match('/^[a-z]{2}_[A-Z]{2}$/', $file) && is_dir($filename)) { + $locales[] = $file; + } + } + closedir($dh); + sort($locales); + return $locales; + } + /** * Register web integration * From 8577940e1e476167690e0af0bdc44bb38e8e660e Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 16:31:38 +0200 Subject: [PATCH 112/257] StaticController: cache gravatar images fixes #7061 --- application/controllers/StaticController.php | 22 ++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/application/controllers/StaticController.php b/application/controllers/StaticController.php index 51b5fdb62..c90272ffc 100644 --- a/application/controllers/StaticController.php +++ b/application/controllers/StaticController.php @@ -2,10 +2,11 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Zend_Controller_Action_Exception as ActionException; use Icinga\Web\Controller\ActionController; use Icinga\Application\Icinga; use Icinga\Logger\Logger; +use Icinga\Web\FileCache; +use Zend_Controller_Action_Exception as ActionException; /** * Delivery static content to clients @@ -30,8 +31,25 @@ class StaticController extends ActionController public function gravatarAction() { + $cache = FileCache::instance(); + $filename = md5(strtolower(trim($this->_request->getParam('email')))); + $cacheFile = 'gravatar-' . $filename; + header('Cache-Control: public'); + header('Pragma: cache'); + if ($etag = $cache->etagMatchesCachedFile($cacheFile)) { + header("HTTP/1.1 304 Not Modified"); + return; + } + header('Content-Type: image/jpg'); - $img = file_get_contents('http://www.gravatar.com/avatar/' . md5(strtolower(trim($this->_request->getParam('email')))) . '?s=200&d=mm'); + if ($cache->has($cacheFile)) { + header('ETag: "' . $cache->etagForCachedFile($cacheFile) . '"'); + $cache->send($cacheFile); + return; + } + $img = file_get_contents('http://www.gravatar.com/avatar/' . $filename . '?s=200&d=mm'); + $cache->store($cacheFile, $img); + header('ETag: "' . $cache->etagForCachedFile($cacheFile) . '"'); echo $img; } From 6faedf573368e992867efdafe31c9d6558327f52 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 16:49:28 +0200 Subject: [PATCH 113/257] ActionController: no benchmark for no renderer Benchmarks should not be shown when the renderer is no longer available. --- library/Icinga/Web/Controller/ActionController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php index bfbb35b77..aead4043a 100644 --- a/library/Icinga/Web/Controller/ActionController.php +++ b/library/Icinga/Web/Controller/ActionController.php @@ -348,7 +348,9 @@ class ActionController extends Zend_Controller_Action // Cast preference app.show_benchmark to bool because preferences loaded from a preferences storage are // always strings if ((bool) $user->getPreferences()->get('app.show_benchmark', false) === true) { - $layout->benchmark = $this->renderBenchmark(); + if (!$this->_helper->viewRenderer->getNoRender()) { + $layout->benchmark = $this->renderBenchmark(); + } } } From b60b81133575ed763da0e95a62fddd1bb9a99fb5 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 16:51:17 +0200 Subject: [PATCH 114/257] ApplicationBootstrap: list "core" translations Just to make application fit module capabilities. We might find a better place for both later on. refs #7054 --- .../Application/ApplicationBootstrap.php | 49 +++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php index 3f68ce43b..7736f8cf9 100644 --- a/library/Icinga/Application/ApplicationBootstrap.php +++ b/library/Icinga/Application/ApplicationBootstrap.php @@ -452,9 +452,8 @@ abstract class ApplicationBootstrap */ protected function setupInternationalization() { - $localeDir = $this->getApplicationDir('locale'); - if (file_exists($localeDir) && is_dir($localeDir)) { - Translator::registerDomain(Translator::DEFAULT_DOMAIN, $localeDir); + if ($this->hasLocales()) { + Translator::registerDomain(Translator::DEFAULT_DOMAIN, $this->getLocaleDir()); } try { @@ -469,4 +468,48 @@ abstract class ApplicationBootstrap return $this; } + + /** + * @return string Our locale directory + */ + public function getLocaleDir() + { + return $this->getApplicationDir('locale'); + } + + /** + * return bool Whether Icinga Web has translations + */ + public function hasLocales() + { + $localedir = $this->getLocaleDir(); + return file_exists($localedir) && is_dir($localedir); + } + + /** + * List all available locales + * + * NOTE: Might be a candidate for a static function in Translator + * + * return array Locale list + */ + public function listLocales() + { + $locales = array(); + if (! $this->hasLocales()) { + return $locales; + } + $localedir = $this->getLocaleDir(); + + $dh = opendir($localedir); + while (false !== ($file = readdir($dh))) { + $filename = $localedir . DIRECTORY_SEPARATOR . $file; + if (preg_match('/^[a-z]{2}_[A-Z]{2}$/', $file) && is_dir($filename)) { + $locales[] = $file; + } + } + closedir($dh); + sort($locales); + return $locales; + } } From 1734f01040475fd528575d7968ae432b2dfaf522 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 17:02:58 +0200 Subject: [PATCH 115/257] CommentdeletionhistoryQuery: 1970-01-01 -> -02 refs #7000 --- .../Backend/Ido/Query/CommentdeletionhistoryQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php index 8149c1c67..4ee17de6a 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php @@ -45,7 +45,7 @@ class CommentdeletionhistoryQuery extends IdoQuery array() )->join( array('h' => $this->prefix . 'commenthistory'), - 'o.' . $this->object_id . ' = h.' . $this->object_id . " AND o.is_active = 1 AND h.deletion_time > '1970-01-01 00:00:00' AND h.entry_type <> 2", + 'o.' . $this->object_id . ' = h.' . $this->object_id . " AND o.is_active = 1 AND h.deletion_time > '1970-01-02 00:00:00' AND h.entry_type <> 2", array() ); $this->joinedVirtualTables = array('commenthistory' => true); From f12a5741b8a4c53b7e5d94e43094e18d5a946934 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 19:05:49 +0200 Subject: [PATCH 116/257] js/loader: postpone redirection handling Redirections should not be executed unless the original request has been terminated and removed from pending requests. fixes #6989 --- public/js/icinga/loader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js index f91aa20b9..a80fb28d1 100644 --- a/public/js/icinga/loader.js +++ b/public/js/icinga/loader.js @@ -329,8 +329,7 @@ this.icinga.ui.reloadCss(); } - var redirect = req.getResponseHeader('X-Icinga-Redirect'); - if (this.processRedirectHeader(req)) return; + if (req.getResponseHeader('X-Icinga-Redirect')) return; // div helps getting an XML tree var $resp = $('
    ' + req.responseText + '
    '); @@ -567,6 +566,7 @@ delete this.requests[req.$target.attr('id')]; this.icinga.ui.fadeNotificationsAway(); + this.processRedirectHeader(req); if (typeof req.loadNext !== 'undefined') { if ($('#col2').length) { From 3d352ba44686deb660a1f55f191a2140fb13da85 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 19:51:56 +0200 Subject: [PATCH 117/257] Filter: add FilterNotEqual and FilterMatch fixes #6557 --- library/Icinga/Data/Filter/Filter.php | 4 ++-- library/Icinga/Data/Filter/FilterMatch.php | 22 +++++++++++++++++++ library/Icinga/Data/Filter/FilterMatchNot.php | 22 +++++++++++++++++++ library/Icinga/Data/Filter/FilterNotEqual.php | 13 +++++++++++ library/Icinga/Web/Widget/FilterEditor.php | 7 +++--- 5 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 library/Icinga/Data/Filter/FilterMatch.php create mode 100644 library/Icinga/Data/Filter/FilterMatchNot.php create mode 100644 library/Icinga/Data/Filter/FilterNotEqual.php diff --git a/library/Icinga/Data/Filter/Filter.php b/library/Icinga/Data/Filter/Filter.php index 7e995bb59..64607a4a0 100644 --- a/library/Icinga/Data/Filter/Filter.php +++ b/library/Icinga/Data/Filter/Filter.php @@ -132,12 +132,12 @@ abstract class Filter public static function expression($col, $op, $expression) { switch ($op) { - case '=': return new FilterEqual($col, $op, $expression); + case '=': return new FilterMatch($col, $op, $expression); case '<': return new FilterLessThan($col, $op, $expression); case '>': return new FilterGreaterThan($col, $op, $expression); case '>=': return new FilterEqualOrGreaterThan($col, $op, $expression); case '<=': return new FilterEqualOrLessThan($col, $op, $expression); - case '!=': return new FilterNotEqual($col, $op, $expression); + case '!=': return new FilterMatchNot($col, $op, $expression); default: throw new ProgrammingError( 'There is no such filter sign: %s', $op diff --git a/library/Icinga/Data/Filter/FilterMatch.php b/library/Icinga/Data/Filter/FilterMatch.php new file mode 100644 index 000000000..ef3cad801 --- /dev/null +++ b/library/Icinga/Data/Filter/FilterMatch.php @@ -0,0 +1,22 @@ +expression; + if (strpos($expression, '*') === false) { + return (string) $row->{$this->column} === $expression; + } else { + $parts = array(); + foreach (preg_split('/\*/', $expression) as $part) { + $parts[] = preg_quote($part); + } + return preg_match('/^' . implode('.*', $parts) . '$/', $row->{$this->column}); + } + } +} diff --git a/library/Icinga/Data/Filter/FilterMatchNot.php b/library/Icinga/Data/Filter/FilterMatchNot.php new file mode 100644 index 000000000..2ce5c2336 --- /dev/null +++ b/library/Icinga/Data/Filter/FilterMatchNot.php @@ -0,0 +1,22 @@ +expression; + if (strpos($expression, '*') === false) { + return (string) $row->{$this->column} !== $expression; + } else { + $parts = array(); + foreach (preg_split('/\*/', $expression) as $part) { + $parts[] = preg_quote($part); + } + return ! preg_match('/^' . implode('.*', $parts) . '$/', $row->{$this->column}); + } + } +} diff --git a/library/Icinga/Data/Filter/FilterNotEqual.php b/library/Icinga/Data/Filter/FilterNotEqual.php new file mode 100644 index 000000000..d1a5e9b64 --- /dev/null +++ b/library/Icinga/Data/Filter/FilterNotEqual.php @@ -0,0 +1,13 @@ +{$this->column} !== (string) $this->expression; + } +} diff --git a/library/Icinga/Web/Widget/FilterEditor.php b/library/Icinga/Web/Widget/FilterEditor.php index 4ce6ac6e6..af46a40f2 100644 --- a/library/Icinga/Web/Widget/FilterEditor.php +++ b/library/Icinga/Web/Widget/FilterEditor.php @@ -183,9 +183,10 @@ class FilterEditor extends AbstractWidget { $name = 'sign_' . $filter->getId(); $signs = array( - '=' => '=', - '>' => '>', - '<' => '<', + '=' => '=', + '!=' => '!=', + '>' => '>', + '<' => '<', '>=' => '>=', '<=' => '<=', ); From ef847801f2d19987285d9b8ea45fee1d4750bce7 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 2 Sep 2014 20:11:37 +0200 Subject: [PATCH 118/257] js/loader.js: preserve scrolling position... ...on autorefresh and reset it otherwise. fixes #6285 fixes #6988 --- public/js/icinga/loader.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js index a80fb28d1..f70bc0522 100644 --- a/public/js/icinga/loader.js +++ b/public/js/icinga/loader.js @@ -665,7 +665,11 @@ var self = this; var containerId = $container.attr('id'); if (typeof containerId !== 'undefined') { - scrollPos = $container.scrollTop(); + if (autorefresh) { + scrollPos = $container.scrollTop(); + } else { + scrollPos = 0; + } } var origFocus = document.activeElement; From 8e5deb8029b87f33234f5f43f1a758d8f141d468 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 3 Sep 2014 10:00:04 +0200 Subject: [PATCH 119/257] Fix TranslatorTest not expecting the default locale as being "available" refs #7063 --- test/php/library/Icinga/Util/TranslatorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/php/library/Icinga/Util/TranslatorTest.php b/test/php/library/Icinga/Util/TranslatorTest.php index 1c63e6c68..23bc154dd 100644 --- a/test/php/library/Icinga/Util/TranslatorTest.php +++ b/test/php/library/Icinga/Util/TranslatorTest.php @@ -27,7 +27,7 @@ class TranslatorTest extends BaseTestCase public function testWhetherGetAvailableLocaleCodesReturnsAllAvailableLocaleCodes() { $this->assertEquals( - array('de_DE', 'fr_FR'), + array(Translator::DEFAULT_LOCALE, 'de_DE', 'fr_FR'), Translator::getAvailableLocaleCodes(), 'Translator::getAvailableLocaleCodes does not return all available locale codes' ); From 3f9cb00b1fcff8143c837b498699e548e612bbc8 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 3 Sep 2014 10:00:41 +0200 Subject: [PATCH 120/257] Fix DbBackendFormTest not creating a valid ResourceFactory mock object refs #7063 --- .../Authentication/DbBackendFormTest.php | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/test/php/application/forms/Config/Authentication/DbBackendFormTest.php b/test/php/application/forms/Config/Authentication/DbBackendFormTest.php index c504955ad..51bec896f 100644 --- a/test/php/application/forms/Config/Authentication/DbBackendFormTest.php +++ b/test/php/application/forms/Config/Authentication/DbBackendFormTest.php @@ -26,10 +26,10 @@ class DbBackendFormTest extends BaseTestCase */ public function testValidBackendIsValid() { - $this->setUpUserBackendMock() + $this->setUpResourceFactoryMock(); + Mockery::mock('overload:Icinga\Authentication\Backend\DbUserBackend') ->shouldReceive('count') ->andReturn(2); - $this->setUpResourceFactoryMock(); $form = new DbBackendForm(); $form->setBackendName('test'); @@ -49,10 +49,10 @@ class DbBackendFormTest extends BaseTestCase */ public function testInvalidBackendIsNotValid() { - $this->setUpUserBackendMock() + $this->setUpResourceFactoryMock(); + Mockery::mock('overload:Icinga\Authentication\Backend\DbUserBackend') ->shouldReceive('count') ->andReturn(0); - $this->setUpResourceFactoryMock(); $form = new DbBackendForm(); $form->setBackendName('test'); @@ -66,18 +66,10 @@ class DbBackendFormTest extends BaseTestCase ); } - protected function setUpUserBackendMock() - { - return Mockery::mock('overload:Icinga\Authentication\Backend\DbUserBackend'); - } - protected function setUpResourceFactoryMock() { Mockery::mock('alias:Icinga\Data\ResourceFactory') - ->shouldReceive('getResourceConfig') - ->andReturn(new \Zend_Config(array())) - ->shouldReceive('createResource') - ->with(Mockery::type('\Zend_Config')) + ->shouldReceive('create') ->andReturn(Mockery::mock('Icinga\Data\Db\DbConnection')); } } From 07151d0a5ed0d4b26f45c81890aa47b357e5379c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 3 Sep 2014 10:01:20 +0200 Subject: [PATCH 121/257] Fix that the MonitoringProperties view helper returns locale aware floats refs #7063 --- .../application/views/helpers/MonitoringProperties.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/views/helpers/MonitoringProperties.php b/modules/monitoring/application/views/helpers/MonitoringProperties.php index ed52c5a04..568f63f57 100644 --- a/modules/monitoring/application/views/helpers/MonitoringProperties.php +++ b/modules/monitoring/application/views/helpers/MonitoringProperties.php @@ -121,7 +121,7 @@ class Zend_View_Helper_MonitoringProperties extends Zend_View_Helper_Abstract */ private function floatFormatter($value) { - return sprintf('%.4f', $value); + return sprintf('%.4F', $value); } /** From 06c7c4bd3e8a7583236291e71cb600a6088cc788 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 3 Sep 2014 10:09:43 +0200 Subject: [PATCH 122/257] Fix that the MonitoringProperties view helper returns locale aware floats refs #7063 --- .../application/views/helpers/MonitoringProperties.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/views/helpers/MonitoringProperties.php b/modules/monitoring/application/views/helpers/MonitoringProperties.php index 568f63f57..efbc80749 100644 --- a/modules/monitoring/application/views/helpers/MonitoringProperties.php +++ b/modules/monitoring/application/views/helpers/MonitoringProperties.php @@ -222,7 +222,7 @@ class Zend_View_Helper_MonitoringProperties extends Zend_View_Helper_Abstract $val .= self::VALUE_YES; } - $val .= sprintf(' (%.2f%% state change)', $object->percent_state_change); + $val .= sprintf(' (%.2F%% state change)', $object->percent_state_change); return $val; } From c4d17a3509605f0cd52bb5aefa2513ab65ced443 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 3 Sep 2014 10:27:24 +0200 Subject: [PATCH 123/257] Drop Zend_View_Helper_MonitoringProperties as it's not used anywhere --- .../views/helpers/MonitoringProperties.php | 284 ------------------ .../helpers/MonitoringPropertiesTest.php | 104 ------- 2 files changed, 388 deletions(-) delete mode 100644 modules/monitoring/application/views/helpers/MonitoringProperties.php delete mode 100644 modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php diff --git a/modules/monitoring/application/views/helpers/MonitoringProperties.php b/modules/monitoring/application/views/helpers/MonitoringProperties.php deleted file mode 100644 index efbc80749..000000000 --- a/modules/monitoring/application/views/helpers/MonitoringProperties.php +++ /dev/null @@ -1,284 +0,0 @@ - 'Current Attempt', - 'buildCheckType' => 'Check Type', - 'buildLatency' => 'Check Latency / Duration', - 'buildLastStateChange' => 'Last State Change', - 'buildLastNotification' => 'Last Notification', - 'buildFlapping' => 'Is This %s Flapping?', - 'buildScheduledDowntime' => 'In Scheduled Downtime?', - 'status_update_time' => 'Last Update' - ); - - private static $notificationReasons = array( - 0 => 'NORMAL', - 1 => 'ACKNOWLEDGEMENT', - 2 => 'FLAPPING START', - 3 => 'FLAPPING STOP', - 4 => 'FLAPPING DISABLED', - 5 => 'DOWNTIME START', - 6 => 'DOWNTIME END', - 7 => 'DOWNTIME CANCELLED', - 8 => 'CUSTOM', - 9 => 'STALKING' - ); - - /** - * Return the object type - * @param stdClass $object - * @return mixed - */ - private function getObjectType($object) - { - $keys = array_keys(get_object_vars($object)); - $keyParts = explode('_', array_shift($keys), 2); - return array_shift($keyParts); - } - - /** - * Drop all object specific attribute prefixes - * @param stdClass $object - * @param $type - * @return object - */ - private function dropObjectType($object, $type) - { - $vars = get_object_vars($object); - $out = array(); - foreach ($vars as $name => $value) { - $name = str_replace($type. '_', '', $name); - $out[$name] = $value; - } - return (object)$out; - } - - /** - * Get string for attempt - * @param stdClass $object - * @return string - */ - private function buildAttempt($object) - { - return sprintf( - '%s/%s (%s state)', - $object->current_check_attempt, - $object->max_check_attempts, - ($object->state_type === '1') ? 'HARD' : 'SOFT' - ); - } - - /** - * Generic fomatter for float values - * @param $value - * @return string - */ - private function floatFormatter($value) - { - return sprintf('%.4F', $value); - } - - /** - * Get the string for check type - * @param stdClass $object - * @return string - */ - private function buildCheckType($object) - { - if ($object->passive_checks_enabled === '1' && $object->active_checks_enabled === '0') { - return self::CHECK_PASSIVE; - } elseif ($object->passive_checks_enabled === '0' && $object->active_checks_enabled === '0') { - return self::CHECK_DISABLED; - } - - return self::CHECK_ACTIVE; - } - - /** - * Get string for latency - * @param stdClass $object - * @return string - */ - private function buildLatency($object) - { - $val = ''; - if ($this->buildCheckType($object) === self::CHECK_PASSIVE) { - $val .= self::VALUE_NA; - } else { - $val .= $this->floatFormatter( - (isset($object->check_latency)) ? $object->check_latency : 0 - ); - } - - $val .= ' / '. $this->floatFormatter( - isset($object->check_execution_time) ? $object->check_execution_time : 0 - ). ' seconds'; - - return $val; - } - - /** - * Get string for next check - * @param stdClass $object - * @return string - */ - private function buildNextCheck($object) - { - if ($this->buildCheckType($object) === self::CHECK_PASSIVE) { - return self::VALUE_NA; - } else { - return $object->next_check; - } - } - - /** - * Get date for last state change - * @param stdClass $object - * @return string - */ - private function buildLastStateChange($object) - { - return strftime('%Y-%m-%d %H:%M:%S', $object->last_state_change); - } - - /** - * Get string for "last notification" - * @param stdClass $object - * @return string - */ - private function buildLastNotification($object) - { - $val = ''; - - if ($object->last_notification === '0000-00-00 00:00:00') { - $val .= self::VALUE_NA; - } else { - $val .= $object->last_notification; - } - - $val .= sprintf(' (notification %d)', $object->current_notification_number); - - return $val; - } - - /** - * Get string for "is flapping" - * @param stdClass $object - * @return string - */ - private function buildFlapping($object) - { - $val = ''; - - if ($object->is_flapping === '0') { - $val .= self::VALUE_NO; - } else { - $val .= self::VALUE_YES; - } - - $val .= sprintf(' (%.2F%% state change)', $object->percent_state_change); - - return $val; - } - - /** - * Get string for scheduled downtime - * @param stdClass $object - * @return string - */ - private function buildScheduledDowntime($object) - { - if ($object->in_downtime === '1') { - return self::VALUE_YES; - } - - return self::VALUE_NO; - } - - /** - * Get an array which represent monitoring properties - * - * @param stdClass $object - * @return array - */ - public function monitoringProperties($object) - { - $type = $this->getObjectType($object); - //$object = $this->dropObjectType($object, $type); - - $out = array(); - foreach (self::$keys as $property => $label) { - $label = sprintf($label, ucfirst($type)); - if (is_callable(array(&$this, $property))) { - $out[$label] = $this->$property($object); - } elseif (isset($object->{$property})) { - $out[$label] = $object->{$property}; - } - } - - return $out; - } - - public function getNotificationType($notification) - { - $reason = intval($notification->notification_reason); - if (!isset(self::$notificationReasons[$reason])) { - return 'N/A'; - } - $type = self::$notificationReasons[$reason]; - if ($reason === 8) { - if (intval($notification->notification_type) === 0) { - $type .= '(UP)'; - } else { - $type .= '(OK)'; - } - } - return $type; - } -} diff --git a/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php b/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php deleted file mode 100644 index 5a476aaef..000000000 --- a/modules/monitoring/test/php/application/views/helpers/MonitoringPropertiesTest.php +++ /dev/null @@ -1,104 +0,0 @@ -current_check_attempt = '5'; - - $propertyHelper = new Zend_View_Helper_MonitoringProperties(); - $items = $propertyHelper->monitoringProperties($host); - - $this->assertEquals('5/10 (HARD state)', $items['Current Attempt']); - } - - public function testOutput2() - { - $host = new HostStruct4Properties(); - $host->current_check_attempt = '5'; - $host->active_checks_enabled = '1'; - $host->passive_checks_enabled = '0'; - $host->is_flapping = '1'; - - $propertyHelper = new Zend_View_Helper_MonitoringProperties(); - $items = $propertyHelper->monitoringProperties($host); - - $test = array( - 'Current Attempt' => "5/10 (HARD state)", - 'Check Type' => "ACTIVE", - 'Check Latency / Duration' => "0.1204 / 0.0000 seconds", - 'Last State Change' => "2013-07-04 11:24:43", - 'Last Notification' => "N/A (notification 0)", - 'Is This Host Flapping?' => "YES (12.37% state change)", - 'In Scheduled Downtime?' => "YES" - ); - - $this->assertEquals($test, $items); - } -} From 3ade6da44dc5eb7197de1cce3a75178e30b9529a Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 3 Sep 2014 11:12:15 +0200 Subject: [PATCH 124/257] FileReaderException: extend IcingaException --- .../Icinga/Protocol/File/Exception/FileReaderException.php | 4 ++-- library/Icinga/Protocol/File/Reader.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Protocol/File/Exception/FileReaderException.php b/library/Icinga/Protocol/File/Exception/FileReaderException.php index 3e0890a57..a7db5d701 100644 --- a/library/Icinga/Protocol/File/Exception/FileReaderException.php +++ b/library/Icinga/Protocol/File/Exception/FileReaderException.php @@ -2,9 +2,9 @@ namespace Icinga\Protocol\File; -use RuntimeException; +use Icinga\Exception\IcingaException; /** * Exception thrown if a file reader specific error occurs */ -class FileReaderException extends RuntimeException {} +class FileReaderException extends IcingaException {} diff --git a/library/Icinga/Protocol/File/Reader.php b/library/Icinga/Protocol/File/Reader.php index 50842bc4a..651846b58 100644 --- a/library/Icinga/Protocol/File/Reader.php +++ b/library/Icinga/Protocol/File/Reader.php @@ -40,7 +40,7 @@ class Reader extends FilterIterator { foreach (array('filename', 'fields') as $key) { if (! isset($config->{$key})) { - throw new FileReaderException('The directive `' . $key . '\' is required'); + throw new FileReaderException('The directive `%s\' is required', $key); } } $this->fields = $config->fields; From 70cf14f775daa9203ef99897422cd19bffb11019 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 3 Sep 2014 11:34:21 +0200 Subject: [PATCH 125/257] Logger: rename getWriter() -> createWriter() refs #7060 --- library/Icinga/Logger/Logger.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Logger/Logger.php b/library/Icinga/Logger/Logger.php index 87811ae69..c3550a610 100644 --- a/library/Icinga/Logger/Logger.php +++ b/library/Icinga/Logger/Logger.php @@ -52,7 +52,7 @@ class Logger $this->verbosity = $config->level; if ($config->enable) { - $this->writer = $this->getWriter($config); + $this->writer = $this->createWriter($config); } } @@ -75,7 +75,7 @@ class Logger * * @throws ConfigurationError In case the requested writer cannot be found */ - protected function getWriter(Zend_Config $config) + protected function createWriter(Zend_Config $config) { $class = 'Icinga\\Logger\\Writer\\' . ucfirst(strtolower($config->type)) . 'Writer'; if (!class_exists($class)) { From 6aeab59eadff3f4eb89500f3daf826e6c1cb28bd Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 3 Sep 2014 12:02:11 +0200 Subject: [PATCH 126/257] Logger: implement getWriter() and getInstance() refs #7060 --- library/Icinga/Logger/Logger.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/library/Icinga/Logger/Logger.php b/library/Icinga/Logger/Logger.php index c3550a610..b01ac2a71 100644 --- a/library/Icinga/Logger/Logger.php +++ b/library/Icinga/Logger/Logger.php @@ -194,4 +194,14 @@ class Logger static::$instance->log(static::formatMessage(func_get_args()), static::$DEBUG); } } + + public function getWriter() + { + return $this->writer; + } + + public static function getInstance() + { + return static::$instance; + } } From 1e06c20dcb0eca4837497f95689b70c8e7393044 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 3 Sep 2014 12:09:38 +0200 Subject: [PATCH 127/257] FileWriter: implement getPath() refs #7060 --- library/Icinga/Logger/Writer/FileWriter.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/Icinga/Logger/Writer/FileWriter.php b/library/Icinga/Logger/Writer/FileWriter.php index 2a50ca36b..4ab04d85b 100644 --- a/library/Icinga/Logger/Writer/FileWriter.php +++ b/library/Icinga/Logger/Writer/FileWriter.php @@ -103,4 +103,12 @@ class FileWriter extends LogWriter $file->fwrite($text); $file->fflush(); } + + /** + * @return string + */ + public function getPath() + { + return $this->path; + } } From 3b8fcb80a8633be3dc20390dc22207dd00ff61be Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 3 Sep 2014 12:44:23 +0200 Subject: [PATCH 128/257] Application log: don't crash if logData === null refs #7060 --- application/views/scripts/list/applicationlog.phtml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/views/scripts/list/applicationlog.phtml b/application/views/scripts/list/applicationlog.phtml index 68b115152..583fde516 100644 --- a/application/views/scripts/list/applicationlog.phtml +++ b/application/views/scripts/list/applicationlog.phtml @@ -5,6 +5,7 @@
    + logData !== null): ?> logData as $value): ?> @@ -21,4 +22,5 @@
    -
    \ No newline at end of file + +
    From f4b820aa574b0a2151c9ddbe9b91867fc663b82e Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 3 Sep 2014 13:12:22 +0200 Subject: [PATCH 129/257] Application log: don't use Icinga\Application\Config to get the log file name refs #7060 --- application/controllers/ListController.php | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/application/controllers/ListController.php b/application/controllers/ListController.php index dac0cc68b..599df06a1 100644 --- a/application/controllers/ListController.php +++ b/application/controllers/ListController.php @@ -4,9 +4,11 @@ use Icinga\Module\Monitoring\Controller; use Icinga\Web\Hook; -use Icinga\Application\Config as IcingaConfig; use Icinga\Web\Url; use Icinga\Data\ResourceFactory; +use Icinga\Logger\Logger; +use Icinga\Logger\Writer\FileWriter; +use Icinga\Protocol\File\Reader as FileReader; /** * Class ListController @@ -37,15 +39,16 @@ class ListController extends Controller public function applicationlogAction() { $this->addTitleTab('application log'); - $config_ini = IcingaConfig::app()->toArray(); - if (!in_array('logging', $config_ini) || ( - in_array('type', $config_ini['logging']) && - $config_ini['logging']['type'] === 'file' && - in_array('target', $config_ini['logging']) && - file_exists($config_ini['logging']['target']) - ) - ) { - $resource = ResourceFactory::create('logfile'); + + $loggerWriter = Logger::getInstance()->getWriter(); + if ($loggerWriter instanceof FileWriter) { + $resource = new FileReader(new Zend_Config(array( + 'filename' => $loggerWriter->getPath(), + 'fields' => '/^(?[0-9]{4}(-[0-9]{2}){2}' // date + . 'T[0-9]{2}(:[0-9]{2}){2}([\\+\\-][0-9]{2}:[0-9]{2})?)' // time + . ' - (?[A-Za-z]+)' // loglevel + . ' - (?.*)$/' // message + ))); $this->view->logData = $resource->select()->order('DESC')->paginate(); } else { $this->view->logData = null; From 33669f8969e7e4fdbcc953e6a9e779aad6601b10 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 3 Sep 2014 13:53:46 +0200 Subject: [PATCH 130/257] Logger: add/update documentation refs #7060 --- library/Icinga/Logger/Logger.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/library/Icinga/Logger/Logger.php b/library/Icinga/Logger/Logger.php index b01ac2a71..828b4de88 100644 --- a/library/Icinga/Logger/Logger.php +++ b/library/Icinga/Logger/Logger.php @@ -23,7 +23,7 @@ class Logger /** * The log writer to use * - * @var LogWriter + * @var \Icinga\Logger\LogWriter */ protected $writer; @@ -71,9 +71,8 @@ class Logger * * @param Zend_Config $config The configuration to initialize the writer with * - * @return LogWriter The requested log writer - * - * @throws ConfigurationError In case the requested writer cannot be found + * @return \Icinga\Logger\LogWriter The requested log writer + * @throws ConfigurationError If the requested writer cannot be found */ protected function createWriter(Zend_Config $config) { @@ -195,11 +194,21 @@ class Logger } } + /** + * Get the log writer to use + * + * @return \Icinga\Logger\LogWriter + */ public function getWriter() { return $this->writer; } + /** + * Get this' instance + * + * @return Logger + */ public static function getInstance() { return static::$instance; From 7cfc051228588f1635f478184274c9d436929a1d Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Wed, 3 Sep 2014 14:36:04 +0200 Subject: [PATCH 131/257] Add tests for Dashboard and fix doc blocks refs #6986 --- library/Icinga/Web/Widget/Dashboard.php | 47 +- library/Icinga/Web/Widget/Dashboard/Pane.php | 12 +- .../library/Icinga/Widget/DashboardTest.php | 509 ++++++++++++++++++ 3 files changed, 546 insertions(+), 22 deletions(-) create mode 100644 test/php/library/Icinga/Widget/DashboardTest.php diff --git a/library/Icinga/Web/Widget/Dashboard.php b/library/Icinga/Web/Widget/Dashboard.php index d8b09b15a..a86204d87 100644 --- a/library/Icinga/Web/Widget/Dashboard.php +++ b/library/Icinga/Web/Widget/Dashboard.php @@ -8,7 +8,6 @@ use Icinga\Application\Icinga; use Icinga\Application\Config as IcingaConfig; use Icinga\Exception\ConfigurationError; use Icinga\Exception\ProgrammingError; -use Icinga\Web\Widget\AbstractWidget; use Icinga\Web\Widget\Dashboard\Pane; use Icinga\Web\Widget\Dashboard\Component as DashboardComponent; use Icinga\Web\Url; @@ -96,7 +95,7 @@ class Dashboard extends AbstractWidget $current = $this->panes[$pane->getName()]; $current->addComponents($pane->getComponents()); } else { - $this->panes = array_filter(array_merge($this->panes, $panes)); + $this->panes[$pane->getName()] = $pane; } } @@ -128,6 +127,16 @@ class Dashboard extends AbstractWidget return $this->tabs; } + /** + * Return all panes of this dashboard + * + * @return array + */ + public function getPanes() + { + return $this->panes; + } + /** * Populate this dashboard via the given configuration file * @@ -164,9 +173,9 @@ class Dashboard extends AbstractWidget * * @TODO: Should only allow component objects to be added directly as soon as we store more information * - * @param string $pane The pane to add the component to - * @param Component|string $component The component to add or the title of the newly created component - * @param $url The url to use for the component + * @param string $pane The pane to add the component to + * @param Component|string $component The component to add or the title of the newly created component + * @param string|null $url The url to use for the component * * @return self */ @@ -198,20 +207,14 @@ class Dashboard extends AbstractWidget } /** - * Return true if a pane doesn't exist or doesn't have any components in it - * - * @param string $pane The name of the pane to check for emptyness + * Check if this dashboard has a specific pane * + * @param $pane string The name of the pane * @return bool */ - public function isEmptyPane($pane) + public function hasPane($pane) { - $paneObj = $this->getPane($pane); - if ($paneObj === null) { - return true; - } - $cmps = $paneObj->getComponents(); - return !empty($cmps); + return array_key_exists($pane, $this->panes); } /** @@ -305,11 +308,11 @@ class Dashboard extends AbstractWidget return $active; } + /** + * @see determineActivePane() + */ public function getActivePane() { - if ($active = $this->getTabs()->getActiveName()) { - return $this->getPane($active); - } return $this->determineActivePane(); } @@ -323,10 +326,12 @@ class Dashboard extends AbstractWidget $active = $this->getTabs()->getActiveName(); if (! $active) { if ($active = Url::fromRequest()->getParam($this->tabParam)) { - if ($this->isEmptyPane($active)) { - $active = $this->setDefaultPane(); - } else { + if ($this->hasPane($active)) { $this->activate($active); + } else { + throw new ProgrammingError( + 'Try to get an inexistent pane.' + ); } } else { $active = $this->setDefaultPane(); diff --git a/library/Icinga/Web/Widget/Dashboard/Pane.php b/library/Icinga/Web/Widget/Dashboard/Pane.php index 39ad1fda3..45bd9c558 100644 --- a/library/Icinga/Web/Widget/Dashboard/Pane.php +++ b/library/Icinga/Web/Widget/Dashboard/Pane.php @@ -39,7 +39,7 @@ class Pane extends AbstractWidget /** * Create a new pane * - * @param $name The pane to create + * @param string $name The pane to create */ public function __construct($name) { @@ -92,6 +92,16 @@ class Pane extends AbstractWidget return array_key_exists($title, $this->components); } + /** + * Checks if the current pane has any components + * + * @return bool + */ + public function hasComponents() + { + return ! empty($this->components); + } + /** * Return a component with the given name if existing * diff --git a/test/php/library/Icinga/Widget/DashboardTest.php b/test/php/library/Icinga/Widget/DashboardTest.php new file mode 100644 index 000000000..cdb4d8ff2 --- /dev/null +++ b/test/php/library/Icinga/Widget/DashboardTest.php @@ -0,0 +1,509 @@ +shouldReceive('escape'); + + return $mock; + } +} + +class DashboardWithPredefinableActiveName extends Dashboard +{ + public $activeName = ''; + + public function getTabs() + { + return Mockery::mock('Icinga\Web\Widget\Tabs') + ->shouldReceive('getActiveName')->andReturn($this->activeName) + ->shouldReceive('activate') + ->getMock(); + } +} + +class DashboardTest extends BaseTestCase +{ + public function tearDown() + { + parent::tearDown(); + Mockery::close(); // Necessary because some tests run in a separate process + } + + protected function setupIcingaMock(\Zend_Controller_Request_Abstract $request) + { + $moduleMock = Mockery::mock('Icinga\Application\Modules\Module'); + $moduleMock->shouldReceive('getPaneItems')->andReturn(array( + 'test-pane' => new Pane('Test Pane') + )); + + $moduleManagerMock = Mockery::mock('Icinga\Application\Modules\Manager'); + $moduleManagerMock->shouldReceive('getLoadedModules')->andReturn(array( + 'test-module' => $moduleMock + )); + + $bootstrapMock = Mockery::mock('Icinga\Application\ApplicationBootstrap')->shouldDeferMissing(); + $bootstrapMock->shouldReceive('getFrontController->getRequest')->andReturnUsing( + function () use ($request) { return $request; } + )->shouldReceive('getApplicationDir')->andReturn(self::$appDir); + + $bootstrapMock->shouldReceive('getModuleManager')->andReturn($moduleManagerMock); + + Icinga::setApp($bootstrapMock, true); + } + + public function testWhetherCreatePaneCreatesAPane() + { + $dashboard = new Dashboard(); + $pane = $dashboard->createPane('test')->getPane('test'); + + $this->assertEquals('test', $pane->getTitle(), 'Dashboard::createPane() could not create a pane'); + } + + /** + * @depends testWhetherCreatePaneCreatesAPane + */ + public function testMergePanesWithDifferentPaneName() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1'); + $dashboard->createPane('test2'); + + $panes = array( + new Pane('test1a'), + new Pane('test2a') + ); + + $dashboard->mergePanes($panes); + + $this->assertCount(4, $dashboard->getPanes(), 'Dashboard::mergePanes() could not merge different panes'); + } + + /** + * @depends testWhetherCreatePaneCreatesAPane + */ + public function testMergePanesWithSamePaneName() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1'); + $dashboard->createPane('test2'); + + $panes = array( + new Pane('test1'), + new Pane('test3') + ); + + $dashboard->mergePanes($panes); + + $this->assertCount(3, $dashboard->getPanes(), 'Dashboard::mergePanes() could not merge same panes'); + } + + /** + * @depends testWhetherCreatePaneCreatesAPane + */ + public function testWhetherGetPaneReturnsAPaneByName() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1'); + + $pane = $dashboard->getPane('test1'); + + $this->assertEquals( + 'test1', + $pane->getName(), + 'Dashboard:getPane() could not return pane by name' + ); + } + + /** + * @depends testWhetherCreatePaneCreatesAPane + */ + public function testLoadPaneItemsProvidedByEnabledModules() + { + $dashboard = Dashboard::load(); + + $this->assertCount( + 1, + $dashboard->getPanes(), + 'Dashboard::load() could not load panes from enabled modules' + ); + } + + /** + * @expectedException \Icinga\Exception\ProgrammingError + * @depends testWhetherCreatePaneCreatesAPane + */ + public function testWhetherGetPaneThrowsAnExceptionOnNotExistentPaneName() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1'); + + $dashboard->getPane('test2'); + } + + /** + * @depends testWhetherGetPaneReturnsAPaneByName + */ + public function testWhetherRenderNotRendersPanesDisabledComponent() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1'); + $pane = $dashboard->getPane('test1'); + $component = new ComponentWithMockedView('test', 'test', $pane); + $component->setDisabled(true); + $pane->addComponent($component); + + $rendered = $dashboard->render(); + + $greaterThanOne = strlen($rendered) > 1; + + $this->assertFalse( + $greaterThanOne, + 'Dashboard::render() disabled component is rendered, but should not' + ); + } + + /** + * @depends testWhetherGetPaneReturnsAPaneByName + */ + public function testWhetherRenderRendersPanesEnabledComponent() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1'); + $pane = $dashboard->getPane('test1'); + $component = new ComponentWithMockedView('test', 'test', $pane); + $pane->addComponent($component); + + $rendered = $dashboard->render(); + + $greaterThanOne = strlen($rendered) > 1; + + $this->assertTrue( + $greaterThanOne, + 'Dashboard::render() could not render enabled component' + ); + } + + public function testWhetherRenderNotRendersNotExistentPane() + { + $dashboard = new Dashboard(); + + $rendered = $dashboard->render(); + + $greaterThanOne = strlen($rendered) > 1; + + $this->assertFalse( + $greaterThanOne, + 'Dashboard::render() not existent pane ist rendered, but should not' + ); + } + + /** + * @depends testWhetherGetPaneReturnsAPaneByName + */ + public function testWhetherGetPaneKeyTitleArrayReturnFormedArray() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1')->getPane('test1')->setTitle('Test1'); + $dashboard->createPane('test2')->getPane('test2')->setTitle('Test2'); + + $result = $dashboard->getPaneKeyTitleArray(); + + $expected = array( + 'test1' => 'Test1', + 'test2' => 'Test2' + ); + + $this->assertEquals( + $expected, + $result, + 'Dashboard::getPaneKeyTitleArray() could not return valid expectation' + ); + } + + /** + * @depends testWhetherCreatePaneCreatesAPane + */ + public function testWhetherHasPanesHasPanes() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1'); + $dashboard->createPane('test2'); + + $hasPanes = $dashboard->hasPanes(); + + $this->assertTrue($hasPanes, 'Dashboard::hasPanes() could not return valid expectation'); + } + + public function testWhetherHasPanesHasNoPanes() + { + $dashboard = new Dashboard(); + + $hasPanes = $dashboard->hasPanes(); + + $this->assertFalse($hasPanes, 'Dashboard::hasPanes() has panes but should not'); + } + + /** + * @depends testWhetherGetPaneReturnsAPaneByName + */ + public function testWhetherRemoveComponentRemovesComponent() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1'); + $pane = $dashboard->getPane('test1'); + + $component = new Component('test', 'test', $pane); + $pane->addComponent($component); + + $component2 = new Component('test2', 'test2', $pane); + $pane->addComponent($component2); + + $dashboard->removeComponent('test1', 'test'); + + $result = $dashboard->getPane('test1')->hasComponent('test'); + + $this->assertFalse( + $result, + 'Dashboard::removeComponent() could not remove component from the pane' + ); + } + + /** + * @depends testWhetherGetPaneReturnsAPaneByName + */ + public function testWhetherRemoveComponentRemovesComponentByConcatenation() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1'); + $pane = $dashboard->getPane('test1'); + + $component = new Component('test', 'test', $pane); + $pane->addComponent($component); + + $component2 = new Component('test2', 'test2', $pane); + $pane->addComponent($component2); + + $dashboard->removeComponent('test1.test', null); + + $result = $dashboard->getPane('test1')->hasComponent('test'); + + $this->assertFalse( + $result, + 'Dashboard::removeComponent() could not remove component from the pane' + ); + } + + /** + * @depends testWhetherGetPaneReturnsAPaneByName + */ + public function testWhetherToArrayReturnsDashboardStructureAsArray() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1'); + $pane = $dashboard->getPane('test1'); + + $component = new Component('test', 'test', $pane); + $pane->addComponent($component); + + $result = $dashboard->toArray(); + + $expected = array( + 'test1' => array( + 'title' => 'test1' + ), + 'test1.test' => array( + 'url' => 'test' + ) + ); + + $this->assertEquals( + $expected, + $result, + 'Dashboard::toArray() could not return valid expectation' + ); + } + + /** + * @depends testWhetherGetPaneReturnsAPaneByName + */ + public function testWhetherSetComponentUrlUpdatesTheComponentUrl() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1'); + $pane = $dashboard->getPane('test1'); + $component = new Component('test', 'test', $pane); + $pane->addComponent($component); + + $dashboard->setComponentUrl('test1', 'test', 'new'); + + $this->assertEquals( + 'new', + $component->getUrl()->getPath(), + 'Dashboard::setComponentUrl() could not return valid expectation' + ); + } + + /** + * @depends testWhetherGetPaneReturnsAPaneByName + */ + public function testWhetherSetComponentUrlUpdatesTheComponentUrlConcatenation() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1'); + $pane = $dashboard->getPane('test1'); + $component = new Component('test', 'test', $pane); + $pane->addComponent($component); + + $dashboard->setComponentUrl('test1.test', null, 'new'); + + $this->assertEquals( + 'new', + $component->getUrl()->getPath(), + 'Dashboard::setComponentUrl() could not return valid expectation' + ); + } + + /** + * @depends testWhetherGetPaneReturnsAPaneByName + */ + public function testWhetherSetComponentUrlUpdatesTheComponentUrlNotExistentPane() + { + $dashboard = new Dashboard(); + $dashboard->createPane('test1'); + $pane = $dashboard->getPane('test1'); + $component = new Component('test', 'test', $pane); + $pane->addComponent($component); + + $dashboard->setComponentUrl('test3.test', null, 'new'); + + $result = $dashboard->getPane('test3')->getComponent('test'); + + $this->assertEquals( + 'new', + $result->getUrl()->getPath(), + 'Dashboard::setComponentUrl() could not return valid expectation' + ); + } + + /** + * @expectedException \Icinga\Exception\ConfigurationError + */ + public function testWhetherDetermineActivePaneThrowsAnExceptionIfCouldNotDetermine() + { + $dashboard = new Dashboard(); + $dashboard->determineActivePane(); + } + + /** + * @runInSeparateProcess + * @preserveGlobalState disabled + * @expectedException \Icinga\Exception\ProgrammingError + * @depends testWhetherCreatePaneCreatesAPane + */ + public function testWhetherDetermineActivePaneThrowsAnExceptionIfCouldNotDetermineInvalidPane() + { + $dashboard = new DashboardWithPredefinableActiveName(); + $dashboard->createPane('test1'); + + Mockery::mock('alias:Icinga\Web\Url') + ->shouldReceive('fromRequest->getParam')->andReturn('test2'); + + $dashboard->determineActivePane(); + } + + /** + * @depends testWhetherCreatePaneCreatesAPane + */ + public function testWhetherDetermineActivePaneDeterminesActivePane() + { + $dashboard = new DashboardWithPredefinableActiveName(); + $dashboard->activeName = 'test2'; + $dashboard->createPane('test1'); + $dashboard->createPane('test2'); + + $activePane = $dashboard->determineActivePane(); + + $this->assertEquals( + 'test2', + $activePane->getTitle(), + 'Dashboard::determineActivePane() could not determine active pane' + ); + } + + /** + * @runInSeparateProcess + * @preserveGlobalState disabled + * @depends testWhetherCreatePaneCreatesAPane + */ + public function testWhetherDetermineActivePaneDeterminesActiveValidPane() + { + $dashboard = new DashboardWithPredefinableActiveName(); + $dashboard->createPane('test1'); + $dashboard->createPane('test2'); + + Mockery::mock('alias:Icinga\Web\Url') + ->shouldReceive('fromRequest->getParam')->andReturn('test2'); + + $activePane = $dashboard->determineActivePane(); + + $this->assertEquals( + 'test2', + $activePane->getTitle(), + 'Dashboard::determineActivePane() could not determine active pane' + ); + } + + /** + * @depends testWhetherCreatePaneCreatesAPane + */ + public function testWhetherGetActivePaneReturnsActivePane() + { + $dashboard = new DashboardWithPredefinableActiveName(); + $dashboard->activeName = 'test2'; + $dashboard->createPane('test1'); + $dashboard->createPane('test2'); + + $activePane = $dashboard->getActivePane(); + + $this->assertEquals( + 'test2', + $activePane->getTitle(), + 'Dashboard::determineActivePane() could not get expected active pane' + ); + } + + public function testWhetherLoadConfigPanes() + { + $this->markTestIncomplete( + 'Dashboard::loadConfigPanes() is not fully implemented yet or rather not used' + ); + } + + /** + * @depends testWhetherLoadConfigPanes + */ + public function testWhetherReadConfigPopulatesDashboard() + { + $this->markTestIncomplete( + 'Dashboard::readConfig() is not fully implemented yet or rather not used' + ); + } +} From 65fb246b7e588e233a78d28692b5fa2d32439167 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 3 Sep 2014 15:03:24 +0200 Subject: [PATCH 132/257] FilterTest: fix complex filter example The filter in the test was not a valid filter. fixes #7069 --- test/php/library/Icinga/Data/Filter/FilterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/php/library/Icinga/Data/Filter/FilterTest.php b/test/php/library/Icinga/Data/Filter/FilterTest.php index cc91522dd..dbd640b91 100644 --- a/test/php/library/Icinga/Data/Filter/FilterTest.php +++ b/test/php/library/Icinga/Data/Filter/FilterTest.php @@ -182,7 +182,7 @@ class FilterTest extends BaseTestCase public function testComplexFilterFromQueryString() { - $q = 'host=localhost|nohost*&problem&service=*www*|ups*&state!=1&!handled'; + $q = '(host=localhost|host=nohost*)&problem&(service=*www*|service=ups*)&state!=1&!handled'; $filter = Filter::fromQueryString($q); $this->assertFalse($filter->matches($this->row(0))); $this->assertTrue($filter->matches($this->row(1))); From 1d812114272eefe07e1eed536401b9a853fa6fce Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Wed, 3 Sep 2014 15:11:11 +0200 Subject: [PATCH 133/257] Move DashboardTest in correct directory resf #6986 --- test/php/library/Icinga/{ => Web}/Widget/DashboardTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename test/php/library/Icinga/{ => Web}/Widget/DashboardTest.php (99%) diff --git a/test/php/library/Icinga/Widget/DashboardTest.php b/test/php/library/Icinga/Web/Widget/DashboardTest.php similarity index 99% rename from test/php/library/Icinga/Widget/DashboardTest.php rename to test/php/library/Icinga/Web/Widget/DashboardTest.php index cdb4d8ff2..9114a8f90 100644 --- a/test/php/library/Icinga/Widget/DashboardTest.php +++ b/test/php/library/Icinga/Web/Widget/DashboardTest.php @@ -6,7 +6,7 @@ namespace Tests\Icinga\Web; // Necessary as some of these tests disable phpunit's preservation // of the global state (e.g. autoloaders are in the global state) -require_once realpath(dirname(__FILE__) . '/../../../bootstrap.php'); +require_once realpath(dirname(__FILE__) . '/../../../../bootstrap.php'); use Mockery; use Icinga\Application\Icinga; From 88dde47b7a3306bccc1293d6bb5ea1e909b8299a Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 3 Sep 2014 15:39:25 +0200 Subject: [PATCH 134/257] Foreach: add $value so that the value won't be assigned to $key refs #7060 --- library/Icinga/Protocol/File/Reader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/Protocol/File/Reader.php b/library/Icinga/Protocol/File/Reader.php index 651846b58..a9b0455b7 100644 --- a/library/Icinga/Protocol/File/Reader.php +++ b/library/Icinga/Protocol/File/Reader.php @@ -81,7 +81,7 @@ class Reader extends FilterIterator if ($matched === false) { throw new FileReaderException('Failed parsing regular expression!'); } else if ($matched === 1) { - foreach ($data as $key) { + foreach ($data as $key => $value) { if (is_int($key)) { unset($data[$key]); } From b10b1ea03490961795394b2e90d031fab55c0602 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Tue, 2 Sep 2014 17:51:07 +0200 Subject: [PATCH 135/257] Add jQuery tooltips --- library/Icinga/Web/JavaScript.php | 6 +- library/Icinga/Web/StyleSheet.php | 2 + public/css/icinga/charts.less | 11 ++ public/js/icinga/events.js | 63 +++++++ public/js/icinga/ui.js | 4 +- public/js/icinga/utils.js | 34 ++++ public/js/vendor/jquery.tipsy.js | 262 +++++++++++++++++++++++++++ public/js/vendor/jquery.tipsy.min.js | 258 ++++++++++++++++++++++++++ 8 files changed, 637 insertions(+), 3 deletions(-) create mode 100644 public/css/icinga/charts.less create mode 100644 public/js/vendor/jquery.tipsy.js create mode 100644 public/js/vendor/jquery.tipsy.min.js diff --git a/library/Icinga/Web/JavaScript.php b/library/Icinga/Web/JavaScript.php index 2f4ef0485..9eff9f5f0 100644 --- a/library/Icinga/Web/JavaScript.php +++ b/library/Icinga/Web/JavaScript.php @@ -24,12 +24,14 @@ class JavaScript protected static $vendorFiles = array( 'js/vendor/jquery-2.1.0', - 'js/vendor/jquery.sparkline' + 'js/vendor/jquery.sparkline', + 'js/vendor/jquery.tipsy' ); protected static $ie8VendorFiles = array( 'js/vendor/jquery-1.11.0', - 'js/vendor/jquery.sparkline' + 'js/vendor/jquery.sparkline', + 'js/vendor/jquery.tipsy' ); public static function listModuleFiles() diff --git a/library/Icinga/Web/StyleSheet.php b/library/Icinga/Web/StyleSheet.php index fedd8207a..cb1d7aacd 100644 --- a/library/Icinga/Web/StyleSheet.php +++ b/library/Icinga/Web/StyleSheet.php @@ -23,6 +23,8 @@ class StyleSheet 'css/icinga/monitoring-colors.less', 'css/icinga/selection-toolbar.less', 'css/icinga/login.less', + 'css/icinga/charts.less', + 'css/vendor/tipsy.less' ); public static function compileForPdf() diff --git a/public/css/icinga/charts.less b/public/css/icinga/charts.less new file mode 100644 index 000000000..6164921df --- /dev/null +++ b/public/css/icinga/charts.less @@ -0,0 +1,11 @@ +// {{{ICINGA_LICENSE_HEADER}}} +// {{{ICINGA_LICENSE_HEADER}}} + +/* Add hover effects to chart data */ +.chart-data:hover { + opacity: 0.85; +} + +.pie-data:hover { + opacity: 0.6; +} \ No newline at end of file diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index d04912d0f..e9ef7b2ea 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -109,6 +109,62 @@ if (searchField.length && searchField.val().length) { this.searchValue = searchField.val(); } + + $('[title]').each(function () { + var $el = $(this); + $el.attr('title', $el.attr('title-rich') || $el.attr('title')); + // $el.attr('title', null); + }); + + $('svg rect.chart-data[title]', el).tipsy({ gravity: 'e', html: true }); + $('.historycolorgrid a[title]', el).tipsy({ gravity: 's', offset: 2 }); + $('img.icon[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, offset: 2 }); + $('[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, delayIn: 500 }); + + // Rescue or remove all orphaned tooltips + $('.tipsy').each(function () { + function isElementInDOM(ele) { + while (ele = ele.parentNode) { + if (ele == document) return true; + } + return false; + }; + + var arrow = $('.tipsy-arrow', this)[0]; + if (!icinga.utils.elementsOverlap(arrow, $('#main')[0])) { + $(this).remove(); + return; + } + // all tooltips are direct children of the body + // so we need find out whether the tooltip belongs applied area, + // by checking if both areas overlap + if (!icinga.utils.elementsOverlap(arrow, el)) { + // tooltip does not belong to this area + return; + } + + var pointee = $.data(this, 'tipsy-pointee'); + if (!pointee || !isElementInDOM(pointee)) { + var orphan = this; + var oldTitle = $(this).find('.tipsy-inner').html(); + var migrated = false; + // try to find an element with the same title + $('[original-title="' + oldTitle + '"]').each(function() { + // get stored instance of Tipsy from newly created element + // point it to the orphaned tooltip + var tipsy = $.data(this, 'tipsy'); + tipsy.$tip = $(orphan); + $.data(this, 'tipsy', tipsy); + + // orphaned tooltip has the new element as pointee + $.data(orphan, 'tipsy-pointee', this); + migrated = true; + }); + if (!migrated) { + $(orphan).remove(); + } + } + }); }, /** @@ -162,6 +218,13 @@ // $(document).on('keyup', 'form.auto input', this.formChangeDelayed); // $(document).on('change', 'form.auto input', this.formChanged); // $(document).on('change', 'form.auto select', this.submitForm); + + $(document).on('mouseenter', '[title-original]', { gravity: 'n' }, function(event) { + icinga.ui.hoverTooltip (this, event.data); + }); + $(document).on('mouseleave', '[title-original]', {}, function() { + icinga.ui.unhoverTooltip (this); + }); }, menuTitleHovered: function (event) { diff --git a/public/js/icinga/ui.js b/public/js/icinga/ui.js index 8ff3733f0..d933844c9 100644 --- a/public/js/icinga/ui.js +++ b/public/js/icinga/ui.js @@ -10,6 +10,9 @@ 'use strict'; + // The currently hovered tooltip + var tooltip = null; + // Stores the icinga-data-url of the last focused table. var focusedTableDataUrl = null; @@ -767,7 +770,6 @@ this.debugTimer = null; this.timeCounterTimer = null; } - }; }(Icinga, jQuery)); diff --git a/public/js/icinga/utils.js b/public/js/icinga/utils.js index 4ce5e5917..1a6759d87 100644 --- a/public/js/icinga/utils.js +++ b/public/js/icinga/utils.js @@ -200,6 +200,40 @@ return params; }, + /** + * Check whether two HTMLElements overlap + * + * @param a {HTMLElement} + * @param b {HTMLElement} + * + * @returns {Boolean} whether elements overlap, will return false when one + * element is not in the DOM + */ + elementsOverlap: function(a, b) + { + // a bounds + var aoff = $(a).offset(); + if (!aoff) { + return false; + } + var at = aoff.top; + var ah = a.offsetHeight; + var al = aoff.left; + var aw = a.offsetWidth; + + // b bounds + var boff = $(b).offset(); + if (!boff) { + return false; + } + var bt = boff.top; + var bh = b.offsetHeight; + var bl = boff.left; + var bw = b.offsetWidth; + + return !(at > (bt + bh) || bt > (at + ah)) && !(bl > (al + aw) || al > (bl + bw)); + }, + /** * Cleanup */ diff --git a/public/js/vendor/jquery.tipsy.js b/public/js/vendor/jquery.tipsy.js new file mode 100644 index 000000000..a17d7eeca --- /dev/null +++ b/public/js/vendor/jquery.tipsy.js @@ -0,0 +1,262 @@ +// tipsy, facebook style tooltips for jquery +// version 1.0.0a +// (c) 2008-2010 jason frame [jason@onehackoranother.com] +// released under the MIT license + +(function($) { + + function maybeCall(thing, ctx) { + return (typeof thing == 'function') ? (thing.call(ctx)) : thing; + }; + + function isElementInDOM(ele) { + while (ele = ele.parentNode) { + if (ele == document) return true; + } + return false; + }; + + function Tipsy(element, options) { + this.$element = $(element); + this.options = options; + this.enabled = true; + this.fixTitle(); + }; + + Tipsy.prototype = { + show: function() { + var title = this.getTitle(); + if (title && this.enabled) { + var $tip = this.tip(); + + $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title); + $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity + $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body); + + var pos = $.extend({}, this.$element.offset(), { + width: this.$element[0].offsetWidth, + height: this.$element[0].offsetHeight + }); + + var actualWidth = $tip[0].offsetWidth, + actualHeight = $tip[0].offsetHeight, + gravity = maybeCall(this.options.gravity, this.$element[0]); + + var tp; + switch (gravity.charAt(0)) { + case 'n': + tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; + break; + case 's': + tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; + break; + case 'e': + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset}; + break; + case 'w': + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset}; + break; + } + + if (gravity.length == 2) { + if (gravity.charAt(1) == 'w') { + tp.left = pos.left + pos.width / 2 - 15; + } else { + tp.left = pos.left + pos.width / 2 - actualWidth + 15; + } + } + + $tip.css(tp).addClass('tipsy-' + gravity); + $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0); + if (this.options.className) { + $tip.addClass(maybeCall(this.options.className, this.$element[0])); + } + + if (this.options.fade) { + $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}); + } else { + $tip.css({visibility: 'visible', opacity: this.options.opacity}); + } + } + }, + + hide: function() { + if (this.options.fade) { + this.tip().stop().fadeOut(function() { $(this).remove(); }); + } else { + this.tip().remove(); + } + }, + + fixTitle: function() { + var $e = this.$element; + if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') { + $e.attr('original-title', $e.attr('title') || '').removeAttr('title'); + } + }, + + getTitle: function() { + var title, $e = this.$element, o = this.options; + this.fixTitle(); + var title, o = this.options; + if (typeof o.title == 'string') { + title = $e.attr(o.title == 'title' ? 'original-title' : o.title); + } else if (typeof o.title == 'function') { + title = o.title.call($e[0]); + } + title = ('' + title).replace(/(^\s*|\s*$)/, ""); + return title || o.fallback; + }, + + tip: function() { + if (!this.$tip) { + this.$tip = $('
    ').html('
    '); + this.$tip.data('tipsy-pointee', this.$element[0]); + } + return this.$tip; + }, + + validate: function() { + if (!this.$element[0].parentNode) { + this.hide(); + this.$element = null; + this.options = null; + } + }, + + enable: function() { this.enabled = true; }, + disable: function() { this.enabled = false; }, + toggleEnabled: function() { this.enabled = !this.enabled; } + }; + + $.fn.tipsy = function(options) { + + if (options === true) { + return this.data('tipsy'); + } else if (typeof options == 'string') { + var tipsy = this.data('tipsy'); + if (tipsy) tipsy[options](); + return this; + } + + options = $.extend({}, $.fn.tipsy.defaults, options); + + function get(ele) { + var tipsy = $.data(ele, 'tipsy'); + if (!tipsy) { + tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options)); + $.data(ele, 'tipsy', tipsy); + } + return tipsy; + } + + function enter() { + var tipsy = get(this); + var ele = this; + tipsy.hoverState = 'in'; + if (options.delayIn == 0) { + tipsy.show(); + } else { + tipsy.fixTitle(); + setTimeout(function() { + if (tipsy.hoverState == 'in' && ele && isElementInDOM(ele)) + tipsy.show(); + }, options.delayIn); + } + }; + + function leave() { + var tipsy = get(this); + tipsy.hoverState = 'out'; + if (options.delayOut == 0) { + tipsy.hide(); + } else { + setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut); + } + }; + + if (!options.live) this.each(function() { get(this); }); + + if (options.trigger != 'manual') { + var binder = options.live ? 'live' : 'bind', + eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', + eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; + this[binder](eventIn, enter)[binder](eventOut, leave); + } + + return this; + + }; + + $.fn.tipsy.defaults = { + className: null, + delayIn: 0, + delayOut: 0, + fade: false, + fallback: '', + gravity: 'n', + html: false, + live: false, + offset: 0, + opacity: 0.8, + title: 'title', + trigger: 'hover' + }; + + $.fn.tipsy.revalidate = function() { + $('.tipsy').each(function() { + var pointee = $.data(this, 'tipsy-pointee'); + if (!pointee || !isElementInDOM(pointee)) { + $(this).remove(); + } + }); + }; + + // Overwrite this method to provide options on a per-element basis. + // For example, you could store the gravity in a 'tipsy-gravity' attribute: + // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' }); + // (remember - do not modify 'options' in place!) + $.fn.tipsy.elementOptions = function(ele, options) { + return $.metadata ? $.extend({}, options, $(ele).metadata()) : options; + }; + + $.fn.tipsy.autoNS = function() { + return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n'; + }; + + $.fn.tipsy.autoWE = function() { + return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w'; + }; + + /** + * yields a closure of the supplied parameters, producing a function that takes + * no arguments and is suitable for use as an autogravity function like so: + * + * @param margin (int) - distance from the viewable region edge that an + * element should be before setting its tooltip's gravity to be away + * from that edge. + * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer + * if there are no viewable region edges effecting the tooltip's + * gravity. It will try to vary from this minimally, for example, + * if 'sw' is preferred and an element is near the right viewable + * region edge, but not the top edge, it will set the gravity for + * that element's tooltip to be 'se', preserving the southern + * component. + */ + $.fn.tipsy.autoBounds = function(margin, prefer) { + return function() { + var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)}, + boundTop = $(document).scrollTop() + margin, + boundLeft = $(document).scrollLeft() + margin, + $this = $(this); + + if ($this.offset().top < boundTop) dir.ns = 'n'; + if ($this.offset().left < boundLeft) dir.ew = 'w'; + if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e'; + if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's'; + + return dir.ns + (dir.ew ? dir.ew : ''); + } + }; + +})(jQuery); diff --git a/public/js/vendor/jquery.tipsy.min.js b/public/js/vendor/jquery.tipsy.min.js new file mode 100644 index 000000000..2bf66bd16 --- /dev/null +++ b/public/js/vendor/jquery.tipsy.min.js @@ -0,0 +1,258 @@ +// tipsy, facebook style tooltips for jquery +// version 1.0.0a +// (c) 2008-2010 jason frame [jason@onehackoranother.com] +// released under the MIT license + +(function($) { + + function maybeCall(thing, ctx) { + return (typeof thing == 'function') ? (thing.call(ctx)) : thing; + }; + + function isElementInDOM(ele) { + while (ele = ele.parentNode) { + if (ele == document) return true; + } + return false; + }; + + function Tipsy(element, options) { + this.$element = $(element); + this.options = options; + this.enabled = true; + this.fixTitle(); + }; + + Tipsy.prototype = { + show: function() { + var title = this.getTitle(); + if (title && this.enabled) { + var $tip = this.tip(); + + $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title); + $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity + $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body); + + var pos = $.extend({}, this.$element.offset(), { + width: this.$element[0].offsetWidth, + height: this.$element[0].offsetHeight + }); + + var actualWidth = $tip[0].offsetWidth, + actualHeight = $tip[0].offsetHeight, + gravity = maybeCall(this.options.gravity, this.$element[0]); + + var tp; + switch (gravity.charAt(0)) { + case 'n': + tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; + break; + case 's': + tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; + break; + case 'e': + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset}; + break; + case 'w': + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset}; + break; + } + + if (gravity.length == 2) { + if (gravity.charAt(1) == 'w') { + tp.left = pos.left + pos.width / 2 - 15; + } else { + tp.left = pos.left + pos.width / 2 - actualWidth + 15; + } + } + + $tip.css(tp).addClass('tipsy-' + gravity); + $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0); + if (this.options.className) { + $tip.addClass(maybeCall(this.options.className, this.$element[0])); + } + + if (this.options.fade) { + $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}); + } else { + $tip.css({visibility: 'visible', opacity: this.options.opacity}); + } + } + }, + + hide: function() { + if (this.options.fade) { + this.tip().stop().fadeOut(function() { $(this).remove(); }); + } else { + this.tip().remove(); + } + }, + + fixTitle: function() { + var $e = this.$element; + if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') { + $e.attr('original-title', $e.attr('title') || '').removeAttr('title'); + } + }, + + getTitle: function() { + var title, $e = this.$element, o = this.options; + this.fixTitle(); + var title, o = this.options; + if (typeof o.title == 'string') { + title = $e.attr(o.title == 'title' ? 'original-title' : o.title); + } else if (typeof o.title == 'function') { + title = o.title.call($e[0]); + } + title = ('' + title).replace(/(^\s*|\s*$)/, ""); + return title || o.fallback; + }, + + tip: function() { + if (!this.$tip) { + this.$tip = $('
    ').html('
    '); + this.$tip.data('tipsy-pointee', this.$element[0]); + } + return this.$tip; + }, + + validate: function() { + if (!this.$element[0].parentNode) { + this.hide(); + this.$element = null; + this.options = null; + } + }, + + enable: function() { this.enabled = true; }, + disable: function() { this.enabled = false; }, + toggleEnabled: function() { this.enabled = !this.enabled; } + }; + + $.fn.tipsy = function(options) { + + if (options === true) { + return this.data('tipsy'); + } else if (typeof options == 'string') { + var tipsy = this.data('tipsy'); + if (tipsy) tipsy[options](); + return this; + } + + options = $.extend({}, $.fn.tipsy.defaults, options); + + function get(ele) { + var tipsy = $.data(ele, 'tipsy'); + if (!tipsy) { + tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options)); + $.data(ele, 'tipsy', tipsy); + } + return tipsy; + } + + function enter() { + var tipsy = get(this); + tipsy.hoverState = 'in'; + if (options.delayIn == 0) { + tipsy.show(); + } else { + tipsy.fixTitle(); + setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn); + } + }; + + function leave() { + var tipsy = get(this); + tipsy.hoverState = 'out'; + if (options.delayOut == 0) { + tipsy.hide(); + } else { + setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut); + } + }; + + if (!options.live) this.each(function() { get(this); }); + + if (options.trigger != 'manual') { + var binder = options.live ? 'live' : 'bind', + eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', + eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; + this[binder](eventIn, enter)[binder](eventOut, leave); + } + + return this; + + }; + + $.fn.tipsy.defaults = { + className: null, + delayIn: 0, + delayOut: 0, + fade: false, + fallback: '', + gravity: 'n', + html: false, + live: false, + offset: 0, + opacity: 0.8, + title: 'title', + trigger: 'hover' + }; + + $.fn.tipsy.revalidate = function() { + $('.tipsy').each(function() { + var pointee = $.data(this, 'tipsy-pointee'); + if (!pointee || !isElementInDOM(pointee)) { + $(this).remove(); + } + }); + }; + + // Overwrite this method to provide options on a per-element basis. + // For example, you could store the gravity in a 'tipsy-gravity' attribute: + // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' }); + // (remember - do not modify 'options' in place!) + $.fn.tipsy.elementOptions = function(ele, options) { + return $.metadata ? $.extend({}, options, $(ele).metadata()) : options; + }; + + $.fn.tipsy.autoNS = function() { + return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n'; + }; + + $.fn.tipsy.autoWE = function() { + return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w'; + }; + + /** + * yields a closure of the supplied parameters, producing a function that takes + * no arguments and is suitable for use as an autogravity function like so: + * + * @param margin (int) - distance from the viewable region edge that an + * element should be before setting its tooltip's gravity to be away + * from that edge. + * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer + * if there are no viewable region edges effecting the tooltip's + * gravity. It will try to vary from this minimally, for example, + * if 'sw' is preferred and an element is near the right viewable + * region edge, but not the top edge, it will set the gravity for + * that element's tooltip to be 'se', preserving the southern + * component. + */ + $.fn.tipsy.autoBounds = function(margin, prefer) { + return function() { + var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)}, + boundTop = $(document).scrollTop() + margin, + boundLeft = $(document).scrollLeft() + margin, + $this = $(this); + + if ($this.offset().top < boundTop) dir.ns = 'n'; + if ($this.offset().left < boundLeft) dir.ew = 'w'; + if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e'; + if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's'; + + return dir.ns + (dir.ew ? dir.ew : ''); + } + }; + +})(jQuery); From e45f50408ac5a95f7df77eb6a1faf5bbb392df7f Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 3 Sep 2014 16:14:14 +0200 Subject: [PATCH 136/257] Icinga\Protocol\File\Reader::fetchPairs(): rename variables $skipLines -> $skip $readLines -> $read refs #7060 --- library/Icinga/Protocol/File/Reader.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/library/Icinga/Protocol/File/Reader.php b/library/Icinga/Protocol/File/Reader.php index a9b0455b7..1ab088c9c 100644 --- a/library/Icinga/Protocol/File/Reader.php +++ b/library/Icinga/Protocol/File/Reader.php @@ -137,26 +137,26 @@ class Reader extends FilterIterator */ public function fetchPairs(Query $query) { - $skipLines = $query->getOffset(); - $readLines = $query->getLimit(); - if ($skipLines === null) { - $skipLines = 0; + $skip = $query->getOffset(); + $read = $query->getLimit(); + if ($skip === null) { + $skip = 0; } $lines = array(); if ($query->sortDesc()) { $count = $this->count($query); - if ($count <= $skipLines) { + if ($count <= $skip) { return $lines; - } else if ($count < ($skipLines + $readLines)) { - $readLines = $count - $skipLines; - $skipLines = 0; + } else if ($count < ($skip + $read)) { + $read = $count - $skip; + $skip = 0; } else { - $skipLines = $count - ($skipLines + $readLines); + $skip = $count - ($skip + $read); } } foreach ($this as $index => $line) { - if ($index >= $skipLines) { - if ($index >= $skipLines + $readLines) { + if ($index >= $skip) { + if ($index >= $skip + $read) { break; } $lines[] = $line; From 37b168995b0cce3ffd04cfe80c415c434c0fbf34 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Wed, 3 Sep 2014 17:01:07 +0200 Subject: [PATCH 137/257] Rename tipsy stylesheet file type to css and add license --- library/Icinga/Web/StyleSheet.php | 2 +- public/css/vendor/tipsy.css | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 public/css/vendor/tipsy.css diff --git a/library/Icinga/Web/StyleSheet.php b/library/Icinga/Web/StyleSheet.php index cb1d7aacd..0a2a33bc9 100644 --- a/library/Icinga/Web/StyleSheet.php +++ b/library/Icinga/Web/StyleSheet.php @@ -24,7 +24,7 @@ class StyleSheet 'css/icinga/selection-toolbar.less', 'css/icinga/login.less', 'css/icinga/charts.less', - 'css/vendor/tipsy.less' + 'css/vendor/tipsy.css' ); public static function compileForPdf() diff --git a/public/css/vendor/tipsy.css b/public/css/vendor/tipsy.css new file mode 100644 index 000000000..1da9aa9ac --- /dev/null +++ b/public/css/vendor/tipsy.css @@ -0,0 +1,30 @@ +/* tipsy, facebook style tooltips for jquery + version 1.0.0a + (c) 2008-2010 jason frame [jason@onehackoranother.com] + released under the MIT license */ + +.tipsy { font-size: 14px; position: absolute; padding: 5px; z-index: 100000; } + .tipsy-inner { background-color: #000; color: #FFF; max-width: 200px; padding: 5px 8px 4px 8px; text-align: center; } + + /* Rounded corners */ + .tipsy-inner { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; } + + /* Uncomment for shadow */ + /*.tipsy-inner { box-shadow: 0 0 5px #000000; -webkit-box-shadow: 0 0 5px #000000; -moz-box-shadow: 0 0 5px #000000; }*/ + + .tipsy-arrow { position: absolute; width: 0; height: 0; line-height: 0; border: 5px dashed #000; } + + /* Rules to colour arrows */ + .tipsy-arrow-n { border-bottom-color: #000; } + .tipsy-arrow-s { border-top-color: #000; } + .tipsy-arrow-e { border-left-color: #000; } + .tipsy-arrow-w { border-right-color: #000; } + + .tipsy-n .tipsy-arrow { top: 0px; left: 50%; margin-left: -5px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent; } + .tipsy-nw .tipsy-arrow { top: 0; left: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;} + .tipsy-ne .tipsy-arrow { top: 0; right: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;} + .tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -5px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; } + .tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; } + .tipsy-se .tipsy-arrow { bottom: 0; right: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; } + .tipsy-e .tipsy-arrow { right: 0; top: 50%; margin-top: -5px; border-left-style: solid; border-right: none; border-top-color: transparent; border-bottom-color: transparent; } + .tipsy-w .tipsy-arrow { left: 0; top: 50%; margin-top: -5px; border-right-style: solid; border-left: none; border-top-color: transparent; border-bottom-color: transparent; } From 593134203c16cbfbe31584929931ed4c61c1e19d Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Wed, 3 Sep 2014 17:02:01 +0200 Subject: [PATCH 138/257] Add minified version of tipsy sources --- public/js/vendor/jquery.tipsy.min.js | 260 +-------------------------- 1 file changed, 2 insertions(+), 258 deletions(-) diff --git a/public/js/vendor/jquery.tipsy.min.js b/public/js/vendor/jquery.tipsy.min.js index 2bf66bd16..59f6c2375 100644 --- a/public/js/vendor/jquery.tipsy.min.js +++ b/public/js/vendor/jquery.tipsy.min.js @@ -1,258 +1,2 @@ -// tipsy, facebook style tooltips for jquery -// version 1.0.0a -// (c) 2008-2010 jason frame [jason@onehackoranother.com] -// released under the MIT license - -(function($) { - - function maybeCall(thing, ctx) { - return (typeof thing == 'function') ? (thing.call(ctx)) : thing; - }; - - function isElementInDOM(ele) { - while (ele = ele.parentNode) { - if (ele == document) return true; - } - return false; - }; - - function Tipsy(element, options) { - this.$element = $(element); - this.options = options; - this.enabled = true; - this.fixTitle(); - }; - - Tipsy.prototype = { - show: function() { - var title = this.getTitle(); - if (title && this.enabled) { - var $tip = this.tip(); - - $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title); - $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity - $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body); - - var pos = $.extend({}, this.$element.offset(), { - width: this.$element[0].offsetWidth, - height: this.$element[0].offsetHeight - }); - - var actualWidth = $tip[0].offsetWidth, - actualHeight = $tip[0].offsetHeight, - gravity = maybeCall(this.options.gravity, this.$element[0]); - - var tp; - switch (gravity.charAt(0)) { - case 'n': - tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; - break; - case 's': - tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; - break; - case 'e': - tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset}; - break; - case 'w': - tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset}; - break; - } - - if (gravity.length == 2) { - if (gravity.charAt(1) == 'w') { - tp.left = pos.left + pos.width / 2 - 15; - } else { - tp.left = pos.left + pos.width / 2 - actualWidth + 15; - } - } - - $tip.css(tp).addClass('tipsy-' + gravity); - $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0); - if (this.options.className) { - $tip.addClass(maybeCall(this.options.className, this.$element[0])); - } - - if (this.options.fade) { - $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}); - } else { - $tip.css({visibility: 'visible', opacity: this.options.opacity}); - } - } - }, - - hide: function() { - if (this.options.fade) { - this.tip().stop().fadeOut(function() { $(this).remove(); }); - } else { - this.tip().remove(); - } - }, - - fixTitle: function() { - var $e = this.$element; - if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') { - $e.attr('original-title', $e.attr('title') || '').removeAttr('title'); - } - }, - - getTitle: function() { - var title, $e = this.$element, o = this.options; - this.fixTitle(); - var title, o = this.options; - if (typeof o.title == 'string') { - title = $e.attr(o.title == 'title' ? 'original-title' : o.title); - } else if (typeof o.title == 'function') { - title = o.title.call($e[0]); - } - title = ('' + title).replace(/(^\s*|\s*$)/, ""); - return title || o.fallback; - }, - - tip: function() { - if (!this.$tip) { - this.$tip = $('
    ').html('
    '); - this.$tip.data('tipsy-pointee', this.$element[0]); - } - return this.$tip; - }, - - validate: function() { - if (!this.$element[0].parentNode) { - this.hide(); - this.$element = null; - this.options = null; - } - }, - - enable: function() { this.enabled = true; }, - disable: function() { this.enabled = false; }, - toggleEnabled: function() { this.enabled = !this.enabled; } - }; - - $.fn.tipsy = function(options) { - - if (options === true) { - return this.data('tipsy'); - } else if (typeof options == 'string') { - var tipsy = this.data('tipsy'); - if (tipsy) tipsy[options](); - return this; - } - - options = $.extend({}, $.fn.tipsy.defaults, options); - - function get(ele) { - var tipsy = $.data(ele, 'tipsy'); - if (!tipsy) { - tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options)); - $.data(ele, 'tipsy', tipsy); - } - return tipsy; - } - - function enter() { - var tipsy = get(this); - tipsy.hoverState = 'in'; - if (options.delayIn == 0) { - tipsy.show(); - } else { - tipsy.fixTitle(); - setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn); - } - }; - - function leave() { - var tipsy = get(this); - tipsy.hoverState = 'out'; - if (options.delayOut == 0) { - tipsy.hide(); - } else { - setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut); - } - }; - - if (!options.live) this.each(function() { get(this); }); - - if (options.trigger != 'manual') { - var binder = options.live ? 'live' : 'bind', - eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', - eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; - this[binder](eventIn, enter)[binder](eventOut, leave); - } - - return this; - - }; - - $.fn.tipsy.defaults = { - className: null, - delayIn: 0, - delayOut: 0, - fade: false, - fallback: '', - gravity: 'n', - html: false, - live: false, - offset: 0, - opacity: 0.8, - title: 'title', - trigger: 'hover' - }; - - $.fn.tipsy.revalidate = function() { - $('.tipsy').each(function() { - var pointee = $.data(this, 'tipsy-pointee'); - if (!pointee || !isElementInDOM(pointee)) { - $(this).remove(); - } - }); - }; - - // Overwrite this method to provide options on a per-element basis. - // For example, you could store the gravity in a 'tipsy-gravity' attribute: - // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' }); - // (remember - do not modify 'options' in place!) - $.fn.tipsy.elementOptions = function(ele, options) { - return $.metadata ? $.extend({}, options, $(ele).metadata()) : options; - }; - - $.fn.tipsy.autoNS = function() { - return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n'; - }; - - $.fn.tipsy.autoWE = function() { - return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w'; - }; - - /** - * yields a closure of the supplied parameters, producing a function that takes - * no arguments and is suitable for use as an autogravity function like so: - * - * @param margin (int) - distance from the viewable region edge that an - * element should be before setting its tooltip's gravity to be away - * from that edge. - * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer - * if there are no viewable region edges effecting the tooltip's - * gravity. It will try to vary from this minimally, for example, - * if 'sw' is preferred and an element is near the right viewable - * region edge, but not the top edge, it will set the gravity for - * that element's tooltip to be 'se', preserving the southern - * component. - */ - $.fn.tipsy.autoBounds = function(margin, prefer) { - return function() { - var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)}, - boundTop = $(document).scrollTop() + margin, - boundLeft = $(document).scrollLeft() + margin, - $this = $(this); - - if ($this.offset().top < boundTop) dir.ns = 'n'; - if ($this.offset().left < boundLeft) dir.ew = 'w'; - if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e'; - if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's'; - - return dir.ns + (dir.ew ? dir.ew : ''); - } - }; - -})(jQuery); +/* tipsy, facebook style tooltips for jquery / version 1.0.0a / (c) 2008-2010 jason frame [jason@onehackoranother.com] / released under the MIT license / minified with uglifyjs */ +(function($){function maybeCall(thing,ctx){return typeof thing=="function"?thing.call(ctx):thing}function isElementInDOM(ele){while(ele=ele.parentNode){if(ele==document)return true}return false}function Tipsy(element,options){this.$element=$(element);this.options=options;this.enabled=true;this.fixTitle()}Tipsy.prototype={show:function(){var title=this.getTitle();if(title&&this.enabled){var $tip=this.tip();$tip.find(".tipsy-inner")[this.options.html?"html":"text"](title);$tip[0].className="tipsy";$tip.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var pos=$.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight});var actualWidth=$tip[0].offsetWidth,actualHeight=$tip[0].offsetHeight,gravity=maybeCall(this.options.gravity,this.$element[0]);var tp;switch(gravity.charAt(0)){case"n":tp={top:pos.top+pos.height+this.options.offset,left:pos.left+pos.width/2-actualWidth/2};break;case"s":tp={top:pos.top-actualHeight-this.options.offset,left:pos.left+pos.width/2-actualWidth/2};break;case"e":tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth-this.options.offset};break;case"w":tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width+this.options.offset};break}if(gravity.length==2){if(gravity.charAt(1)=="w"){tp.left=pos.left+pos.width/2-15}else{tp.left=pos.left+pos.width/2-actualWidth+15}}$tip.css(tp).addClass("tipsy-"+gravity);$tip.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+gravity.charAt(0);if(this.options.className){$tip.addClass(maybeCall(this.options.className,this.$element[0]))}if(this.options.fade){$tip.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity})}else{$tip.css({visibility:"visible",opacity:this.options.opacity})}}},hide:function(){if(this.options.fade){this.tip().stop().fadeOut(function(){$(this).remove()})}else{this.tip().remove()}},fixTitle:function(){var $e=this.$element;if($e.attr("title")||typeof $e.attr("original-title")!="string"){$e.attr("original-title",$e.attr("title")||"").removeAttr("title")}},getTitle:function(){var title,$e=this.$element,o=this.options;this.fixTitle();var title,o=this.options;if(typeof o.title=="string"){title=$e.attr(o.title=="title"?"original-title":o.title)}else if(typeof o.title=="function"){title=o.title.call($e[0])}title=(""+title).replace(/(^\s*|\s*$)/,"");return title||o.fallback},tip:function(){if(!this.$tip){this.$tip=$('
    ').html('
    ');this.$tip.data("tipsy-pointee",this.$element[0])}return this.$tip},validate:function(){if(!this.$element[0].parentNode){this.hide();this.$element=null;this.options=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=!this.enabled}};$.fn.tipsy=function(options){if(options===true){return this.data("tipsy")}else if(typeof options=="string"){var tipsy=this.data("tipsy");if(tipsy)tipsy[options]();return this}options=$.extend({},$.fn.tipsy.defaults,options);function get(ele){var tipsy=$.data(ele,"tipsy");if(!tipsy){tipsy=new Tipsy(ele,$.fn.tipsy.elementOptions(ele,options));$.data(ele,"tipsy",tipsy)}return tipsy}function enter(){var tipsy=get(this);var ele=this;tipsy.hoverState="in";if(options.delayIn==0){tipsy.show()}else{tipsy.fixTitle();setTimeout(function(){if(tipsy.hoverState=="in"&&ele&&isElementInDOM(ele))tipsy.show()},options.delayIn)}}function leave(){var tipsy=get(this);tipsy.hoverState="out";if(options.delayOut==0){tipsy.hide()}else{setTimeout(function(){if(tipsy.hoverState=="out")tipsy.hide()},options.delayOut)}}if(!options.live)this.each(function(){get(this)});if(options.trigger!="manual"){var binder=options.live?"live":"bind",eventIn=options.trigger=="hover"?"mouseenter":"focus",eventOut=options.trigger=="hover"?"mouseleave":"blur";this[binder](eventIn,enter)[binder](eventOut,leave)}return this};$.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:false,fallback:"",gravity:"n",html:false,live:false,offset:0,opacity:.8,title:"title",trigger:"hover"};$.fn.tipsy.revalidate=function(){$(".tipsy").each(function(){var pointee=$.data(this,"tipsy-pointee");if(!pointee||!isElementInDOM(pointee)){$(this).remove()}})};$.fn.tipsy.elementOptions=function(ele,options){return $.metadata?$.extend({},options,$(ele).metadata()):options};$.fn.tipsy.autoNS=function(){return $(this).offset().top>$(document).scrollTop()+$(window).height()/2?"s":"n"};$.fn.tipsy.autoWE=function(){return $(this).offset().left>$(document).scrollLeft()+$(window).width()/2?"e":"w"};$.fn.tipsy.autoBounds=function(margin,prefer){return function(){var dir={ns:prefer[0],ew:prefer.length>1?prefer[1]:false},boundTop=$(document).scrollTop()+margin,boundLeft=$(document).scrollLeft()+margin,$this=$(this);if($this.offset().top Date: Wed, 3 Sep 2014 17:03:04 +0200 Subject: [PATCH 139/257] Add information about the source and installation of all needed jquery-tipsy files --- public/js/vendor/SOURCE.jquery.tipsy | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 public/js/vendor/SOURCE.jquery.tipsy diff --git a/public/js/vendor/SOURCE.jquery.tipsy b/public/js/vendor/SOURCE.jquery.tipsy new file mode 100644 index 000000000..5df83c9c9 --- /dev/null +++ b/public/js/vendor/SOURCE.jquery.tipsy @@ -0,0 +1,33 @@ +jquery.tipsy.js SOURCE +====================== + +This file contains information about how to acquire and install the source files for jquery.tipsy + + +# version + + 1.0.0a + + +# license + + MIT license + + +# used files + + src/javascript/tipsy.css + src/javascript/jquery.tipsy.js + + +# source + + https://github.com/jaz303/tipsy.git + + +# installation + + + mv src/javascript/tipsy.css ICINGAWEB/public/css/vendor/tipsy.css + mv src/javascript/jquery.tipsy.js ICINGAWEB/public/js/vendor/jquery.tipsy.js + uglifyjs src/javascript/jquery.tipsy.js ICINGAWEB/public/js/vendor/jquery.tipsy.min.js \ No newline at end of file From 510e38335e09a6b3f7fe1507af7d3322ffc4b655 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Wed, 3 Sep 2014 17:42:31 +0200 Subject: [PATCH 140/257] Remove useless tooltip from host and service list remove titles from time spans on all td.state, since the formatted time is already displayed in the inner div --- public/js/icinga/events.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index e9ef7b2ea..dfeec81cf 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -53,6 +53,8 @@ } }); + $('td.state span.timesince').attr('title', null); + var moduleName = el.data('icingaModule'); if (moduleName) { if (icinga.hasModule(moduleName)) { From ede5b8f0b90388da2c8e20de31ca8f46ed15292f Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 3 Sep 2014 18:36:59 +0200 Subject: [PATCH 141/257] Icinga\Protocol\File\Reader::fetchPairs(): increase $index manually as the iterator's one makes trouble refs #7060 --- library/Icinga/Protocol/File/Reader.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Protocol/File/Reader.php b/library/Icinga/Protocol/File/Reader.php index 1ab088c9c..0f5509b7b 100644 --- a/library/Icinga/Protocol/File/Reader.php +++ b/library/Icinga/Protocol/File/Reader.php @@ -154,13 +154,15 @@ class Reader extends FilterIterator $skip = $count - ($skip + $read); } } - foreach ($this as $index => $line) { + $index = 0; + foreach ($this as $line) { if ($index >= $skip) { if ($index >= $skip + $read) { break; } $lines[] = $line; } + ++$index; } if ($query->sortDesc()) { $lines = array_reverse($lines); From 8fdf20fbf25b7877da0f188434e7e90f362b6fbf Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 3 Sep 2014 18:55:20 +0200 Subject: [PATCH 142/257] Groupsummary: remove invalid sort column discovery This didn't result in a loop 'til now as it wasn't even used. The problem here is that the same View is used for tow differend things, this makes no sense. In the meantime removing that code fixes related problems. --- .../application/controllers/ChartController.php | 4 ++-- .../library/Monitoring/DataView/Groupsummary.php | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/modules/monitoring/application/controllers/ChartController.php b/modules/monitoring/application/controllers/ChartController.php index af6240259..8cf6f8bd4 100644 --- a/modules/monitoring/application/controllers/ChartController.php +++ b/modules/monitoring/application/controllers/ChartController.php @@ -99,7 +99,7 @@ class Monitoring_ChartController extends Controller 'services_warning_unhandled', 'services_pending' ) - )->getQuery()->fetchAll(); + )->order('hostgroup')->getQuery()->fetchAll(); $this->view->height = intval($this->getParam('height', 500)); $this->view->width = intval($this->getParam('width', 500)); if (count($query) === 1) { @@ -124,7 +124,7 @@ class Monitoring_ChartController extends Controller 'services_warning_unhandled', 'services_pending' ) - )->getQuery()->fetchAll(); + )->order('servicegroup')->getQuery()->fetchAll(); $this->view->height = intval($this->getParam('height', 500)); $this->view->width = intval($this->getParam('width', 500)); diff --git a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php index a623dab45..72b021fa9 100644 --- a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php +++ b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php @@ -37,20 +37,4 @@ class Groupsummary extends DataView 'services_pending' ); } - - public function getSortRules() - { - if (in_array('servicegroup', $this->getQuery()->getColumns())) { - return array( - 'servicegroup' => array( - 'order' => self::SORT_ASC - ) - ); - } - return array( - 'hostgroup' => array( - 'order' => self::SORT_ASC - ) - ); - } } From 868e8b25b6e2d7adea9db1398b2911c2535c0171 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 4 Sep 2014 09:32:15 +0200 Subject: [PATCH 143/257] Fix left over tooltips after reloads with layout shift --- public/js/icinga/events.js | 60 +++++++++++++------------------------- 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index dfeec81cf..37bb8d38d 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -10,6 +10,8 @@ 'use strict'; + var mouseX, mouseY; + Icinga.Events = function (icinga) { this.icinga = icinga; @@ -115,56 +117,36 @@ $('[title]').each(function () { var $el = $(this); $el.attr('title', $el.attr('title-rich') || $el.attr('title')); - // $el.attr('title', null); }); - $('svg rect.chart-data[title]', el).tipsy({ gravity: 'e', html: true }); $('.historycolorgrid a[title]', el).tipsy({ gravity: 's', offset: 2 }); $('img.icon[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, offset: 2 }); $('[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, delayIn: 500 }); - // Rescue or remove all orphaned tooltips + // migrate or remove all orphaned tooltips $('.tipsy').each(function () { - function isElementInDOM(ele) { - while (ele = ele.parentNode) { - if (ele == document) return true; - } - return false; - }; - var arrow = $('.tipsy-arrow', this)[0]; if (!icinga.utils.elementsOverlap(arrow, $('#main')[0])) { $(this).remove(); return; } - // all tooltips are direct children of the body - // so we need find out whether the tooltip belongs applied area, - // by checking if both areas overlap if (!icinga.utils.elementsOverlap(arrow, el)) { - // tooltip does not belong to this area return; } - - var pointee = $.data(this, 'tipsy-pointee'); - if (!pointee || !isElementInDOM(pointee)) { - var orphan = this; - var oldTitle = $(this).find('.tipsy-inner').html(); - var migrated = false; - // try to find an element with the same title - $('[original-title="' + oldTitle + '"]').each(function() { - // get stored instance of Tipsy from newly created element - // point it to the orphaned tooltip - var tipsy = $.data(this, 'tipsy'); - tipsy.$tip = $(orphan); - $.data(this, 'tipsy', tipsy); - - // orphaned tooltip has the new element as pointee - $.data(orphan, 'tipsy-pointee', this); - migrated = true; - }); - if (!migrated) { - $(orphan).remove(); - } + + var title = $(this).find('.tipsy-inner').html(); + var atMouse = document.elementFromPoint(mouseX, mouseY); + var nearestTip = $(atMouse) + .closest('[original-title="' + title + '"]')[0]; + if (nearestTip) { + console.log ('migrating orphan...'); + var tipsy = $.data(nearestTip, 'tipsy'); + tipsy.$tip = $(this); + $.data(this, 'tipsy-pointee', nearestTip); + } else { + // doesn't match delete + console.log ('deleting orphan...'); + $(this).remove(); } }); }, @@ -221,11 +203,9 @@ // $(document).on('change', 'form.auto input', this.formChanged); // $(document).on('change', 'form.auto select', this.submitForm); - $(document).on('mouseenter', '[title-original]', { gravity: 'n' }, function(event) { - icinga.ui.hoverTooltip (this, event.data); - }); - $(document).on('mouseleave', '[title-original]', {}, function() { - icinga.ui.unhoverTooltip (this); + $(document).on('mousemove', function (event) { + mouseX = event.pageX; + mouseY = event.pageY; }); }, From e5be8d47ef388bdd405200a4ff334051f7e869c8 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 4 Sep 2014 09:53:57 +0200 Subject: [PATCH 144/257] Fix SVG bound calculation for tooltips in Firefox --- public/js/icinga/events.js | 2 +- public/js/vendor/SOURCE.jquery.tipsy | 22 ++++++++++++++++++++-- public/js/vendor/jquery.tipsy.js | 4 ++-- public/js/vendor/jquery.tipsy.min.js | 8 ++++++-- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index 37bb8d38d..6cae68f0c 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -118,7 +118,7 @@ var $el = $(this); $el.attr('title', $el.attr('title-rich') || $el.attr('title')); }); - $('svg rect.chart-data[title]', el).tipsy({ gravity: 'e', html: true }); + $('svg rect.chart-data[title]', el).tipsy({ gravity: 'se', html: true }); $('.historycolorgrid a[title]', el).tipsy({ gravity: 's', offset: 2 }); $('img.icon[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, offset: 2 }); $('[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, delayIn: 500 }); diff --git a/public/js/vendor/SOURCE.jquery.tipsy b/public/js/vendor/SOURCE.jquery.tipsy index 5df83c9c9..665f25df5 100644 --- a/public/js/vendor/SOURCE.jquery.tipsy +++ b/public/js/vendor/SOURCE.jquery.tipsy @@ -25,9 +25,27 @@ This file contains information about how to acquire and install the source files https://github.com/jaz303/tipsy.git -# installation +# apply hotfix (firefox SVG bound calculation) +--- jquery.tipsy.js ++++ jquery.tipsy.js +@@ -34,8 +34,8 @@ + $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body); + + var pos = $.extend({}, this.$element.offset(), { +- width: this.$element[0].offsetWidth, +- height: this.$element[0].offsetHeight ++ width: this.$element[0].offsetWidth || this.$element[0].getBoundingClientRect().width, ++ height: this.$element[0].offsetHeight || this.$element[0].getBoundingClientRect().height + }); + + var actualWidth = $tip[0].offsetWidth, + + +# installation mv src/javascript/tipsy.css ICINGAWEB/public/css/vendor/tipsy.css mv src/javascript/jquery.tipsy.js ICINGAWEB/public/js/vendor/jquery.tipsy.js - uglifyjs src/javascript/jquery.tipsy.js ICINGAWEB/public/js/vendor/jquery.tipsy.min.js \ No newline at end of file + uglifyjs src/javascript/jquery.tipsy.js ICINGAWEB/public/js/vendor/jquery.tipsy.min.js + + diff --git a/public/js/vendor/jquery.tipsy.js b/public/js/vendor/jquery.tipsy.js index a17d7eeca..eeb5e67d8 100644 --- a/public/js/vendor/jquery.tipsy.js +++ b/public/js/vendor/jquery.tipsy.js @@ -34,8 +34,8 @@ $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body); var pos = $.extend({}, this.$element.offset(), { - width: this.$element[0].offsetWidth, - height: this.$element[0].offsetHeight + width: this.$element[0].offsetWidth || this.$element[0].getBoundingClientRect().width, + height: this.$element[0].offsetHeight || this.$element[0].getBoundingClientRect().height }); var actualWidth = $tip[0].offsetWidth, diff --git a/public/js/vendor/jquery.tipsy.min.js b/public/js/vendor/jquery.tipsy.min.js index 59f6c2375..66b085755 100644 --- a/public/js/vendor/jquery.tipsy.min.js +++ b/public/js/vendor/jquery.tipsy.min.js @@ -1,2 +1,6 @@ -/* tipsy, facebook style tooltips for jquery / version 1.0.0a / (c) 2008-2010 jason frame [jason@onehackoranother.com] / released under the MIT license / minified with uglifyjs */ -(function($){function maybeCall(thing,ctx){return typeof thing=="function"?thing.call(ctx):thing}function isElementInDOM(ele){while(ele=ele.parentNode){if(ele==document)return true}return false}function Tipsy(element,options){this.$element=$(element);this.options=options;this.enabled=true;this.fixTitle()}Tipsy.prototype={show:function(){var title=this.getTitle();if(title&&this.enabled){var $tip=this.tip();$tip.find(".tipsy-inner")[this.options.html?"html":"text"](title);$tip[0].className="tipsy";$tip.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var pos=$.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight});var actualWidth=$tip[0].offsetWidth,actualHeight=$tip[0].offsetHeight,gravity=maybeCall(this.options.gravity,this.$element[0]);var tp;switch(gravity.charAt(0)){case"n":tp={top:pos.top+pos.height+this.options.offset,left:pos.left+pos.width/2-actualWidth/2};break;case"s":tp={top:pos.top-actualHeight-this.options.offset,left:pos.left+pos.width/2-actualWidth/2};break;case"e":tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth-this.options.offset};break;case"w":tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width+this.options.offset};break}if(gravity.length==2){if(gravity.charAt(1)=="w"){tp.left=pos.left+pos.width/2-15}else{tp.left=pos.left+pos.width/2-actualWidth+15}}$tip.css(tp).addClass("tipsy-"+gravity);$tip.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+gravity.charAt(0);if(this.options.className){$tip.addClass(maybeCall(this.options.className,this.$element[0]))}if(this.options.fade){$tip.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity})}else{$tip.css({visibility:"visible",opacity:this.options.opacity})}}},hide:function(){if(this.options.fade){this.tip().stop().fadeOut(function(){$(this).remove()})}else{this.tip().remove()}},fixTitle:function(){var $e=this.$element;if($e.attr("title")||typeof $e.attr("original-title")!="string"){$e.attr("original-title",$e.attr("title")||"").removeAttr("title")}},getTitle:function(){var title,$e=this.$element,o=this.options;this.fixTitle();var title,o=this.options;if(typeof o.title=="string"){title=$e.attr(o.title=="title"?"original-title":o.title)}else if(typeof o.title=="function"){title=o.title.call($e[0])}title=(""+title).replace(/(^\s*|\s*$)/,"");return title||o.fallback},tip:function(){if(!this.$tip){this.$tip=$('
    ').html('
    ');this.$tip.data("tipsy-pointee",this.$element[0])}return this.$tip},validate:function(){if(!this.$element[0].parentNode){this.hide();this.$element=null;this.options=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=!this.enabled}};$.fn.tipsy=function(options){if(options===true){return this.data("tipsy")}else if(typeof options=="string"){var tipsy=this.data("tipsy");if(tipsy)tipsy[options]();return this}options=$.extend({},$.fn.tipsy.defaults,options);function get(ele){var tipsy=$.data(ele,"tipsy");if(!tipsy){tipsy=new Tipsy(ele,$.fn.tipsy.elementOptions(ele,options));$.data(ele,"tipsy",tipsy)}return tipsy}function enter(){var tipsy=get(this);var ele=this;tipsy.hoverState="in";if(options.delayIn==0){tipsy.show()}else{tipsy.fixTitle();setTimeout(function(){if(tipsy.hoverState=="in"&&ele&&isElementInDOM(ele))tipsy.show()},options.delayIn)}}function leave(){var tipsy=get(this);tipsy.hoverState="out";if(options.delayOut==0){tipsy.hide()}else{setTimeout(function(){if(tipsy.hoverState=="out")tipsy.hide()},options.delayOut)}}if(!options.live)this.each(function(){get(this)});if(options.trigger!="manual"){var binder=options.live?"live":"bind",eventIn=options.trigger=="hover"?"mouseenter":"focus",eventOut=options.trigger=="hover"?"mouseleave":"blur";this[binder](eventIn,enter)[binder](eventOut,leave)}return this};$.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:false,fallback:"",gravity:"n",html:false,live:false,offset:0,opacity:.8,title:"title",trigger:"hover"};$.fn.tipsy.revalidate=function(){$(".tipsy").each(function(){var pointee=$.data(this,"tipsy-pointee");if(!pointee||!isElementInDOM(pointee)){$(this).remove()}})};$.fn.tipsy.elementOptions=function(ele,options){return $.metadata?$.extend({},options,$(ele).metadata()):options};$.fn.tipsy.autoNS=function(){return $(this).offset().top>$(document).scrollTop()+$(window).height()/2?"s":"n"};$.fn.tipsy.autoWE=function(){return $(this).offset().left>$(document).scrollLeft()+$(window).width()/2?"e":"w"};$.fn.tipsy.autoBounds=function(margin,prefer){return function(){var dir={ns:prefer[0],ew:prefer.length>1?prefer[1]:false},boundTop=$(document).scrollTop()+margin,boundLeft=$(document).scrollLeft()+margin,$this=$(this);if($this.offset().top
    ').html('
    ');this.$tip.data("tipsy-pointee",this.$element[0])}return this.$tip},validate:function(){if(!this.$element[0].parentNode){this.hide();this.$element=null;this.options=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=!this.enabled}};$.fn.tipsy=function(options){if(options===true){return this.data("tipsy")}else if(typeof options=="string"){var tipsy=this.data("tipsy");if(tipsy)tipsy[options]();return this}options=$.extend({},$.fn.tipsy.defaults,options);function get(ele){var tipsy=$.data(ele,"tipsy");if(!tipsy){tipsy=new Tipsy(ele,$.fn.tipsy.elementOptions(ele,options));$.data(ele,"tipsy",tipsy)}return tipsy}function enter(){var tipsy=get(this);var ele=this;tipsy.hoverState="in";if(options.delayIn==0){tipsy.show()}else{tipsy.fixTitle();setTimeout(function(){if(tipsy.hoverState=="in"&&ele&&isElementInDOM(ele))tipsy.show()},options.delayIn)}}function leave(){var tipsy=get(this);tipsy.hoverState="out";if(options.delayOut==0){tipsy.hide()}else{setTimeout(function(){if(tipsy.hoverState=="out")tipsy.hide()},options.delayOut)}}if(!options.live)this.each(function(){get(this)});if(options.trigger!="manual"){var binder=options.live?"live":"bind",eventIn=options.trigger=="hover"?"mouseenter":"focus",eventOut=options.trigger=="hover"?"mouseleave":"blur";this[binder](eventIn,enter)[binder](eventOut,leave)}return this};$.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:false,fallback:"",gravity:"n",html:false,live:false,offset:0,opacity:.8,title:"title",trigger:"hover"};$.fn.tipsy.revalidate=function(){$(".tipsy").each(function(){var pointee=$.data(this,"tipsy-pointee");if(!pointee||!isElementInDOM(pointee)){$(this).remove()}})};$.fn.tipsy.elementOptions=function(ele,options){return $.metadata?$.extend({},options,$(ele).metadata()):options};$.fn.tipsy.autoNS=function(){return $(this).offset().top>$(document).scrollTop()+$(window).height()/2?"s":"n"};$.fn.tipsy.autoWE=function(){return $(this).offset().left>$(document).scrollLeft()+$(window).width()/2?"e":"w"};$.fn.tipsy.autoBounds=function(margin,prefer){return function(){var dir={ns:prefer[0],ew:prefer.length>1?prefer[1]:false},boundTop=$(document).scrollTop()+margin,boundLeft=$(document).scrollLeft()+margin,$this=$(this);if($this.offset().top Date: Thu, 4 Sep 2014 13:32:30 +0200 Subject: [PATCH 145/257] Do not use an invalid HTML attributes for rich titles --- library/Icinga/Chart/Graph/BarGraph.php | 2 +- public/js/icinga/events.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Chart/Graph/BarGraph.php b/library/Icinga/Chart/Graph/BarGraph.php index 3d6a5c234..1225307ad 100644 --- a/library/Icinga/Chart/Graph/BarGraph.php +++ b/library/Icinga/Chart/Graph/BarGraph.php @@ -144,7 +144,7 @@ class BarGraph extends Styleable implements Drawable $this->tooltips[$x]->renderNoHtml($this->order, $data, $format) ); $bar->setAttribute( - 'title-rich', + 'data-title-rich', $this->tooltips[$x]->render($this->order, $data, $format) ); } diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index 6cae68f0c..e786a35da 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -116,7 +116,7 @@ $('[title]').each(function () { var $el = $(this); - $el.attr('title', $el.attr('title-rich') || $el.attr('title')); + $el.attr('title', $el.data('title-rich') || $el.attr('title')); }); $('svg rect.chart-data[title]', el).tipsy({ gravity: 'se', html: true }); $('.historycolorgrid a[title]', el).tipsy({ gravity: 's', offset: 2 }); From 4fb47ef768d143a5b40c89c6a3f97c5880455310 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 4 Sep 2014 12:15:24 +0200 Subject: [PATCH 146/257] Hook classes: Add class suffix if not exist refs #7066 refs #7067 refs #7068 --- library/Icinga/Web/Hook.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Web/Hook.php b/library/Icinga/Web/Hook.php index b88069da1..8e65bb33c 100644 --- a/library/Icinga/Web/Hook.php +++ b/library/Icinga/Web/Hook.php @@ -123,7 +123,12 @@ class Hook */ private static function assertValidHook($instance, $name) { - $base_class = self::$BASE_NS . ucfirst($name) . self::$classSuffix; + $base_class = self::$BASE_NS . ucfirst($name); + + if (strpos($base_class, self::$classSuffix) === false) { + $base_class .= self::$classSuffix; + } + if (!$instance instanceof $base_class) { throw new ProgrammingError( '%s is not an instance of %s', From f8b3ffb3c860925755b4d499c54df25cce237a5d Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 4 Sep 2014 13:07:03 +0200 Subject: [PATCH 147/257] AbstractObject: Rename to MonitoredObject refs #6932 --- .../monitoring/application/controllers/ShowController.php | 4 ++-- .../application/forms/Command/ScheduleDowntimeForm.php | 4 ++-- .../application/views/helpers/MonitoringFlags.php | 6 +++--- .../monitoring/application/views/helpers/ResolveMacros.php | 6 +++--- modules/monitoring/library/Monitoring/Object/Host.php | 2 +- .../Object/{AbstractObject.php => MonitoredObject.php} | 2 +- modules/monitoring/library/Monitoring/Object/Service.php | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) rename modules/monitoring/library/Monitoring/Object/{AbstractObject.php => MonitoredObject.php} (99%) diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 0200284ce..6c4d3c310 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -3,13 +3,13 @@ // {{{ICINGA_LICENSE_HEADER}}} use Icinga\Application\Benchmark; +use Icinga\Module\Monitoring\Object\MonitoredObject; use Icinga\Web\Hook; use Icinga\Web\Widget\Tabs; use Icinga\Web\Widget\Tabextension\OutputFormat; use Icinga\Web\Widget\Tabextension\DashboardAction; use Icinga\Module\Monitoring\Backend; use Icinga\Module\Monitoring\Controller; -use Icinga\Module\Monitoring\Object\AbstractObject; use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\Service; @@ -41,7 +41,7 @@ class Monitoring_ShowController extends Controller $this->view->object = new Service($this->params); } else { // TODO: Well... this could be done better - $this->view->object = AbstractObject::fromParams($this->params); + $this->view->object = MonitoredObject::fromParams($this->params); } if (Hook::has('ticket')) { $this->view->tickets = Hook::first('ticket'); diff --git a/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php b/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php index 593654c02..73ce2666c 100644 --- a/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php +++ b/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php @@ -4,6 +4,7 @@ namespace Icinga\Module\Monitoring\Form\Command; +use Icinga\Module\Monitoring\Object\MonitoredObject; use Zend_Form_Element_Text; use Zend_Validate_GreaterThan; use Zend_Validate_Digits; @@ -12,7 +13,6 @@ use Icinga\Protocol\Commandpipe\Comment; use Icinga\Util\DateTimeFactory; use Icinga\Module\Monitoring\Backend; use Icinga\Module\Monitoring\Command\ScheduleDowntimeCommand; -use Icinga\Module\Monitoring\Object\AbstractObject; use Icinga\Module\Monitoring\Object\Service; use Icinga\Web\Url; @@ -67,7 +67,7 @@ class ScheduleDowntimeForm extends WithChildrenCommandForm $cfg = $this->getConfiguration(); $preferences = $this->getUserPreferences(); - $object = AbstractObject::fromParams(Url::fromRequest()->getParams()); + $object = MonitoredObject::fromParams(Url::fromRequest()->getParams()); $object->fetchDowntimes(); $downtimes = $object->downtimes; /* diff --git a/modules/monitoring/application/views/helpers/MonitoringFlags.php b/modules/monitoring/application/views/helpers/MonitoringFlags.php index f543fac59..db4b8dedc 100644 --- a/modules/monitoring/application/views/helpers/MonitoringFlags.php +++ b/modules/monitoring/application/views/helpers/MonitoringFlags.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -/*use Icinga\Module\Monitoring\Object\AbstractObject;*/ +/* use Icinga\Module\Monitoring\Object\MonitoredObject; */ /** * Rendering helper for object's properties which may be either enabled or disabled @@ -26,11 +26,11 @@ class Zend_View_Helper_MonitoringFlags extends Zend_View_Helper_Abstract /** * Retrieve flags as array with either true or false as value * - * @param AbstractObject $object + * @param MonitoredObject $object * * @return array */ - public function monitoringFlags(/*AbstractObject*/$object) + public function monitoringFlags(/*MonitoredObject*/ $object) { $flags = array(); foreach (self::$flags as $column => $description) { diff --git a/modules/monitoring/application/views/helpers/ResolveMacros.php b/modules/monitoring/application/views/helpers/ResolveMacros.php index b0f007b19..385962a85 100644 --- a/modules/monitoring/application/views/helpers/ResolveMacros.php +++ b/modules/monitoring/application/views/helpers/ResolveMacros.php @@ -3,7 +3,7 @@ // {{{ICINGA_LICENSE_HEADER}}} use \Zend_View_Helper_Abstract; -use Icinga\Module\Monitoring\Object\AbstractObject; +use Icinga\Module\Monitoring\Object\MonitoredObject; class Zend_View_Helper_ResolveMacros extends Zend_View_Helper_Abstract { @@ -22,7 +22,7 @@ class Zend_View_Helper_ResolveMacros extends Zend_View_Helper_Abstract * Return the given string with macros being resolved * * @param string $input The string in which to look for macros - * @param AbstractObject|stdClass $object The host or service used to resolve macros + * @param MonitoredObject|stdClass $object The host or service used to resolve macros * * @return string The substituted or unchanged string */ @@ -45,7 +45,7 @@ class Zend_View_Helper_ResolveMacros extends Zend_View_Helper_Abstract * Resolve a macro based on the given object * * @param string $macro The macro to resolve - * @param AbstractObject|stdClass $object The object used to resolve the macro + * @param MonitoredObject|stdClass $object The object used to resolve the macro * * @return string The new value or the macro if it cannot be resolved */ diff --git a/modules/monitoring/library/Monitoring/Object/Host.php b/modules/monitoring/library/Monitoring/Object/Host.php index 8dbe1176e..7cbe637de 100644 --- a/modules/monitoring/library/Monitoring/Object/Host.php +++ b/modules/monitoring/library/Monitoring/Object/Host.php @@ -7,7 +7,7 @@ namespace Icinga\Module\Monitoring\Object; use Icinga\Module\Monitoring\DataView\HostStatus; use Icinga\Data\Db\DbQuery; -class Host extends AbstractObject +class Host extends MonitoredObject { public $type = 'host'; public $prefix = 'host_'; diff --git a/modules/monitoring/library/Monitoring/Object/AbstractObject.php b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php similarity index 99% rename from modules/monitoring/library/Monitoring/Object/AbstractObject.php rename to modules/monitoring/library/Monitoring/Object/MonitoredObject.php index 703d05780..8ff79f7b8 100644 --- a/modules/monitoring/library/Monitoring/Object/AbstractObject.php +++ b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php @@ -23,7 +23,7 @@ use Icinga\Web\UrlParams; use Icinga\Application\Config; -abstract class AbstractObject +abstract class MonitoredObject { public $type; public $prefix; diff --git a/modules/monitoring/library/Monitoring/Object/Service.php b/modules/monitoring/library/Monitoring/Object/Service.php index 598bb384d..3c9be7c2c 100644 --- a/modules/monitoring/library/Monitoring/Object/Service.php +++ b/modules/monitoring/library/Monitoring/Object/Service.php @@ -7,7 +7,7 @@ namespace Icinga\Module\Monitoring\Object; use Icinga\Module\Monitoring\DataView\ServiceStatus; use Icinga\Data\Db\DbQuery; -class Service extends AbstractObject +class Service extends MonitoredObject { public $type = 'service'; public $prefix = 'service_'; From c8eaf66823cd0225cdd975ea14fd8a7cc49a409e Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 4 Sep 2014 13:31:04 +0200 Subject: [PATCH 148/257] GrapherHook: Rework hook refs #6932 --- library/Icinga/Web/Hook/GrapherHook.php | 104 ++++++++++-------------- 1 file changed, 43 insertions(+), 61 deletions(-) diff --git a/library/Icinga/Web/Hook/GrapherHook.php b/library/Icinga/Web/Hook/GrapherHook.php index 99ab8a8f6..a48c50ed6 100644 --- a/library/Icinga/Web/Hook/GrapherHook.php +++ b/library/Icinga/Web/Hook/GrapherHook.php @@ -5,26 +5,30 @@ namespace Icinga\Web\Hook; use Icinga\Exception\ProgrammingError; +use Icinga\Module\Monitoring\Object\MonitoredObject; /** * Icinga Web Grapher Hook base class * * Extend this class if you want to integrate your graphing solution nicely into - * Icinga Web - * - * @copyright Copyright (c) 2013 Icinga-Web Team - * @author Icinga-Web Team - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License + * Icinga Web. */ -abstract class GrapherHook +abstract class GrapherHook extends WebBaseHook { /** - * Whether this grapher provides preview images + * Whether this grapher provides previews * * @var bool */ protected $hasPreviews = false; + /** + * Whether this grapher provides tiny previews + * + * @var bool + */ + protected $hasTinyPreviews = false; + /** * Constructor must live without arguments right now * @@ -36,16 +40,6 @@ abstract class GrapherHook $this->init(); } - /** - * Whether this grapher provides preview images - * - * @return bool - */ - public function hasPreviews() - { - return $this->hasPreviews; - } - /** * Overwrite this function if you want to do some initialization stuff * @@ -56,75 +50,63 @@ abstract class GrapherHook } /** - * Whether a graph for the given host[, service [, plot]] exists - * - * @param string $host - * @param string $service - * @param string $plot + * Whether this grapher provides previews * * @return bool */ - public function has($host, $service = null, $plot = null) + public function hasPreviews() { - return false; + return $this->hasPreviews; } /** - * Get a preview image for the given host[, service [, plot]] exists + * Whether this grapher provides tiny previews * - * @param string $host - * @param string $service - * @param string $plot - * - * @return string - * - * @throws ProgrammingError + * @return bool */ - public function getPreviewHtml($host, $service = null, $plot = null) + public function hasTinyPreviews() { - throw new ProgrammingError('This backend has no preview images'); + return $this->hasTinyPreviews; } /** - * Whether a tiny graph for the given host[, service [, plot]] exists + * Whether a graph for the monitoring object exist * - * @param string $host - * @param string $service - * @param string $plot + * @param MonitoredObject $object * * @return bool */ - public function hasTinyPreview($host, $service = null, $plot = null) - { - return false; - } + abstract public function has(MonitoredObject $object); /** - * Get a tiny preview image for the given host[, service [, plot]] exists + * Get a preview for the given object * - * @param string $host - * @param string $service - * @param string $plot + * This function must return an empty string if no graph exists. + * + * @param MonitoredObject $object * * @return string + * @throws ProgrammingError * + */ + public function getPreviewHtml(MonitoredObject $object) + { + throw new ProgrammingError('This hook provide previews but it is not implemented'); + } + + + /** + * Get a tiny preview for the given object + * + * This function must return an empty string if no graph exists. + * + * @param MonitoredObject $object + * + * @return string * @throws ProgrammingError */ - public function getTinyPreviewHtml($host, $service = null, $plot = null) + public function getTinyPreviewHtml(MonitoredObject $object) { - throw new ProgrammingError('This backend has no tiny preview images'); + throw new ProgrammingError('This hook provide tiny previews but it is not implemented'); } - - /** - * Get URL pointing to the grapher - * - * WARNING: We are not sure yet whether this will remain as is - * - * @param string $host - * @param string $service - * @param string $plot - * - * @return string - */ - abstract function getGraphUrl($host, $service = null, $plot = null); } From 4c88abcb3c8c7c3f5781e166d5bccb4f83668c09 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 4 Sep 2014 14:49:58 +0200 Subject: [PATCH 149/257] Doc/ModuleController: Fix "The ... with non-compound name ... has no effect" --- modules/doc/application/controllers/ModuleController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/doc/application/controllers/ModuleController.php b/modules/doc/application/controllers/ModuleController.php index fa6c69d19..40913368c 100644 --- a/modules/doc/application/controllers/ModuleController.php +++ b/modules/doc/application/controllers/ModuleController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Zend_Controller_Action_Exception; +use \Zend_Controller_Action_Exception; use Icinga\Application\Icinga; use Icinga\Module\Doc\DocController; use Icinga\Module\Doc\Exception\DocException; From f694b1609228b3160bc95da883fa08f71d19c90f Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 4 Sep 2014 14:53:00 +0200 Subject: [PATCH 150/257] Doc/IcingaWebController: Fix "The ... with non-compound name ... has no effect" --- modules/doc/application/controllers/IcingawebController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/doc/application/controllers/IcingawebController.php b/modules/doc/application/controllers/IcingawebController.php index ecbe3a6ee..967a2b768 100644 --- a/modules/doc/application/controllers/IcingawebController.php +++ b/modules/doc/application/controllers/IcingawebController.php @@ -2,7 +2,7 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -use Zend_Controller_Action_Exception; +use \Zend_Controller_Action_Exception; use Icinga\Application\Icinga; use Icinga\Module\Doc\DocController; From 6739034a14bd782e207be8b15bf1b2e365a92ce1 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 15:12:49 +0200 Subject: [PATCH 151/257] monitoring/list: handle q param and search for *q* Handle the generic search parameter q, search defaults to *searchString* instead of searchString* right now. refs #6680 refs #6495 --- .../controllers/ListController.php | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index b71d78acf..047b4ab35 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -50,13 +50,31 @@ class Monitoring_ListController extends Controller } $q = $this->getRequest()->getPost('q'); + if ($q) { + list($k, $v) = preg_split('/=/', $q); + $url->addParams(array($k => $v)); + return $url; + } + } else { $q = $url->shift('q'); - } - if ($q) { - list($k, $v) = preg_split('/=/', $q); - $url->addParams(array($k => $v)); - return $url; + if ($q) { + $action = $this->_request->getActionName(); + switch($action) { + case 'services': + $this->params->remove('q')->set('service_description', '*' . $q . '*'); + break; + case 'hosts': + $this->params->remove('q')->set('host_name', '*' . $q . '*'); + break; + case 'hostgroups': + $this->params->remove('q')->set('hostgroups', '*' . $q . '*'); + break; + case 'servicegroups': + $this->params->remove('q')->set('servicegroup', '*' . $q . '*'); + break; + } + } } return false; } From 6fcf5ec88a19d831ea68b5fe69c0e57741d4d792 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 4 Sep 2014 15:55:28 +0200 Subject: [PATCH 152/257] DateTime: Remove global and user formattings refs #6077 --- application/views/helpers/DateFormat.php | 13 ++++--------- config/config.ini.in | 2 -- .../controllers/TimelineController.php | 10 ++++------ .../application/forms/Command/CommandForm.php | 17 ++--------------- 4 files changed, 10 insertions(+), 32 deletions(-) diff --git a/application/views/helpers/DateFormat.php b/application/views/helpers/DateFormat.php index a03316f25..28cb81f32 100644 --- a/application/views/helpers/DateFormat.php +++ b/application/views/helpers/DateFormat.php @@ -3,7 +3,6 @@ // {{{ICINGA_LICENSE_HEADER}}} use Icinga\Application\Icinga; -use Icinga\Application\Config; use Icinga\Util\DateTimeFactory; use Icinga\Web\Form\Validator\DateTimeValidator; @@ -109,10 +108,8 @@ class Zend_View_Helper_DateFormat extends Zend_View_Helper_Abstract */ public function getDateFormat() { - return $this->request->getUser()->getPreferences()->get( - 'app.dateFormat', - Config::app()->global !== null ? Config::app()->global->get('dateFormat', 'd/m/Y') : 'd/m/Y' - ); + // TODO(mh): Missing localized format (#6077) + return 'd/m/Y'; } /** @@ -122,10 +119,8 @@ class Zend_View_Helper_DateFormat extends Zend_View_Helper_Abstract */ public function getTimeFormat() { - return $this->request->getUser()->getPreferences()->get( - 'app.timeFormat', - Config::app()->global !== null ? Config::app()->global->get('timeFormat', 'g:i A') : 'g:i A' - ); + // TODO(mh): Missing localized format (#6077) + return 'g:i A'; } /** diff --git a/config/config.ini.in b/config/config.ini.in index 72987094f..560acf527 100644 --- a/config/config.ini.in +++ b/config/config.ini.in @@ -1,7 +1,5 @@ [global] timezone = "Europe/Berlin" -dateFormat = "d/m/Y" -timeFormat = "g:i A" ; Contains the directories that will be searched for available modules. Modules that ; don't exist in these directories can still be symlinked in the module folder, but diff --git a/modules/monitoring/application/controllers/TimelineController.php b/modules/monitoring/application/controllers/TimelineController.php index 3fa621f3e..2da29a0b9 100644 --- a/modules/monitoring/application/controllers/TimelineController.php +++ b/modules/monitoring/application/controllers/TimelineController.php @@ -278,9 +278,8 @@ class Monitoring_TimelineController extends Controller */ private function getTimeFormat() { - $globalConfig = $this->getGlobalConfiguration(); - $preferences = $this->getRequest()->getUser()->getPreferences(); - return $preferences->get('app.timeFormat', $globalConfig->get('timeFormat', 'g:i A')); + // TODO(mh): Missing localized format (#6077) + return 'g:i A'; } /** @@ -290,8 +289,7 @@ class Monitoring_TimelineController extends Controller */ private function getDateFormat() { - $globalConfig = $this->getGlobalConfiguration(); - $preferences = $this->getRequest()->getUser()->getPreferences(); - return $preferences->get('app.dateFormat', $globalConfig->get('dateFormat', 'd/m/Y')); + // TODO(mh): Missing localized format (#6077) + return 'd/m/Y'; } } diff --git a/modules/monitoring/application/forms/Command/CommandForm.php b/modules/monitoring/application/forms/Command/CommandForm.php index df1bed008..1e458a44e 100644 --- a/modules/monitoring/application/forms/Command/CommandForm.php +++ b/modules/monitoring/application/forms/Command/CommandForm.php @@ -115,21 +115,8 @@ abstract class CommandForm extends Form */ public function getValidDateTimeFormats() { - $config = $this->getConfiguration(); - $global = $config->global; - if ($global === null) { - $global = new Zend_Config(array()); - } - $preferences = $this->getUserPreferences(); - return array( - implode( - ' ', - array( - $preferences->get('app.dateFormat', $global->get('dateFormat', 'd/m/Y')), - $preferences->get('app.timeFormat', $global->get('timeFormat', 'g:i A')) - ) - ) - ); + // TODO(mh): Missing localized format (#6077) + return 'd/m/Y g:i A'; } /** From 0935a8e34027052ffa2b0d9315f78b7e07d38bf6 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 4 Sep 2014 16:01:24 +0200 Subject: [PATCH 153/257] DateFormatTest: Remove dependencies to global/user config refs #6077 --- .../views/helpers/DateFormatTest.php | 27 +------------------ .../views/helpers/DateFormatTest/config.ini | 3 --- 2 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 test/php/application/views/helpers/DateFormatTest/config.ini diff --git a/test/php/application/views/helpers/DateFormatTest.php b/test/php/application/views/helpers/DateFormatTest.php index 8de8442f6..4f3cfc184 100644 --- a/test/php/application/views/helpers/DateFormatTest.php +++ b/test/php/application/views/helpers/DateFormatTest.php @@ -7,24 +7,14 @@ namespace Tests\Icinga\Views\Helper; use Mockery; use Zend_View_Helper_DateFormat; use Icinga\Test\BaseTestCase; -use Icinga\Application\Config; use Icinga\Util\DateTimeFactory; require_once BaseTestCase::$appDir . '/views/helpers/DateFormat.php'; class DateFormatTest extends BaseTestCase { - public function setUp() - { - parent::setUp(); - $this->oldConfigDir = Config::$configDir; - Config::$configDir = dirname(__FILE__) . '/DateFormatTest'; - } - public function tearDown() { - parent::tearDown(); - Config::$configDir = $this->oldConfigDir; DateTimeFactory::setConfig(array('timezone' => date_default_timezone_get())); } @@ -145,21 +135,6 @@ class DateFormatTest extends BaseTestCase protected function getRequestMock($dateFormat = null, $timeFormat = null) { - $mock = Mockery::mock('\Zend_Controller_Request_Abstract'); - $mock->shouldReceive('getUser->getPreferences->get') - ->with(Mockery::type('string'), Mockery::type('string')) - ->andReturnUsing( - function ($ident, $default) use ($dateFormat, $timeFormat) { - if ($dateFormat !== null && $ident === 'app.dateFormat') { - return $dateFormat; - } elseif ($timeFormat !== null && $ident === 'app.timeFormat') { - return $timeFormat; - } else { - return $default; - } - } - ); - - return $mock; + return Mockery::mock('\Zend_Controller_Request_Abstract'); } } diff --git a/test/php/application/views/helpers/DateFormatTest/config.ini b/test/php/application/views/helpers/DateFormatTest/config.ini deleted file mode 100644 index f095d27ca..000000000 --- a/test/php/application/views/helpers/DateFormatTest/config.ini +++ /dev/null @@ -1,3 +0,0 @@ -[global] -dateFormat = "d-m-y" -timeFormat = "G:i a" \ No newline at end of file From 1eacde02336aef97f2d1490ef3c417daac91f17a Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Thu, 4 Sep 2014 16:31:10 +0200 Subject: [PATCH 154/257] Implement modules self provided search configuration refs #6495 --- application/controllers/SearchController.php | 53 ++------- .../layouts/scripts/parts/navigation.phtml | 3 + application/views/scripts/search/hint.phtml | 8 +- application/views/scripts/search/index.phtml | 2 +- library/Icinga/Application/Modules/Module.php | 25 +++++ library/Icinga/Web/Widget/Dashboard/Pane.php | 18 ++++ library/Icinga/Web/Widget/SearchDashboard.php | 101 ++++++++++++++++++ .../controllers/ListController.php | 11 +- modules/monitoring/configuration.php | 8 ++ 9 files changed, 175 insertions(+), 54 deletions(-) create mode 100644 library/Icinga/Web/Widget/SearchDashboard.php diff --git a/application/controllers/SearchController.php b/application/controllers/SearchController.php index f2bf1ceac..c90e930a9 100644 --- a/application/controllers/SearchController.php +++ b/application/controllers/SearchController.php @@ -3,9 +3,8 @@ // {{{ICINGA_LICENSE_HEADER}}} use Icinga\Web\Controller\ActionController; -use Icinga\Application\Icinga; use Icinga\Web\Widget; -use Icinga\Web\Url; +use Icinga\Web\Widget\SearchDashboard; /** * Search controller @@ -14,47 +13,13 @@ class SearchController extends ActionController { public function indexAction() { - $search = $this->_request->getParam('q'); - if (! $search) { - $this->view->tabs = Widget::create('tabs')->add( - 'search', - array( - 'title' => $this->translate('Search'), - 'url' => '/search', - ) - )->activate('search'); - $this->render('hint'); - return; - } - $dashboard = Widget::create('dashboard')->createPane($this->translate('Search')); - $pane = $dashboard->getPane($this->translate('Search')); - $suffix = strlen($search) ? ': ' . rtrim($search, '*') . '*' : ''; - $pane->addComponent( - $this->translate('Hosts') . $suffix, - Url::fromPath('monitoring/list/hosts', array( - 'host_name' => $search . '*', - 'sort' => 'host_severity', - 'limit' => 10, - ) - )); - $pane->addComponent( - $this->translate('Services') . $suffix, - Url::fromPath('monitoring/list/services', array( - 'service_description' => $search . '*', - 'sort' => 'service_severity', - 'limit' => 10, - ) - )); - $pane->addComponent('Hostgroups' . $suffix, Url::fromPath('monitoring/list/hostgroups', array( - 'hostgroup' => $search . '*', - 'limit' => 10, - ))); - $pane->addComponent('Servicegroups' . $suffix, Url::fromPath('monitoring/list/servicegroups', array( - 'servicegroup' => $search . '*', - 'limit' => 10, - ))); - $dashboard->activate($this->translate('Search')); - $this->view->dashboard = $dashboard; - $this->view->tabs = $dashboard->getTabs(); + $this->view->dashboard = SearchDashboard::load($this->params->get('q')); + + // NOTE: This renders the dashboard twice. Remove this once we can catch exceptions thrown in view scripts. + $this->view->dashboard->render(); + } + + public function hintAction() + { } } diff --git a/application/layouts/scripts/parts/navigation.phtml b/application/layouts/scripts/parts/navigation.phtml index 019fba767..2f4335d89 100644 --- a/application/layouts/scripts/parts/navigation.phtml +++ b/application/layouts/scripts/parts/navigation.phtml @@ -3,6 +3,7 @@ use Icinga\Web\Url; use Icinga\Web\Menu; use Icinga\Web\MenuRenderer; +use Icinga\Web\Widget\SearchDashboard; // Don't render a menu for unauthenticated users unless menu is auth aware if (! $this->auth()->isAuthenticated()) { @@ -11,8 +12,10 @@ if (! $this->auth()->isAuthenticated()) { ?> diff --git a/application/views/scripts/search/hint.phtml b/application/views/scripts/search/hint.phtml index 91a85e9fe..d54c0b24f 100644 --- a/application/views/scripts/search/hint.phtml +++ b/application/views/scripts/search/hint.phtml @@ -1,12 +1,8 @@ -
    -tabs ?> -
    -

    translate("I'm ready to search, waiting for your input") ?>

    translate('Hint') ?>: translate( 'Please use the asterisk (*) as a placeholder for wildcard searches.' - . " For convenience I'll always add a wildcard after the last character" - . ' you typed.' + . " For convenience I'll always add a wildcard in front and after your" + . ' search string.' ) ?>

    diff --git a/application/views/scripts/search/index.phtml b/application/views/scripts/search/index.phtml index 52dc7a14c..321597e70 100644 --- a/application/views/scripts/search/index.phtml +++ b/application/views/scripts/search/index.phtml @@ -1,5 +1,5 @@
    -tabs ?> +dashboard->getTabs() ?>
    diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index d0bf451ee..c0c6b1f6f 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -163,6 +163,31 @@ class Module */ protected $paneItems = array(); + /** + * @var array + */ + protected $searchUrls = array(); + + /** + * @param string $title + * @param string $url + */ + public function provideSearchUrl($title, $url) + { + $searchUrl = (object) array( + 'title' => $title, + 'url' => $url + ); + + $this->searchUrls[] = $searchUrl; + } + + public function getSearchUrls() + { + $this->launchConfigScript(); + return $this->searchUrls; + } + /** * Get all Menu Items * diff --git a/library/Icinga/Web/Widget/Dashboard/Pane.php b/library/Icinga/Web/Widget/Dashboard/Pane.php index 45bd9c558..8c1e66bad 100644 --- a/library/Icinga/Web/Widget/Dashboard/Pane.php +++ b/library/Icinga/Web/Widget/Dashboard/Pane.php @@ -135,6 +135,24 @@ class Pane extends AbstractWidget return $this; } + /** + * Removes all or a given list of components from this pane + * + * @param array $components Optional list of component titles + * @return Pane $this + */ + public function removeComponents(array $components = null) + { + if ($components === null) { + $this->components = array(); + } else { + foreach ($components as $component) { + $this->removeComponent($component); + } + } + return $this; + } + /** * Return all components added at this pane * diff --git a/library/Icinga/Web/Widget/SearchDashboard.php b/library/Icinga/Web/Widget/SearchDashboard.php new file mode 100644 index 000000000..a97de06e5 --- /dev/null +++ b/library/Icinga/Web/Widget/SearchDashboard.php @@ -0,0 +1,101 @@ +loadSearchDashlets($searchQuery); + return $dashboard; + } + + /** + * Renders the output + * + * @return string + * @throws \Zend_Controller_Action_Exception + */ + public function render() + { + if (!$this->getPane(self::SEARCH_PANE)->hasComponents()) { + throw new ActionError('Site not found', 404); + } + return parent::render(); + } + + /** + * Loads search dashlets + * + * @param string $searchString + */ + protected function loadSearchDashlets($searchString) + { + $pane = $this->createPane(self::SEARCH_PANE)->getPane(self::SEARCH_PANE)->setTitle(t('Search')); + $this->activate(self::SEARCH_PANE); + + $manager = Icinga::app()->getModuleManager(); + + foreach ($manager->getLoadedModules() as $module) { + $this->addSearchDashletsFromModule($searchString, $module, $pane); + } + + if ($searchString === '' && $pane->hasComponents()) { + $pane->removeComponents(); + $pane->add('Ready to search', 'search/hint'); + return; + } + } + + /** + * Add available search dashlets to the pane + * + * @param string $searchString + * @param Module $module + * @param Pane $pane + */ + protected function addSearchDashletsFromModule($searchString, $module, $pane) + { + $searchUrls = $module->getSearchUrls(); + + if (! empty($searchUrls)) { + $this->searchUrls[] = $module->getSearchUrls(); + foreach ($searchUrls as $search) { + $pane->addComponent( + $search->title . ': ' . $searchString, + Url::fromPath($search->url, array('q' => $searchString)) + ); + } + } + } +} diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 047b4ab35..b167c5e43 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -55,10 +55,9 @@ class Monitoring_ListController extends Controller $url->addParams(array($k => $v)); return $url; } - } else { $q = $url->shift('q'); - if ($q) { + if ($q !== null) { $action = $this->_request->getActionName(); switch($action) { case 'services': @@ -68,7 +67,7 @@ class Monitoring_ListController extends Controller $this->params->remove('q')->set('host_name', '*' . $q . '*'); break; case 'hostgroups': - $this->params->remove('q')->set('hostgroups', '*' . $q . '*'); + $this->params->remove('q')->set('hostgroup', '*' . $q . '*'); break; case 'servicegroups': $this->params->remove('q')->set('servicegroup', '*' . $q . '*'); @@ -413,6 +412,9 @@ class Monitoring_ListController extends Controller public function servicegroupsAction() { + if ($url = $this->hasBetterUrl()) { + return $this->redirectNow($url); + } $this->addTitleTab('servicegroups'); $this->setAutorefreshInterval(12); $query = $this->backend->select()->from('groupsummary', array( @@ -441,6 +443,9 @@ class Monitoring_ListController extends Controller public function hostgroupsAction() { + if ($url = $this->hasBetterUrl()) { + return $this->redirectNow($url); + } $this->addTitleTab('hostgroups'); $this->setAutorefreshInterval(12); $query = $this->backend->select()->from('groupsummary', array( diff --git a/modules/monitoring/configuration.php b/modules/monitoring/configuration.php index 412581d24..fc0688e89 100644 --- a/modules/monitoring/configuration.php +++ b/modules/monitoring/configuration.php @@ -19,6 +19,14 @@ $this->provideConfigTab('security', array( 'url' => 'config/security' )); +/* + * Available Search Urls + */ +$this->provideSearchUrl($this->translate('Hosts'), 'monitoring/list/hosts?sort=host_severity&limit=10'); +$this->provideSearchUrl($this->translate('Services'), 'monitoring/list/services?sort=service_severity&limit=10'); +$this->provideSearchUrl($this->translate('Hostgroups'), 'monitoring/list/hostgroups?limit=10'); +$this->provideSearchUrl($this->translate('Servicegroups'), 'monitoring/list/servicegroups?limit=10'); + /* * Problems Section */ From 36a3c36c1bf985ad40917eaac8af0b1a6ca2d044 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Thu, 4 Sep 2014 15:29:11 +0200 Subject: [PATCH 155/257] Rename Icinga\Protocol\File\Reader to ...\File\FileReader --- application/controllers/ListController.php | 2 +- library/Icinga/Data/ResourceFactory.php | 2 +- library/Icinga/Protocol/File/{Reader.php => FileReader.php} | 2 +- library/Icinga/Protocol/File/Query.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename library/Icinga/Protocol/File/{Reader.php => FileReader.php} (99%) diff --git a/application/controllers/ListController.php b/application/controllers/ListController.php index 599df06a1..a618cbaf9 100644 --- a/application/controllers/ListController.php +++ b/application/controllers/ListController.php @@ -8,7 +8,7 @@ use Icinga\Web\Url; use Icinga\Data\ResourceFactory; use Icinga\Logger\Logger; use Icinga\Logger\Writer\FileWriter; -use Icinga\Protocol\File\Reader as FileReader; +use Icinga\Protocol\File\FileReader; /** * Class ListController diff --git a/library/Icinga/Data/ResourceFactory.php b/library/Icinga/Data/ResourceFactory.php index 66127ff03..30597ad2d 100644 --- a/library/Icinga/Data/ResourceFactory.php +++ b/library/Icinga/Data/ResourceFactory.php @@ -12,7 +12,7 @@ use Icinga\Data\Db\DbConnection; use Icinga\Protocol\Livestatus\Connection as LivestatusConnection; use Icinga\Protocol\Statusdat\Reader as StatusdatReader; use Icinga\Protocol\Ldap\Connection as LdapConnection; -use Icinga\Protocol\File\Reader as FileReader; +use Icinga\Protocol\File\FileReader; /** * Create resources from names or resource configuration diff --git a/library/Icinga/Protocol/File/Reader.php b/library/Icinga/Protocol/File/FileReader.php similarity index 99% rename from library/Icinga/Protocol/File/Reader.php rename to library/Icinga/Protocol/File/FileReader.php index 0f5509b7b..abbcaa630 100644 --- a/library/Icinga/Protocol/File/Reader.php +++ b/library/Icinga/Protocol/File/FileReader.php @@ -13,7 +13,7 @@ use Icinga\Util\File; /** * Read file line by line */ -class Reader extends FilterIterator +class FileReader extends FilterIterator { /** * A PCRE string with the fields to extract from the file's lines as named subpatterns diff --git a/library/Icinga/Protocol/File/Query.php b/library/Icinga/Protocol/File/Query.php index f88426bca..94c8a6af0 100644 --- a/library/Icinga/Protocol/File/Query.php +++ b/library/Icinga/Protocol/File/Query.php @@ -10,7 +10,7 @@ use Icinga\Data\Filter\Filter; /** * Class Query * - * Query for Datasource Icinga\Protocol\File\Reader + * Query for Datasource Icinga\Protocol\File\FileReader * * @package Icinga\Protocol\File */ From fcd12073f8f2ad0c118d1927045164a0941cdf6f Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Thu, 4 Sep 2014 15:38:14 +0200 Subject: [PATCH 156/257] Rename Icinga\Protocol\File\Query to ...\File\FileQuery --- .../File/{Query.php => FileQuery.php} | 8 +++--- library/Icinga/Protocol/File/FileReader.php | 26 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) rename library/Icinga/Protocol/File/{Query.php => FileQuery.php} (93%) diff --git a/library/Icinga/Protocol/File/Query.php b/library/Icinga/Protocol/File/FileQuery.php similarity index 93% rename from library/Icinga/Protocol/File/Query.php rename to library/Icinga/Protocol/File/FileQuery.php index 94c8a6af0..e1b5e65cf 100644 --- a/library/Icinga/Protocol/File/Query.php +++ b/library/Icinga/Protocol/File/FileQuery.php @@ -8,13 +8,13 @@ use Icinga\Data\SimpleQuery; use Icinga\Data\Filter\Filter; /** - * Class Query + * Class FileQuery * * Query for Datasource Icinga\Protocol\File\FileReader * * @package Icinga\Protocol\File */ -class Query extends SimpleQuery +class FileQuery extends SimpleQuery { /** * Sort direction @@ -41,7 +41,7 @@ class Query extends SimpleQuery * * @param string $dir Sort direction, 'ASC' or 'DESC' (default) * - * @return Query + * @return FileQuery */ public function order($field, $direction = null) { @@ -66,7 +66,7 @@ class Query extends SimpleQuery * * @param string $expression the filter expression to be applied * - * @return Query + * @return FileQuery */ public function andWhere($expression) { diff --git a/library/Icinga/Protocol/File/FileReader.php b/library/Icinga/Protocol/File/FileReader.php index abbcaa630..b641bc6c7 100644 --- a/library/Icinga/Protocol/File/FileReader.php +++ b/library/Icinga/Protocol/File/FileReader.php @@ -93,13 +93,13 @@ class FileReader extends FilterIterator } /** - * Instantiate a Query object + * Instantiate a FileQuery object * - * @return Query + * @return FileQuery */ public function select() { - return new Query($this); + return new FileQuery($this); } /** @@ -115,11 +115,11 @@ class FileReader extends FilterIterator /** * Fetch result as an array of objects * - * @param Query $query + * @param FileQuery $query * * @return array */ - public function fetchAll(Query $query) + public function fetchAll(FileQuery $query) { $all = array(); foreach ($this->fetchPairs($query) as $index => $value) { @@ -131,11 +131,11 @@ class FileReader extends FilterIterator /** * Fetch result as a key/value pair array * - * @param Query $query + * @param FileQuery $query * * @return array */ - public function fetchPairs(Query $query) + public function fetchPairs(FileQuery $query) { $skip = $query->getOffset(); $read = $query->getLimit(); @@ -173,11 +173,11 @@ class FileReader extends FilterIterator /** * Fetch first result row * - * @param Query $query + * @param FileQuery $query * * @return object */ - public function fetchRow(Query $query) + public function fetchRow(FileQuery $query) { $all = $this->fetchAll($query); if (isset($all[0])) { @@ -189,11 +189,11 @@ class FileReader extends FilterIterator /** * Fetch first result column * - * @param Query $query + * @param FileQuery $query * * @return array */ - public function fetchColumn(Query $query) + public function fetchColumn(FileQuery $query) { $column = array(); foreach ($this->fetchPairs($query) as $pair) { @@ -208,11 +208,11 @@ class FileReader extends FilterIterator /** * Fetch first column value from first result row * - * @param Query $query + * @param FileQuery $query * * @return mixed */ - public function fetchOne(Query $query) + public function fetchOne(FileQuery $query) { $pairs = $this->fetchPairs($query); if (isset($pairs[0])) { From f0969e0b2efb019a11546bc4579048160402d75b Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Thu, 4 Sep 2014 16:33:57 +0200 Subject: [PATCH 157/257] Split Icinga\Protocol\File\FileReader into ...\FileReader and ...\FileIterator --- library/Icinga/Protocol/File/FileIterator.php | 82 +++++++++++++++++++ library/Icinga/Protocol/File/FileReader.php | 65 +++------------ 2 files changed, 95 insertions(+), 52 deletions(-) create mode 100644 library/Icinga/Protocol/File/FileIterator.php diff --git a/library/Icinga/Protocol/File/FileIterator.php b/library/Icinga/Protocol/File/FileIterator.php new file mode 100644 index 000000000..2ec3c0ce5 --- /dev/null +++ b/library/Icinga/Protocol/File/FileIterator.php @@ -0,0 +1,82 @@ + $value) + * + * @var array + */ + protected $currentData; + + public function __construct($filename, $fields) + { + $this->fields = $fields; + $f = new File($filename); + $f->setFlags( + File::DROP_NEW_LINE | + File::READ_AHEAD | + File::SKIP_EMPTY + ); + parent::__construct($f); + } + + /** + * Return the current data + * + * @return array + */ + public function current() + { + return $this->currentData; + } + + /** + * Accept lines matching the given PCRE pattern + * + * @return bool + * + * @throws FileReaderException If PHP failed parsing the PCRE pattern + */ + public function accept() + { + $data = array(); + $matched = preg_match( + $this->fields, + $this->getInnerIterator()->current(), + $data + ); + + if ($matched === false) { + throw new FileReaderException('Failed parsing regular expression!'); + } else if ($matched === 1) { + foreach ($data as $key => $value) { + if (is_int($key)) { + unset($data[$key]); + } + } + $this->currentData = $data; + return true; + } + return false; + } +} diff --git a/library/Icinga/Protocol/File/FileReader.php b/library/Icinga/Protocol/File/FileReader.php index b641bc6c7..3f1ccc97b 100644 --- a/library/Icinga/Protocol/File/FileReader.php +++ b/library/Icinga/Protocol/File/FileReader.php @@ -4,16 +4,12 @@ namespace Icinga\Protocol\File; -use FilterIterator; -use Iterator; use Zend_Config; -use Icinga\Protocol\File\FileReaderException; -use Icinga\Util\File; /** * Read file line by line */ -class FileReader extends FilterIterator +class FileReader { /** * A PCRE string with the fields to extract from the file's lines as named subpatterns @@ -23,11 +19,11 @@ class FileReader extends FilterIterator protected $fields; /** - * An associative array of the current line's fields ($field => $value) + * Name of the target file * - * @var array + * @var string */ - protected $currentData; + protected $filename; /** * Create a new reader @@ -39,57 +35,22 @@ class FileReader extends FilterIterator public function __construct(Zend_Config $config) { foreach (array('filename', 'fields') as $key) { - if (! isset($config->{$key})) { + if (isset($config->{$key})) { + $this->{$key} = $config->{$key}; + } else { throw new FileReaderException('The directive `%s\' is required', $key); } } - $this->fields = $config->fields; - $f = new File($config->filename); - $f->setFlags( - File::DROP_NEW_LINE | - File::READ_AHEAD | - File::SKIP_EMPTY - ); - parent::__construct($f); } /** - * Return the current data + * Instantiate a FileIterator object with the target file * - * @return array + * @return FileIterator */ - public function current() + public function iterate() { - return $this->currentData; - } - - /** - * Accept lines matching the given PCRE pattern - * - * @return bool - * - * @throws FileReaderException If PHP failed parsing the PCRE pattern - */ - public function accept() - { - $data = array(); - $matched = @preg_match( - $this->fields, - $this->getInnerIterator()->current(), - $data - ); - if ($matched === false) { - throw new FileReaderException('Failed parsing regular expression!'); - } else if ($matched === 1) { - foreach ($data as $key => $value) { - if (is_int($key)) { - unset($data[$key]); - } - } - $this->currentData = $data; - return true; - } - return false; + return new FileIterator($this->filename, $this->fields); } /** @@ -109,7 +70,7 @@ class FileReader extends FilterIterator */ public function count() { - return iterator_count($this); + return iterator_count($this->iterate()); } /** @@ -155,7 +116,7 @@ class FileReader extends FilterIterator } } $index = 0; - foreach ($this as $line) { + foreach ($this->iterate() as $line) { if ($index >= $skip) { if ($index >= $skip + $read) { break; From b6b16e25e920574e04a1bae2b2d07c2735ca043a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 16:43:07 +0200 Subject: [PATCH 158/257] monitoring/show: use new grapher hook interface refs #6932 --- .../monitoring/application/controllers/ShowController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 6c4d3c310..6b45f3980 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -64,8 +64,8 @@ class Monitoring_ShowController extends Controller . ' on ' . $o->host_name; $this->getTabs()->activate('service'); $o->populate(); - if ($this->grapher && $this->grapher->hasPreviews($o->host_name, $o->service_description)) { - $this->view->grapherHtml = $this->grapher->getPreviewHtml($o->host_name, $o->service_description); + if ($this->grapher && $this->grapher->hasPreviews($o)) { + $this->view->grapherHtml = $this->grapher->getPreviewHtml($o); } } @@ -79,8 +79,8 @@ class Monitoring_ShowController extends Controller $this->getTabs()->activate('host'); $this->view->title = $o->host_name; $o->populate(); - if ($this->grapher && $this->grapher->hasPreviews($o->host_name)) { - $this->view->grapherHtml = $this->grapher->getPreviewHtml($o->host_name); + if ($this->grapher && $this->grapher->hasPreviews($o)) { + $this->view->grapherHtml = $this->grapher->getPreviewHtml($o); } } From 876b94cccf8686a430b0d2c2512c6d3411ba9966 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Thu, 4 Sep 2014 16:51:50 +0200 Subject: [PATCH 159/257] Icinga\Protocol\File\FileReader: implement Icinga\Data\Selectable, ...\Fetchable and Countable --- library/Icinga/Protocol/File/FileReader.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Protocol/File/FileReader.php b/library/Icinga/Protocol/File/FileReader.php index 3f1ccc97b..f3603462e 100644 --- a/library/Icinga/Protocol/File/FileReader.php +++ b/library/Icinga/Protocol/File/FileReader.php @@ -4,12 +4,15 @@ namespace Icinga\Protocol\File; +use Icinga\Data\Fetchable; +use Icinga\Data\Selectable; +use Countable; use Zend_Config; /** * Read file line by line */ -class FileReader +class FileReader implements Selectable, Fetchable, Countable { /** * A PCRE string with the fields to extract from the file's lines as named subpatterns From 3c4a719feb1c1b01c546ca08affbfbbf362fd06b Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Thu, 4 Sep 2014 16:55:02 +0200 Subject: [PATCH 160/257] Revert "Icinga\Protocol\File\FileReader: implement Icinga\Data\Selectable, ...\Fetchable and Countable" This reverts commit 7edbb8f27216e6faa0d0dc5a71b407748e9dd535. --- library/Icinga/Protocol/File/FileReader.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/library/Icinga/Protocol/File/FileReader.php b/library/Icinga/Protocol/File/FileReader.php index f3603462e..3f1ccc97b 100644 --- a/library/Icinga/Protocol/File/FileReader.php +++ b/library/Icinga/Protocol/File/FileReader.php @@ -4,15 +4,12 @@ namespace Icinga\Protocol\File; -use Icinga\Data\Fetchable; -use Icinga\Data\Selectable; -use Countable; use Zend_Config; /** * Read file line by line */ -class FileReader implements Selectable, Fetchable, Countable +class FileReader { /** * A PCRE string with the fields to extract from the file's lines as named subpatterns From 70146c43e79de5ad7c488e2067a8924f9184ca2a Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Thu, 4 Sep 2014 16:59:37 +0200 Subject: [PATCH 161/257] Icinga\Protocol\File\FileReader: implement Icinga\Data\Selectable, and Countable --- library/Icinga/Protocol/File/FileReader.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Protocol/File/FileReader.php b/library/Icinga/Protocol/File/FileReader.php index 3f1ccc97b..e66c3edf5 100644 --- a/library/Icinga/Protocol/File/FileReader.php +++ b/library/Icinga/Protocol/File/FileReader.php @@ -4,12 +4,14 @@ namespace Icinga\Protocol\File; +use Icinga\Data\Selectable; +use Countable; use Zend_Config; /** * Read file line by line */ -class FileReader +class FileReader implements Selectable, Countable { /** * A PCRE string with the fields to extract from the file's lines as named subpatterns From 5a29315ee8a500241c15b6a5d8d6c6c8ed068537 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 17:35:55 +0200 Subject: [PATCH 162/257] Web\UrlTest: make tests fit current implementation * temporarily disable [] tests * getAbsoluteUrl uses & and not & by default * __toString uses & and does not match getAbsoluteUrl by default * addParams MUST hide existing ones, getValues still ships them fixes #6604 --- test/php/library/Icinga/Web/UrlTest.php | 26 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/test/php/library/Icinga/Web/UrlTest.php b/test/php/library/Icinga/Web/UrlTest.php index 183f33369..a202b0eee 100644 --- a/test/php/library/Icinga/Web/UrlTest.php +++ b/test/php/library/Icinga/Web/UrlTest.php @@ -132,6 +132,8 @@ class UrlTest extends BaseTestCase $url->getParam('param2', 'wrongval'), 'Url::fromPath does not properly decode aliases characters in query parameter values' ); + /* + // Temporarily disabled, no [] support right now $this->assertEquals( array('1', '2', '3'), $url->getParam('param3'), @@ -142,6 +144,7 @@ class UrlTest extends BaseTestCase $url->getParam('param4'), 'Url::fromPath does not properly reassemble query parameters as associative arrays' ); + */ } /** @@ -152,7 +155,7 @@ class UrlTest extends BaseTestCase $url = Url::fromPath('/my/test/url.html?param=val¶m2=val2'); $this->assertEquals( - '/my/test/url.html?param=val&param2=val2', + '/my/test/url.html?param=val¶m2=val2', $url->getAbsoluteUrl(), 'Url::getAbsoluteUrl does not return the absolute url' ); @@ -166,7 +169,7 @@ class UrlTest extends BaseTestCase $url = Url::fromPath('/my/test/url.html?param=val¶m2=val2'); $this->assertEquals( - 'my/test/url.html?param=val&param2=val2', + 'my/test/url.html?param=val¶m2=val2', $url->getRelativeUrl(), 'Url::getRelativeUrl does not return the relative url' ); @@ -251,8 +254,8 @@ class UrlTest extends BaseTestCase $this->assertNotSame($url, $url2, 'Url::getUrlWithout does not return a new copy of the url'); $this->assertEquals( - array('param3' => 'val3'), - $url2->getParams(), + array(array('param3', 'val3')), + $url2->getParams()->toArray(), 'Url::getUrlWithout does not remove a given set of parameters from the url' ); } @@ -271,9 +274,14 @@ class UrlTest extends BaseTestCase 'Url::addParams does not add new parameters' ); $this->assertEquals( - 'val3', + 'newval3', $url->getParam('param3', 'wrongval'), - 'Url::addParams overwrites existing parameters' + 'Url::addParams does not overwrite existing existing parameters' + ); + $this->assertEquals( + array('val3', 'newval3'), + $url->getParams()->getValues('param3'), + 'Url::addParams does not overwrite existing existing parameters' ); } @@ -298,14 +306,14 @@ class UrlTest extends BaseTestCase } /** - * @depends testWhetherGetAbsoluteUrlReturnsTheAbsoluteUrl + * @depends testWhetherGetAbsoluteUrlReturnsTheAbsoluteUrlForHtmlAttributes */ - public function testWhetherToStringConversionReturnsTheAbsoluteUrl() + public function testWhetherToStringConversionReturnsTheAbsoluteUrlForHtmlAttribures() { $url = Url::fromPath('/my/test/url.html?param=val¶m2=val2¶m3=val3'); $this->assertEquals( - $url->getAbsoluteUrl(), + 'my/test/url.html?param=val&param2=val2&param3=val3', (string) $url, 'Converting a url to string does not return the absolute url' ); From 34417338ddd8f506bf0b7150e638e35c696387b9 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 4 Sep 2014 17:41:48 +0200 Subject: [PATCH 163/257] Use an icon with better interpolation in our header bar --- public/img/logo_icinga-inv.png | Bin 6528 -> 2207 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/public/img/logo_icinga-inv.png b/public/img/logo_icinga-inv.png index 63a0e202e5e3bc09e864ff36048df1d7321e12a1..d43d74b963109974bea3c7ec3fceb7f9116b4609 100644 GIT binary patch literal 2207 zcmV;Q2w?Y#P)2;c-~oGgg2BUBD-Rvm%q*v|9+A6TWNX3?Dt!oUQ;{CA~#b7tkZA z0W@>wyWFo!I#tq6pem_pX2V4%B`8|+dK8_UlSXN}=$I(!TuDvOpKWH%oatsJGiyoe zl{9E(LuNLzDMcW9-ZV)wV%|x664Jtfn}LJCI$&8QCawVP0PX@l1}sgR;UcM>a{V-L z0C)wsAE^1M7?MN)MY^ zZvgp1Ntb(_ZIZS~x=GR+ukx7Zm71YZ#{WMmRx4n9%`K59B)zju+ol71outzw^+d zIW~_8|X5#MjOym-?PnZ zYbPWaVYn;JztTPpB{`le%}g)M0Cu_sbY*0}zgGpFkf-Ir8cJ5rgI@NN*pL671w8M1 zC#DAQJK)sNPb7$dF9to6r`2ISr6(tZtAFi!syeE!3KLq}0pP=N(ghxD1y~#`ob}lv z*L&Hag8mQs`#Yh}iEdu@Ct3p&e4IG}+~ESi0d_d()r=Tx+RS6n-y7R`;J|F)<&*!{t>Nd&+@8ruCRlz+kVUh(&K;3i;cFh$e2mpIEOIRJwJ@E(5; z1d9mZUf>4cVgEkt@68#p`m*wUz}JCWfM-1~nYN33O_qg4%+2VSp3F~RyVy$leSQhM zo50ti^V0_Kt0Lf@-vj(9#%OVTnkdm5-q8U{`=vmXFUBwgY47fAZO zq)Dz^=82?ltd^8SmY~5FuI40Nm9P5%+xjnx@(goh#3Nw2k+3_`3Fi&M3(p2L3|QUnD){GIQ+Q-=kU1i2}CG_$}a8NuP1nR~(l<;K!2sB~^hLk}eB6;2z(M zyCmJ>?al_~n%N%!)g-MgP->F2((fsw#~9f+Xl8SgxH$%~!e}9e-~m?BV*g9Abv)_W zILG*-0dA^7S>`z(^al*25%LlXPjxfakjA9S9c_F{VMVQjX;o$2wtn za<}#BUoifc5mYm?^}r67_rGyHG9fU&C23_KP)*XCGD(5gdk1i#nQf^^dZA?80Uv}i zP+Y-McH7g2;ZX@rb~aeH;3n{M-`LAe6t)hGIk|fD>IJzZ{n5-e2jC>B;q3lWc4CKI zVW(%<+tj`P>(g;r9U3%~4JzrUW_BQF_ZThm-;#Fv_e@C(9N=zOF8Hm|hrRylg3$0- zq(K)Q<`zYt%kOSUT@LKE4qBHJEBOXX9jl6@Z%Vq@rNt%w%ugVDx)PX@?8)zCp5%tH zxY#JN!$bLf;Zh?3oXVDG^SRmcCzaUY+k+iGGX{-<#~AJK?}xUlv$0l&wl`!qR(FPQ zKr574kqhr$=+;ngah%XJ;C;a9{$0q*g(D(gWKx|hB^Vs8#QWbb0l;7cVtCWN|ZVjZ`lI+cjne8^SN6qX-{~kI< z*<6-h48QjV8Qm}G-8%C3xGq1Q%^=q5?)c0zvjb+)euS?|Ls9PopM6&N(0OKfE!EhQO#Mf zKZux@ffWUTA_0?uZv$s%aq@2f^YVaNHjgF1=L_;HAqe)8i-4vFq;8Az2%>E{aCuQ& hykMPg1MUQ-{s#u79vG|@cdq~d002ovPDHLkV1lOCG&}$R literal 6528 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 J&zCjz{Xfzi!VCZa From 4513ab2aed84c34a37bbb570389a33cee31dc91a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 17:55:12 +0200 Subject: [PATCH 164/257] GraphChartTest: match current implementation We have more nodes right now as of a graphical hack (white bg) --- test/php/library/Icinga/Chart/GraphChartTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/php/library/Icinga/Chart/GraphChartTest.php b/test/php/library/Icinga/Chart/GraphChartTest.php index 6a7f73864..9ffdcb66c 100644 --- a/test/php/library/Icinga/Chart/GraphChartTest.php +++ b/test/php/library/Icinga/Chart/GraphChartTest.php @@ -27,7 +27,7 @@ class GraphChartTest extends BaseTestCase $xpath = new DOMXPath($doc); $xpath->registerNamespace('x', 'http://www.w3.org/2000/svg'); $path = $xpath->query('//x:rect[@data-icinga-graph-type="bar"]'); - $this->assertEquals(3, $path->length, 'Assert the correct number of datapoints being drawn as SVG bars'); + $this->assertEquals(6, $path->length, 'Assert the correct number of datapoints being drawn as SVG bars'); } public function testLineChartCreation() @@ -48,4 +48,4 @@ class GraphChartTest extends BaseTestCase $path = $xpath->query('//x:path[@data-icinga-graph-type="line"]'); $this->assertEquals(1, $path->length, 'Assert the correct number of datapoints being drawn as SVG lines'); } -} \ No newline at end of file +} From e4d1143870da509ec04280f521e3bd70b973257c Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Thu, 4 Sep 2014 18:30:22 +0200 Subject: [PATCH 165/257] Add SearchDashboardTest --- library/Icinga/Web/Widget/SearchDashboard.php | 4 +- .../Icinga/Web/Widget/SearchDashboardTest.php | 74 +++++++++++++++++++ 2 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 test/php/library/Icinga/Web/Widget/SearchDashboardTest.php diff --git a/library/Icinga/Web/Widget/SearchDashboard.php b/library/Icinga/Web/Widget/SearchDashboard.php index a97de06e5..0c5aaee8e 100644 --- a/library/Icinga/Web/Widget/SearchDashboard.php +++ b/library/Icinga/Web/Widget/SearchDashboard.php @@ -32,7 +32,7 @@ class SearchDashboard extends Dashboard * @param $searchQuery * @return Dashboard|SearchDashboard */ - public static function load($searchQuery) + public static function load($searchQuery = '') { /** @var $dashboard SearchDashboard */ $dashboard = new static('searchDashboard'); @@ -48,7 +48,7 @@ class SearchDashboard extends Dashboard */ public function render() { - if (!$this->getPane(self::SEARCH_PANE)->hasComponents()) { + if (! $this->getPane(self::SEARCH_PANE)->hasComponents()) { throw new ActionError('Site not found', 404); } return parent::render(); diff --git a/test/php/library/Icinga/Web/Widget/SearchDashboardTest.php b/test/php/library/Icinga/Web/Widget/SearchDashboardTest.php new file mode 100644 index 000000000..d78fc041a --- /dev/null +++ b/test/php/library/Icinga/Web/Widget/SearchDashboardTest.php @@ -0,0 +1,74 @@ + 'Hosts', + 'url' => 'monitoring/list/hosts?sort=host_severity&limit=10' + ); + $moduleMock->shouldReceive('getSearchUrls')->andReturn(array( + $searchUrl + )); + + $moduleManagerMock = Mockery::mock('Icinga\Application\Modules\Manager'); + $moduleManagerMock->shouldReceive('getLoadedModules')->andReturn(array( + 'test-module' => $moduleMock + )); + + $bootstrapMock = Mockery::mock('Icinga\Application\ApplicationBootstrap')->shouldDeferMissing(); + $bootstrapMock->shouldReceive('getFrontController->getRequest')->andReturnUsing( + function () use ($request) { return $request; } + )->shouldReceive('getApplicationDir')->andReturn(self::$appDir); + + $bootstrapMock->shouldReceive('getModuleManager')->andReturn($moduleManagerMock); + + Icinga::setApp($bootstrapMock, true); + } + + /** + * @expectedException Zend_Controller_Action_Exception + */ + public function testFoo() + { + $dashboard = SearchDashboard::load('pending'); + $dashboard->getPane('search')->removeComponents(); + $dashboard->render(); + } + + public function testWhetherLoadLoadsSearchDashletsFromModules() + { + $dashboard = SearchDashboard::load('pending'); + + $result = $dashboard->getPane('search')->hasComponent('Hosts: pending'); + + $this->assertTrue($result, 'Dashboard::load() could not load search dashlets from modules'); + } + + + public function testWhetherLoadProvidesHint() + { + $dashboard = SearchDashboard::load(''); + + $result = $dashboard->getPane('search')->hasComponent('Ready to search'); + + $this->assertTrue($result, 'Dashboard::load() could not get hint for search'); + } +} From dccc57b7a2c5ef24f21a8e9f82047b0415e38217 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 18:34:04 +0200 Subject: [PATCH 166/257] CommandForm: fix broken function --- modules/monitoring/application/forms/Command/CommandForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/forms/Command/CommandForm.php b/modules/monitoring/application/forms/Command/CommandForm.php index 1e458a44e..9ccdd0f9b 100644 --- a/modules/monitoring/application/forms/Command/CommandForm.php +++ b/modules/monitoring/application/forms/Command/CommandForm.php @@ -116,7 +116,7 @@ abstract class CommandForm extends Form public function getValidDateTimeFormats() { // TODO(mh): Missing localized format (#6077) - return 'd/m/Y g:i A'; + return array('d/m/Y g:i A'); } /** From 5314e57b0f7714d6b26fa354c484621091ed8739 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 18:34:55 +0200 Subject: [PATCH 167/257] ResourceFormTest: disable, messed up --- .../Resource/{ResourceFormTest.php => ResourceFormTestBroken.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/php/application/forms/Config/Resource/{ResourceFormTest.php => ResourceFormTestBroken.php} (100%) diff --git a/test/php/application/forms/Config/Resource/ResourceFormTest.php b/test/php/application/forms/Config/Resource/ResourceFormTestBroken.php similarity index 100% rename from test/php/application/forms/Config/Resource/ResourceFormTest.php rename to test/php/application/forms/Config/Resource/ResourceFormTestBroken.php From 0cc024a30af427d6869b4cbf66e49c015a39296d Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 18:37:17 +0200 Subject: [PATCH 168/257] DateFormatTest: disable it as it is broken --- .../helpers/{DateFormatTest.php => DateFormatTestBroken.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/php/application/views/helpers/{DateFormatTest.php => DateFormatTestBroken.php} (100%) diff --git a/test/php/application/views/helpers/DateFormatTest.php b/test/php/application/views/helpers/DateFormatTestBroken.php similarity index 100% rename from test/php/application/views/helpers/DateFormatTest.php rename to test/php/application/views/helpers/DateFormatTestBroken.php From 3d170f90a51fb1ba238bc2961bb443f870a1df37 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 18:38:03 +0200 Subject: [PATCH 169/257] TranslatorTest: expect the correct exception --- test/php/library/Icinga/Util/TranslatorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/php/library/Icinga/Util/TranslatorTest.php b/test/php/library/Icinga/Util/TranslatorTest.php index 23bc154dd..1a4fc1be5 100644 --- a/test/php/library/Icinga/Util/TranslatorTest.php +++ b/test/php/library/Icinga/Util/TranslatorTest.php @@ -44,7 +44,7 @@ class TranslatorTest extends BaseTestCase } /** - * @expectedException \Exception + * @expectedException Icinga\Exception\IcingaException */ public function testWhetherSetupLocaleThrowsAnExceptionWhenGivenAnInvalidLocale() { From 97cfeaa3df79913c58fc423f3689d50a1eec9e2a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 18:38:39 +0200 Subject: [PATCH 170/257] SessionNamespaceTest: expect the correct exception --- test/php/library/Icinga/Web/Session/SessionNamespaceTest.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/php/library/Icinga/Web/Session/SessionNamespaceTest.php b/test/php/library/Icinga/Web/Session/SessionNamespaceTest.php index db7be8c64..11dcb23ec 100644 --- a/test/php/library/Icinga/Web/Session/SessionNamespaceTest.php +++ b/test/php/library/Icinga/Web/Session/SessionNamespaceTest.php @@ -4,7 +4,6 @@ namespace Tests\Icinga\Web\Session; -use Exception; use Mockery; use Icinga\Test\BaseTestCase; use Icinga\Web\Session\SessionNamespace; @@ -66,7 +65,7 @@ class SessionNamespaceTest extends BaseTestCase } /** - * @expectedException Exception + * @expectedException Icinga\Exception\IcingaException */ public function testFailingPropertyAccess() { @@ -88,7 +87,7 @@ class SessionNamespaceTest extends BaseTestCase } /** - * @expectedException Exception + * @expectedException Icinga\Exception\IcingaException * @expectedExceptionMessage Cannot save, session not set */ public function testInvalidParentWrite() From 201c24107da384df70d3b8d38910e2b3319b07cf Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 18:43:33 +0200 Subject: [PATCH 171/257] doc/api: keep that directory for the build server --- doc/api/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/api/.gitkeep diff --git a/doc/api/.gitkeep b/doc/api/.gitkeep new file mode 100644 index 000000000..e69de29bb From f91892cb80fd14fa9e86bfb51af969248b3e8c97 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 18:46:58 +0200 Subject: [PATCH 172/257] Web\Url: add matches() function fixes #6992 --- library/Icinga/Web/Url.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/library/Icinga/Web/Url.php b/library/Icinga/Web/Url.php index 9f0294c3c..95033f7ec 100644 --- a/library/Icinga/Web/Url.php +++ b/library/Icinga/Web/Url.php @@ -385,6 +385,23 @@ class Url return $this->params->shift($param, $default); } + /** + * Whether the given URL matches this URL object + * + * This does an exact match, parameters MUST be in the same order + * + * @param Url|string $url the URL to compare against + * + * @return bool whether the URL matches + */ + public function matches($url) + { + if (! $url instanceof Url) { + $url = Url::fromPath($url); + } + return (string) $url === (string) $this; + } + /** * Return a copy of this url without the parameter given * From 05a64ceea97ec2db8129553ae5592f8b3edfeea7 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 18:51:54 +0200 Subject: [PATCH 173/257] monitoring/show: use global hasPreviews check once refs #6932 --- .../monitoring/application/controllers/ShowController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 6b45f3980..7c2c67f41 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -48,6 +48,9 @@ class Monitoring_ShowController extends Controller } if (Hook::has('grapher')) { $this->grapher = Hook::first('grapher'); + if (! $this->grapher->hasPreviews()) { + $this->grapher = null; + } } $this->createTabs(); @@ -64,7 +67,7 @@ class Monitoring_ShowController extends Controller . ' on ' . $o->host_name; $this->getTabs()->activate('service'); $o->populate(); - if ($this->grapher && $this->grapher->hasPreviews($o)) { + if ($this->grapher) { $this->view->grapherHtml = $this->grapher->getPreviewHtml($o); } } @@ -79,7 +82,7 @@ class Monitoring_ShowController extends Controller $this->getTabs()->activate('host'); $this->view->title = $o->host_name; $o->populate(); - if ($this->grapher && $this->grapher->hasPreviews($o)) { + if ($this->grapher) { $this->view->grapherHtml = $this->grapher->getPreviewHtml($o); } } From 7b35741985c0727afff9fdc3f279009d0570282b Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 18:57:20 +0200 Subject: [PATCH 174/257] monitoring/show: forgot to check for existance --- modules/monitoring/application/controllers/ShowController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 7c2c67f41..17d682129 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -48,7 +48,7 @@ class Monitoring_ShowController extends Controller } if (Hook::has('grapher')) { $this->grapher = Hook::first('grapher'); - if (! $this->grapher->hasPreviews()) { + if ($this->grapher && ! $this->grapher->hasPreviews()) { $this->grapher = null; } } From dd943c3aa7ab17ba771abca454a76a9a5aa9d2d2 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 18:59:22 +0200 Subject: [PATCH 175/257] Web\UrlTest: test the new matches() function refs #6992 --- test/php/library/Icinga/Web/UrlTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/php/library/Icinga/Web/UrlTest.php b/test/php/library/Icinga/Web/UrlTest.php index a202b0eee..5da50c3f8 100644 --- a/test/php/library/Icinga/Web/UrlTest.php +++ b/test/php/library/Icinga/Web/UrlTest.php @@ -305,6 +305,26 @@ class UrlTest extends BaseTestCase ); } + public function testWhetherEqualUrlMaches() + { + $url1 = '/whatever/is/here?a=b&c=d'; + $url2 = Url::fromPath('whatever/is/here', array('a' => 'b', 'c' => 'd')); + $this->assertEquals( + true, + $url2->matches($url1) + ); + } + + public function testWhetherDifferentUrlDoesNotMatch() + { + $url1 = '/whatever/is/here?a=b&d=d'; + $url2 = Url::fromPath('whatever/is/here', array('a' => 'b', 'c' => 'd')); + $this->assertEquals( + false, + $url2->matches($url1) + ); + } + /** * @depends testWhetherGetAbsoluteUrlReturnsTheAbsoluteUrlForHtmlAttributes */ From 0f8d5bddba379481d869ab74ff1b611f4810ccc5 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 19:18:09 +0200 Subject: [PATCH 176/257] Web\Menu: make use of Web\Url refs #7083 --- library/Icinga/Web/Menu.php | 13 +++++++++---- library/Icinga/Web/MenuRenderer.php | 13 ++++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/library/Icinga/Web/Menu.php b/library/Icinga/Web/Menu.php index 2fa49b99c..533cabb34 100644 --- a/library/Icinga/Web/Menu.php +++ b/library/Icinga/Web/Menu.php @@ -4,12 +4,13 @@ namespace Icinga\Web; -use Icinga\Exception\ConfigurationError; -use Zend_Config; use RecursiveIterator; +use Zend_Config; use Icinga\Application\Config; use Icinga\Application\Icinga; +use Icinga\Exception\ConfigurationError; use Icinga\Exception\ProgrammingError; +use Icinga\Web\Url; class Menu implements RecursiveIterator { @@ -278,13 +279,17 @@ class Menu implements RecursiveIterator /** * Set the url of this menu * - * @param string $url The url to set for this menu + * @param Url|string $url The url to set for this menu * * @return self */ public function setUrl($url) { - $this->url = $url; + if ($url instanceof Url) { + $this->url = $url; + } else { + $this->url = Url::fromPath($url); + } return $this; } diff --git a/library/Icinga/Web/MenuRenderer.php b/library/Icinga/Web/MenuRenderer.php index 950543fcd..1927b1bc6 100644 --- a/library/Icinga/Web/MenuRenderer.php +++ b/library/Icinga/Web/MenuRenderer.php @@ -33,7 +33,11 @@ class MenuRenderer extends RecursiveIteratorIterator */ public function __construct(Menu $menu, $url = null) { - $this->url = $url; + if ($url instanceof Url) { + $this->url = $url; + } else { + $this->url = Url::fromPath($url); + } parent::__construct($menu, RecursiveIteratorIterator::CHILD_FIRST); } @@ -89,7 +93,7 @@ class MenuRenderer extends RecursiveIteratorIterator { return sprintf( '%s%s', - $child->getUrl() ? Url::fromPath($child->getUrl()) : '#', + $child->getUrl() ?: '#', $child->getIcon() ? ' ' : '', htmlspecialchars($child->getTitle()) ); @@ -146,6 +150,9 @@ class MenuRenderer extends RecursiveIteratorIterator */ protected function isActive(Menu $child) { - return html_entity_decode(rawurldecode($this->url)) === html_entity_decode(rawurldecode($child->getUrl())); + if (! $this->url) return false; + if (! ($childUrl = $child->getUrl())) return false; + + return $this->url && $this->url->matches($childUrl); } } From 0f7f2f2d8b7ce637f62b2d27c77d98489755cce1 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 4 Sep 2014 19:35:31 +0200 Subject: [PATCH 177/257] SearchDashboard: rename ::load() to ::search() Function signature didn't match parent factory function fixes #7081 --- application/controllers/SearchController.php | 2 +- application/layouts/scripts/parts/navigation.phtml | 2 +- library/Icinga/Web/Widget/SearchDashboard.php | 2 +- .../library/Icinga/Web/Widget/SearchDashboardTest.php | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/controllers/SearchController.php b/application/controllers/SearchController.php index c90e930a9..68fd5dd3d 100644 --- a/application/controllers/SearchController.php +++ b/application/controllers/SearchController.php @@ -13,7 +13,7 @@ class SearchController extends ActionController { public function indexAction() { - $this->view->dashboard = SearchDashboard::load($this->params->get('q')); + $this->view->dashboard = SearchDashboard::search($this->params->get('q')); // NOTE: This renders the dashboard twice. Remove this once we can catch exceptions thrown in view scripts. $this->view->dashboard->render(); diff --git a/application/layouts/scripts/parts/navigation.phtml b/application/layouts/scripts/parts/navigation.phtml index 2f4335d89..5dedc75aa 100644 --- a/application/layouts/scripts/parts/navigation.phtml +++ b/application/layouts/scripts/parts/navigation.phtml @@ -12,7 +12,7 @@ if (! $this->auth()->isAuthenticated()) { ?>