Merge branch 'master' into bugfix/modules-menu-provider-6639
This commit is contained in:
commit
20cead67a6
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -142,6 +142,7 @@ class Benchmark
|
|||
// TODO: Move formatting to CSS file
|
||||
$html = '<table class="benchmark">' . "\n" . '<tr>';
|
||||
foreach ($data->columns as & $col) {
|
||||
if ($col->title === 'Time') continue;
|
||||
$html .= sprintf(
|
||||
'<td align="%s">%s</td>',
|
||||
$col->align,
|
||||
|
@ -153,6 +154,7 @@ class Benchmark
|
|||
foreach ($data->rows as & $row) {
|
||||
$html .= '<tr>';
|
||||
foreach ($data->columns as $key => & $col) {
|
||||
if ($col->title === 'Time') continue;
|
||||
$html .= sprintf(
|
||||
'<td align="%s">%s</td>',
|
||||
$col->align,
|
||||
|
|
|
@ -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
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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.'
|
||||
|
|
|
@ -1,27 +1,31 @@
|
|||
<?php
|
||||
$helper = $this->getHelper('MonitoringState');
|
||||
|
||||
if (! $this->compact): ?>
|
||||
<div class="controls">
|
||||
<?= $this->tabs ?>
|
||||
<div style="margin: 1em;" class="dontprint">
|
||||
<?= $this->translate('Sort by') ?> <?= $this->sortControl->render($this) ?>
|
||||
<?php if (! $this->filterEditor): ?>
|
||||
<?= $this->filterPreview ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
if ($this->compact): ?>
|
||||
<div class="content">
|
||||
<?php else: ?>
|
||||
<div class="controls">
|
||||
<?= $this->tabs ?>
|
||||
<div style="margin: 1em;" class="dontprint">
|
||||
<?= $this->translate('Sort by') ?> <?= $this->sortControl->render($this) ?>
|
||||
<?php if (! $this->filterEditor): ?>
|
||||
<?= $this->filterPreview ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?= $this->widget('limiter')->setMaxLimit($this->hosts->count()) ?>
|
||||
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
|
||||
<?= $this->selectionToolbar('multi', $this->href('monitoring/multi/host?' . $this->filter->toQueryString())) ?>
|
||||
</div>
|
||||
<div class="content">
|
||||
<?= $this->filterEditor ?>
|
||||
<?= $this->widget('limiter')->setMaxLimit($this->hosts->count()) ?>
|
||||
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
|
||||
<?= $this->selectionToolbar('multi', $this->href('monitoring/multi/host?' . $this->filter->toQueryString())) ?>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<?= $this->filterEditor ?>
|
||||
<?php
|
||||
|
||||
endif;
|
||||
|
||||
if ($hosts->count() === 0) {
|
||||
echo t('No hosts matching the filter');
|
||||
echo $this->translate('No hosts matching the filter');
|
||||
if (! $this->compact) {
|
||||
echo '</div>';
|
||||
}
|
||||
|
@ -32,107 +36,90 @@ if ($hosts->count() === 0) {
|
|||
<table
|
||||
data-base-target="_next"
|
||||
class="action multiselect"
|
||||
data-icinga-multiselect-url="<?= $this->href("/monitoring/multi/host") ?>"
|
||||
data-icinga-multiselect-url="<?= $this->href('/monitoring/multi/host') ?>"
|
||||
data-icinga-multiselect-data="host"
|
||||
>
|
||||
<tbody>
|
||||
<?php foreach($hosts as $host):
|
||||
<tbody>
|
||||
<?php foreach($hosts as $host):
|
||||
|
||||
$hostStateName = strtolower($this->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');
|
||||
}
|
||||
?>
|
||||
<tr class="state <?= $hostStateName ?><?= $host->host_handled ? ' handled' : '' ?>">
|
||||
<!-- State -->
|
||||
<td class="state" title="<?= $helper->getStateTitle($host, 'host') ?>">
|
||||
<?php if (! $this->compact): ?>
|
||||
<div>
|
||||
<strong><?= ucfirst($helper->monitoringState($host, 'host')) ?></strong><br />
|
||||
<div class="small-row">
|
||||
<?php endif; ?>
|
||||
<?= $this->prefixedTimeSince($host->host_last_state_change, true) ?>
|
||||
<?php if (! $this->compact): ?>
|
||||
<?php if ($host->host_state > 0): ?>
|
||||
<br />
|
||||
<strong><?= $this->translate(
|
||||
($host->host_state_type === '1') ? 'Hard' : 'Soft'
|
||||
) ?> </strong> <!--
|
||||
--><?= $host->host_current_check_attempt ?>/<?= $host->host_max_check_attempts ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
}
|
||||
|
||||
<!-- Host / Status / Output -->
|
||||
<td>
|
||||
<?php if (! $this->compact): ?>
|
||||
<?php if ($host->host_icon_image): ?>
|
||||
<?= $this->img(
|
||||
$this->resolveMacros($host->host_icon_image, $host),
|
||||
array('align' => 'right')
|
||||
) ?>
|
||||
<?php endif; ?>
|
||||
<?= implode(' ', $icons) ?>
|
||||
<?php endif ?>
|
||||
<a href="<?= $this->compact ? $hostLink : $this->href(
|
||||
'monitoring/show/host',
|
||||
array('host' => $host->host_name)
|
||||
) ?>"><?= $host->host_name ?></a>
|
||||
<?php if (isset($host->host_unhandled_services) && $host->host_unhandled_services > 0): ?>
|
||||
<span style="font-weight: normal" title="<?=
|
||||
$host->host_unhandled_services
|
||||
?> Service Problems on Host"> (<?= $this->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')
|
||||
) ?>)</span>
|
||||
<?php endif ?>
|
||||
<br />
|
||||
<?= $this->escape(substr(strip_tags($host->host_output), 0, 10000)) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
if (isset($host->host_last_comment) && $host->host_last_comment !== null) {
|
||||
$icons[] = $this->icon('comment.png', 'Comment: ' . $host->host_last_comment);
|
||||
}
|
||||
?>
|
||||
<tr class="state <?= $hostStateName ?><?= $host->host_handled ? ' handled' : '' ?>">
|
||||
<!-- State -->
|
||||
<td class="state" title="<?= $helper->getStateTitle($host, 'host') ?>">
|
||||
<?php if (! $this->compact): ?>
|
||||
<strong><?= ucfirst($helper->monitoringState($host, 'host')) ?></strong><br />
|
||||
<?php endif ?>
|
||||
<?= $this->prefixedTimeSince($host->host_last_state_change, true) ?>
|
||||
<?php if ($host->host_state > 0 && (int) $host->host_state_type === 0): ?>
|
||||
<br />
|
||||
<strong>Soft <?= $host->host_attempt ?></strong>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
|
||||
<!-- Host / Status / Output -->
|
||||
<td>
|
||||
<?php if ($host->host_icon_image && ! preg_match('/[\'"]/', $host->host_icon_image)): ?>
|
||||
<?= $this->icon($this->resolveMacros($host->host_icon_image, $host)) ?>
|
||||
<?php endif ?>
|
||||
<?= implode(' ', $icons) ?>
|
||||
<a href="<?= $hostLink ?>"><?= $host->host_name ?></a>
|
||||
<?php if (isset($host->host_unhandled_services) && $host->host_unhandled_services > 0): ?>
|
||||
<span title="<?=
|
||||
$host->host_unhandled_services
|
||||
?> Service Problems on Host"> (<?= $this->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')
|
||||
) ?>)</span>
|
||||
<?php endif ?>
|
||||
<p class="pluginoutput"><?= $this->escape(substr(strip_tags($host->host_output), 0, 10000)) ?></p>
|
||||
</td>
|
||||
<?php foreach($this->extraColumns as $col): ?>
|
||||
<td><?= $this->escape($host->$col) ?></td>
|
||||
<?php endforeach ?>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue