diff --git a/application/controllers/StaticController.php b/application/controllers/StaticController.php index df930c3d7..3a15b1b1e 100644 --- a/application/controllers/StaticController.php +++ b/application/controllers/StaticController.php @@ -30,8 +30,8 @@ class StaticController extends ActionController public function gravatarAction() { + 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'); - header('image/jpeg'); echo $img; } diff --git a/library/Icinga/Application/Benchmark.php b/library/Icinga/Application/Benchmark.php index c510c61bf..fd69dd510 100644 --- a/library/Icinga/Application/Benchmark.php +++ b/library/Icinga/Application/Benchmark.php @@ -142,6 +142,7 @@ class Benchmark // TODO: Move formatting to CSS file $html = '' . "\n" . ''; foreach ($data->columns as & $col) { + if ($col->title === 'Time') continue; $html .= sprintf( '', $col->align, @@ -153,6 +154,7 @@ class Benchmark foreach ($data->rows as & $row) { $html .= ''; foreach ($data->columns as $key => & $col) { + if ($col->title === 'Time') continue; $html .= sprintf( '', $col->align, diff --git a/library/Icinga/Application/Loader.php b/library/Icinga/Application/Loader.php index bc31cfbb1..56e59f4b2 100644 --- a/library/Icinga/Application/Loader.php +++ b/library/Icinga/Application/Loader.php @@ -40,9 +40,9 @@ class Loader { if (!is_dir($directory)) { throw new ProgrammingError(sprintf( - 'Namespace directory "%s" for "%s" does not exist', - $namespace, - $directory + 'Directory "%s" for namespace "%s" does not exist', + $directory, + $namespace )); } 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', diff --git a/modules/monitoring/application/forms/Config/SecurityForm.php b/modules/monitoring/application/forms/Config/SecurityForm.php index 74577c0d5..b0749868d 100644 --- a/modules/monitoring/application/forms/Config/SecurityForm.php +++ b/modules/monitoring/application/forms/Config/SecurityForm.php @@ -21,13 +21,14 @@ class SecurityForm extends Form */ public function create() { + $default = '*pw*,*pass*,community'; $this->addElement( 'text', 'protected_customvars', array( 'label' => 'Protected Custom Variables', 'required' => true, - 'value' => $this->config->protected_customvars, + 'value' => $this->config ? $this->config->get('protected_customvars', $default) : $default, 'helptext' => 'Comma separated case insensitive list of protected custom variables.' . ' Use * as a placeholder for zero or more wildcard characters.' . ' Existance of those custom variables will be shown, but their values will be masked.' 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) {
%s
%s
" + 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) ?>