Merge remote-tracking branch 'origin/master' into feature/add-to-dashboard-4537

This commit is contained in:
Marius Hein 2014-11-19 12:12:47 +01:00
commit 6da4639fc1
5 changed files with 660 additions and 536 deletions

View File

@ -396,7 +396,8 @@ class Monitoring_ListController extends Controller
array('day', $form->getValue('state')) array('day', $form->getValue('state'))
); );
$this->params->remove(array('objecttype', 'from', 'to', 'state', 'btn_submit')); $this->params->remove(array('objecttype', 'from', 'to', 'state', 'btn_submit'));
$this->filterQuery($query); $this->view->filter = Filter::fromQuerystring((string) $this->params);
$query->applyFilter($this->view->filter);
$this->view->summary = $query->getQuery()->fetchAll(); $this->view->summary = $query->getQuery()->fetchAll();
$this->view->column = $form->getValue('state'); $this->view->column = $form->getValue('state');
// $this->view->orientationBox = $orientationBox; // $this->view->orientationBox = $orientationBox;
@ -490,7 +491,16 @@ class Monitoring_ListController extends Controller
'services_critical_unhandled', 'services_critical_unhandled',
'services_warning_handled', 'services_warning_handled',
'services_warning_unhandled', 'services_warning_unhandled',
'services_pending' 'services_pending',
'services_ok_last_state_change',
'services_pending_last_state_change',
'services_warning_last_state_change_handled',
'services_critical_last_state_change_handled',
'services_unknown_last_state_change_handled',
'services_warning_last_state_change_unhandled',
'services_critical_last_state_change_unhandled',
'services_unknown_last_state_change_unhandled',
'services_total'
)); ));
$this->filterQuery($query); $this->filterQuery($query);
$this->view->servicegroups = $query->paginate(); $this->view->servicegroups = $query->paginate();
@ -521,7 +531,16 @@ class Monitoring_ListController extends Controller
'services_critical_unhandled', 'services_critical_unhandled',
'services_warning_handled', 'services_warning_handled',
'services_warning_unhandled', 'services_warning_unhandled',
'services_pending' 'services_pending',
'services_ok_last_state_change',
'services_pending_last_state_change',
'services_warning_last_state_change_handled',
'services_critical_last_state_change_handled',
'services_unknown_last_state_change_handled',
'services_warning_last_state_change_unhandled',
'services_critical_last_state_change_unhandled',
'services_unknown_last_state_change_unhandled',
'services_total'
)); ));
$this->filterQuery($query); $this->filterQuery($query);
$this->view->hostgroups = $query->paginate(); $this->view->hostgroups = $query->paginate();

View File

@ -1,266 +1,253 @@
<?php if (!$this->compact): ?> <?php if ($this->compact): ?>
<div class="controls">
<?= $this->tabs ?>
</div>
<?php endif ?>
<div class="content"> <div class="content">
<div class="boxview" data-base-target="_next"> <?php else: ?>
<div class="controls">
<?php <?= $this->tabs ?>
if (count($hostgroups) === 0) { <?= $this->widget('limiter')->setMaxLimit(count($hostgroups)); ?>
echo mt('monitoring', 'No host groups matching the filter'); <?= $this->paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?>
} </div>
?> <div class="content">
<?php foreach($hostgroups as $h): ?> <?= $this->filterEditor; ?>
<div class="box hostgroup"> <?php endif ?>
<h2> <?php
<a href="<?= $this->href('monitoring/list/services', array('hostgroup' => $h->hostgroup)); ?>"> if (count($hostgroups) === 0) {
<?= $h->hostgroup; ?> echo $this->translate('No host groups matching the filter');
</a> echo '</div>';
</h2> return;
<div class="box contents"> }
<table> ?>
<thead> <table class="groupview" data-base-target="_next">
<tr> <thead>
<th><?= $this->translate('Hosts'); ?></th> <th style="text-align: left;"><?= $this->translate('Last Problem'); ?></th>
<th><?= $this->translate('Services'); ?></th> <th style="text-align: left;"><?= $this->translate('Host Group'); ?></th>
</tr> <th><?= $this->translate('Total Services'); ?></th>
</thead> <th colspan="5"><?= $this->translate('Service States'); ?></th>
<tbody> </thead>
<tr> <tbody>
<td> <?php foreach ($hostgroups as $h): ?>
<?php if ($h->hosts_down_handled || $h->hosts_down_unhandled): ?> <tr href="<?= $this->href('monitoring/list/services', array('hostgroup' => $h->hostgroup)); ?>">
<!-- Hosts DOWN --> <?php if ($h->services_critical_last_state_change_unhandled): ?>
<div class="box entry state_down <?= $h->hosts_down_unhandled ? '' : 'handled'; ?>"> <td class="state change critical">
<?php if ($h->hosts_down_unhandled): ?> <strong><?= $this->translate('CRITICAL'); ?></strong>
<a href="<?= $this->href( <br>
'monitoring/list/hosts', <?= $this->prefixedTimeSince($h->services_critical_last_state_change_unhandled); ?>
array( </td>
'host_state' => 1, <?php elseif ($h->services_unknown_last_state_change_unhandled): ?>
'host_unhandled' => 1, <td class="state change unknown">
'hostgroup' => $h->hostgroup <strong><?= $this->translate('UNKNOWN'); ?></strong>
) <br>
); ?>" title="<?= $this->translate('Hosts DOWN Unhandled') ?>"> <?= $this->prefixedTimeSince($h->services_unknown_last_state_change_unhandled); ?>
<?= $h->hosts_down_unhandled; ?> <?= $this->translate('DOWN', 'icinga.state') ?> </td>
</a> <?php elseif ($h->services_warning_last_state_change_unhandled): ?>
<?php endif ?> <td class="state change warning">
<?php if ($h->hosts_down_handled): ?> <strong><?= $this->translate('WARNING'); ?></strong>
<a href="<?= $this->href( <br>
'monitoring/list/hosts', <?= $this->prefixedTimeSince($h->services_warning_last_state_change_unhandled); ?>
array( </td>
'host_state' => 1, <?php elseif ($h->services_critical_last_state_change_handled): ?>
'host_handled' => 1, <td class="state change critical handled">
'hostgroup' => $h->hostgroup <strong><?= $this->translate('CRITICAL'); ?></strong>
) <br>
); ?>" title="<?= $this->translate('Hosts DOWN Handled') ?>"> <?= $this->prefixedTimeSince($h->services_critical_last_state_change_handled); ?>
<?= $h->hosts_down_handled . ' ' . ($h->hosts_down_unhandled ? $this->translate('Acknowledged') : $this->translate('DOWN', 'icinga.state')); ?> </td>
</a> <?php elseif ($h->services_unknown_last_state_change_handled): ?>
<?php endif ?> <td class="state change unknown handled">
</div> <strong><?= $this->translate('UNKNOWN'); ?></strong>
<!-- End of Hosts DOWN --> <br>
<?php endif ?> <?= $this->prefixedTimeSince($h->services_unknown_last_state_change_handled); ?>
<?php if ($h->hosts_unreachable_handled || $h->hosts_unreachable_unhandled): ?> </td>
<!-- Hosts UNREACHABLE --> <?php elseif ($h->services_warning_last_state_change_handled): ?>
<div class="box entry state_unreachable <?= $h->hosts_unreachable_unhandled ? '' : 'handled'; ?>"> <td class="state change warning handled">
<?php if ($h->hosts_unreachable_unhandled): ?> <strong><?= $this->translate('WARNING'); ?></strong>
<a href="<?= $this->href( <br>
'monitoring/list/hosts', <?= $this->prefixedTimeSince($h->services_warning_last_state_change_handled); ?>
array( </td>
'host_state' => 2, <?php elseif ($h->services_ok_last_state_change): ?>
'host_unhandled' => 1, <td class="state change ok">
'hostgroup' => $h->hostgroup <strong><?= $this->translate('OK'); ?></strong>
) <br>
); ?>" title="<?= $this->translate('Hosts UNREACHABLE Unhandled') ?>"> <?= $this->prefixedTimeSince($h->services_ok_last_state_change); ?>
<?= $h->hosts_unreachable_unhandled; ?> <?= $this->translate('UNREACHABLE', 'icinga.state') ?> </td>
</a> <?php else: ?>
<?php endif ?> <td class="state change pending">
<?php if ($h->hosts_unreachable_handled): ?> <strong><?= $this->translate('PENDING'); ?></strong>
<a href="<?= $this->href( <br>
'monitoring/list/hosts', <?= $this->prefixedTimeSince($h->services_pending_last_state_change); ?>
array( </td>
'host_state' => 2, <?php endif ?>
'host_handled' => 1, <td>
'hostgroup' => $h->hostgroup <a href="<?= $this->href('monitoring/list/services', array('hostgroup' => $h->hostgroup)); ?>">
) <?= $h->hostgroup; ?>
); ?>" title="<?= $this->translate('Hosts UNREACHABLE Handled') ?>"> </a>
<?= $h->hosts_unreachable_handled . ' ' . ($h->hosts_unreachable_unhandled ? $this->translate('Acknowledged') : $this->translate('UNREACHABLE', 'icinga.state')) ?> </td>
</a> <td class="services-total">
<?php endif ?> <?= $h->services_total; ?>
</div> </td>
<!-- End of Hosts UNREACHABLE --> <td class="state">
<?php endif ?> <?php if ($h->services_ok): ?>
<?php if ($h->hosts_up): ?> <span class="state ok">
<!-- Hosts UP --> <a href="<?= $this->href(
<div class="box entry state_up"> 'monitoring/list/services',
<a href="<?= $this->href( array(
'monitoring/list/hosts', 'service_state' => 0,
array( 'hostgroup' => $h->hostgroup,
'host_state' => 0, 'sort' => 'service_severity'
'hostgroup' => $h->hostgroup )
) ); ?>" title="<?= $this->translate('Services OK'); ?>">
); ?>" title="<?= $this->translate('Hosts UP') ?>"> <?= $h->services_ok; ?>
<?= $h->hosts_up; ?> <?= $this->translate('UP', 'icinga.state') ?> </a>
</a> </span>
</div> <?php else: ?>
<!-- End of Hosts UP --> <span class="no-state">
<?php endif ?> -
<?php if ($h->hosts_pending): ?> </span>
<!-- Hosts PENDING --> <?php endif ?>
<div class="box entry state_pending"> </td>
<a href="<?= $this->href( <td class="state">
'monitoring/list/hosts', <?php if ($h->services_critical_unhandled): ?>
array( <span class="state critical">
'host_state' => 99, <a href="<?= $this->href(
'hostgroup' => $h->hostgroup 'monitoring/list/services',
) array(
); ?>" title="<?= $this->translate('Hosts PENDING') ?>"> 'service_state' => 2,
<?= $h->hosts_pending; ?> <?= $this->translate('PENDING', 'icinga.state') ?> 'service_acknowledged' => 0,
</a> 'service_in_downtime' => 0,
</div> 'host_problem' => 0,
<!-- End of Hosts PENDING --> 'hostgroup' => $h->hostgroup,
<?php endif ?> 'sort' => 'service_severity'
</td> )
<td> ); ?>" title="<?= $this->translate('Services CRITICAL Unhandled'); ?>">
<?php if ($h->services_critical_handled || $h->services_critical_unhandled): ?> <?= $h->services_critical_unhandled; ?>
<!-- Services CRITICAL --> </a>
<div class="box entry state_critical <?= $h->services_critical_unhandled ? '' : 'handled'; ?>"> <?php endif ?>
<?php if ($h->services_critical_unhandled): ?> <?php if ($h->services_critical_handled): ?>
<a href="<?= $this->href( <span class="state critical handled">
'monitoring/list/services', <a href="<?= $this->href(
array( 'monitoring/list/services',
'service_state' => 2, array(
'service_acknowledged' => 0, 'service_state' => 2,
'service_in_downtime' => 0, 'service_handled' => 1,
'host_problem' => 0, 'hostgroup' => $h->hostgroup,
'hostgroup' => $h->hostgroup, 'sort' => 'service_severity'
'sort' => 'service_severity' )
) ); ?>" title="<?= $this->translate('Services CRITICAL Handled'); ?>">
); ?>" title="<?= $this->translate('Services CRITICAL Unhandled') ?>"> <?= $h->services_critical_handled; ?>
<?= $h->services_critical_unhandled; ?> <?= $this->translate('CRITICAL', 'icinga.state') ?> </a>
</a> </span>
<?php endif ?> <?php endif ?>
<?php if ($h->services_critical_handled): ?> <?php if ($h->services_critical_unhandled): ?>
<a href="<?= $this->href( </span>
'monitoring/list/services', <?php endif ?>
array( <?php if (! $h->services_critical_unhandled && !$h->services_critical_handled): ?>
'service_state' => 2, <span class="no-state">
'service_handled' => 1, -
'hostgroup' => $h->hostgroup, </span>
'sort' => 'service_severity' <?php endif ?>
) </td>
); ?>" title="<?= $this->translate('Services CRITICAL Handled') ?>"> <td class="state">
<?= $h->services_critical_handled . ' ' . ($h->services_critical_unhandled ? $this->translate('Acknowledged') : $this->translate('CRITICAL', 'icinga.state')); ?> <?php if ($h->services_unknown_unhandled): ?>
</a> <span class="state unknown">
<?php endif ?> <a href="<?= $this->href(
</div> 'monitoring/list/services',
<!-- End of Services CRITICAL --> array(
<?php endif ?> 'service_state' => 3,
<?php if ($h->services_warning_handled || $h->services_warning_unhandled): ?> 'service_acknowledged' => 0,
<!-- Services WARNING --> 'service_in_downtime' => 0,
<div class="box entry state_warning <?= $h->services_warning_unhandled ? '' : 'handled'; ?>"> 'host_problem' => 0,
<?php if ($h->services_warning_unhandled): ?> 'hostgroup' => $h->hostgroup,
<a href="<?= $this->href( 'sort' => 'service_severity'
'monitoring/list/services', )
array( ); ?>" title="<?= $this->translate('Services UNKNOWN Unhandled'); ?>">
'service_state' => 1, <?= $h->services_unknown_unhandled; ?>
'service_acknowledged' => 0, </a>
'service_in_downtime' => 0, <?php endif ?>
'host_problem' => 0, <?php if ($h->services_unknown_handled): ?>
'hostgroup' => $h->hostgroup, <span class="state unknown handled">
'sort' => 'service_severity' <a href="<?= $this->href(
) 'monitoring/list/services',
); ?>" title="<?= $this->translate('Services WARNING Unhandled') ?>"> array(
<?= $h->services_warning_unhandled; ?> <?= $this->translate('WARNING', 'icinga.state') ?> 'service_state' => 3,
</a> 'service_handled' => 1,
<?php endif ?> 'hostgroup' => $h->hostgroup,
<?php if ($h->services_warning_handled): ?> 'sort' => 'service_severity'
<a href="<?= $this->href( )
'monitoring/list/services', ); ?>" title="<?= $this->translate('Services UNKNOWN Handled'); ?>">
array( <?= $h->services_unknown_handled; ?>
'service_state' => 1, </a>
'service_handled' => 1, </span>
'hostgroup' => $h->hostgroup, <?php endif ?>
'sort' => 'service_severity' <?php if ($h->services_unknown_unhandled): ?>
) </span>
); ?>" title="<?= $this->translate('Services WARNING Handled') ?>"> <?php endif ?>
<?= $h->services_warning_handled . ' ' . ($h->services_warning_unhandled ? $this->translate('Acknowledged') : $this->translate('WARNING', 'icinga.state')); ?> <?php if (! $h->services_unknown_unhandled && !$h->services_unknown_handled): ?>
</a> <span class="no-state">
<?php endif ?> -
</div> </span>
<!-- End of Services WARNING --> <?php endif ?>
<?php endif ?> </td>
<?php if ($h->services_unknown_handled || $h->services_unknown_unhandled): ?> <td class="state">
<!-- Services UNKNOWN --> <?php if ($h->services_warning_unhandled): ?>
<div class="box entry state_unknown <?= $h->services_unknown_unhandled ? '' : 'handled'; ?>"> <span class="state warning">
<?php if ($h->services_unknown_unhandled): ?> <a href="<?= $this->href(
<a href="<?= $this->href( 'monitoring/list/services',
'monitoring/list/services', array(
array( 'service_state' => 1,
'service_state' => 3, 'service_acknowledged' => 0,
'service_acknowledged' => 0, 'service_in_downtime' => 0,
'service_in_downtime' => 0, 'host_problem' => 0,
'host_problem' => 0, 'hostgroup' => $h->hostgroup,
'hostgroup' => $h->hostgroup, 'sort' => 'service_severity'
'sort' => 'service_severity' )
) ); ?>" title="<?= $this->translate('Services WARNING Unhandled'); ?>">
); ?>" title="<?= $this->translate('Services UNKNOWN Unhandled') ?>"> <?= $h->services_warning_unhandled; ?>
<?= $h->services_unknown_unhandled; ?> <?= $this->translate('UNKNOWN', 'icinga.state') ?> </a>
</a> <?php endif ?>
<?php endif ?> <?php if ($h->services_warning_handled): ?>
<?php if ($h->services_unknown_handled): ?> <span class="state warning handled">
<a href="<?= $this->href( <a href="<?= $this->href(
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 3, 'service_state' => 1,
'service_handled' => 1, 'service_handled' => 1,
'hostgroup' => $h->hostgroup, 'hostgroup' => $h->hostgroup,
'sort' => 'service_severity' 'sort' => 'service_severity'
) )
); ?>" title="<?= $this->translate('Services UNKNOWN Handled') ?>"> ); ?>" title="<?= $this->translate('Services WARNING Handled'); ?>">
<?= $h->services_unknown_handled . ' ' . ($h->services_unknown_unhandled ? $this->translate('Acknowledged') : $this->translate('UNKNOWN', 'icinga.state')); ?> <?= $h->services_warning_handled; ?>
</a> </a>
<?php endif ?> </span>
</div> <?php endif ?>
<!-- End of Services UNKNOWN --> <?php if ($h->services_warning_unhandled): ?>
<?php endif ?> </span>
<?php if ($h->services_ok): ?> <?php endif ?>
<!-- Services OK --> <?php if (! $h->services_warning_unhandled && !$h->services_warning_handled): ?>
<div class="box entry state_ok"> <span class="no-state">
<a href="<?= $this->href( -
'monitoring/list/services', </span>
array( <?php endif ?>
'service_state' => 0, </td>
'hostgroup' => $h->hostgroup, <td class="state">
'sort' => 'service_severity' <?php if ($h->services_pending): ?>
) <span class="state pending">
); ?>" title="<?= $this->translate('Services OK') ?>"> <a href="<?= $this->href(
<?= $h->services_ok; ?> <?= $this->translate('OK', 'icinga.state') ?> 'monitoring/list/services',
</a> array(
</div> 'service_state' => 99,
<!-- End of Services OK --> 'hostgroup' => $h->hostgroup,
<?php endif ?> 'sort' => 'service_severity'
<?php if ($h->services_pending): ?> )
<!-- Services PENDING --> ); ?>" title="<?= $this->translate('Services PENDING'); ?>">
<div class="box entry state_pending"> <?= $h->services_pending; ?>
<a href="<?= $this->href( </a>
'monitoring/list/services', </span>
array( <?php else: ?>
'service_state' => 99, <span class="no-state">
'hostgroup' => $h->hostgroup, -
'sort' => 'service_severity' </span>
) <?php endif ?>
); ?>" title="<?= $this->translate('Services PENDING') ?>"> </td>
<?= $h->services_pending; ?> <?= $this->translate('PENDING', 'icinga.state') ?> </tr>
</a> <?php endforeach ?>
</div> </tbody>
<!-- End of Services PENDING --> </table>
<?php endif ?>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<?php endforeach ?>
</div>
</div> </div>

View File

@ -1,269 +1,253 @@
<?php if (!$this->compact): ?> <?php if ($this->compact): ?>
<div class="controls">
<?= $this->tabs ?>
</div>
<?php endif ?>
<div class="content"> <div class="content">
<div class="boxview" data-base-target="_next"> <?php else: ?>
<div class="controls">
<?php <?= $this->tabs ?>
if (count($servicegroups) === 0) { <?= $this->widget('limiter')->setMaxLimit(count($servicegroups)); ?>
echo mt('monitoring', 'No service groups matching the filter'); <?= $this->paginationControl($servicegroups, null, null, array('preserve' => $this->preserve)); ?>
} </div>
?> <div class="content">
<?php foreach($servicegroups as $servicegroup): ?> <?= $this->filterEditor; ?>
<div class="box servicegroup"> <?php endif ?>
<h2> <?php
<a href="<?= $this->href( if (count($servicegroups) === 0) {
'monitoring/list/services', echo $this->translate('No service groups matching the filter');
array('servicegroup' => $servicegroup->servicegroup) echo '</div>';
); ?>"> return;
<?= $servicegroup->servicegroup; ?> }
</a> ?>
</h2> <table class="groupview" data-base-target="_next">
<div class="box contents"> <thead>
<table> <th style="text-align: left;"><?= $this->translate('Last Problem'); ?></th>
<thead> <th style="text-align: left;"><?= $this->translate('Service Group'); ?></th>
<tr> <th><?= $this->translate('Total Services'); ?></th>
<th><?= $this->translate('Hosts'); ?></th> <th colspan="5"><?= $this->translate('Service States'); ?></th>
<th><?= $this->translate('Services'); ?></th> </thead>
</tr> <tbody>
</thead> <?php foreach ($servicegroups as $s): ?>
<tbody> <tr href="<?= $this->href('monitoring/list/services', array('servicegroup' => $s->servicegroup)); ?>">
<tr> <?php if ($s->services_critical_last_state_change_unhandled): ?>
<td> <td class="state change critical">
<?php if ($servicegroup->hosts_down_handled || $servicegroup->hosts_down_unhandled): ?> <strong><?= $this->translate('CRITICAL'); ?></strong>
<!-- Hosts DOWN --> <br>
<div class="box entry state_down <?= $servicegroup->hosts_down_unhandled ? '' : 'handled'; ?>"> <?= $this->prefixedTimeSince($s->services_critical_last_state_change_unhandled); ?>
<?php if ($servicegroup->hosts_down_unhandled): ?> </td>
<a href="<?= $this->href( <?php elseif ($s->services_unknown_last_state_change_unhandled): ?>
'monitoring/list/hosts', <td class="state change unknown">
array( <strong><?= $this->translate('UNKNOWN'); ?></strong>
'host_state' => 1, <br>
'host_unhandled' => 1, <?= $this->prefixedTimeSince($s->services_unknown_last_state_change_unhandled); ?>
'servicegroup' => $servicegroup->servicegroup </td>
) <?php elseif ($s->services_warning_last_state_change_unhandled): ?>
); ?>" title="<?= $this->translate('Hosts DOWN Unhandled') ?>"> <td class="state change warning">
<?= $servicegroup->hosts_down_unhandled; ?> <?= $this->translate('DOWN', 'icinga.state') ?> <strong><?= $this->translate('WARNING'); ?></strong>
</a> <br>
<?php endif ?> <?= $this->prefixedTimeSince($s->services_warning_last_state_change_unhandled); ?>
<?php if ($servicegroup->hosts_down_handled): ?> </td>
<a href="<?= $this->href( <?php elseif ($s->services_critical_last_state_change_handled): ?>
'monitoring/list/hosts', <td class="state change critical handled">
array( <strong><?= $this->translate('CRITICAL'); ?></strong>
'host_state' => 1, <br>
'host_handled' => 1, <?= $this->prefixedTimeSince($s->services_critical_last_state_change_handled); ?>
'servicegroup' => $servicegroup->servicegroup </td>
) <?php elseif ($s->services_unknown_last_state_change_handled): ?>
); ?>" title="<?= $this->translate('Hosts DOWN Handled') ?>"> <td class="state change unknown handled">
<?= $servicegroup->hosts_down_handled . ' ' . ($servicegroup->hosts_down_unhandled ? $this->translate('Acknowledged') : 'DOWN'); ?> <strong><?= $this->translate('UNKNOWN'); ?></strong>
</a> <br>
<?php endif ?> <?= $this->prefixedTimeSince($s->services_unknown_last_state_change_handled); ?>
</div> </td>
<!-- End of Hosts DOWN --> <?php elseif ($s->services_warning_last_state_change_handled): ?>
<?php endif ?> <td class="state change warning handled">
<?php if ($servicegroup->hosts_unreachable_handled || $servicegroup->hosts_unreachable_unhandled): ?> <strong><?= $this->translate('WARNING'); ?></strong>
<!-- Hosts UNREACHABLE --> <br>
<div class="box entry state_unreachable <?= $servicegroup->hosts_unreachable_unhandled ? '' : 'handled'; ?>"> <?= $this->prefixedTimeSince($s->services_warning_last_state_change_handled); ?>
<?php if ($servicegroup->hosts_unreachable_unhandled): ?> </td>
<a href="<?= $this->href( <?php elseif ($s->services_ok_last_state_change): ?>
'monitoring/list/hosts', <td class="state change ok">
array( <strong><?= $this->translate('OK'); ?></strong>
'host_state' => 2, <br>
'host_unhandled' => 1, <?= $this->prefixedTimeSince($s->services_ok_last_state_change); ?>
'servicegroup' => $servicegroup->servicegroup </td>
) <?php else: ?>
); ?>" title="<?= $this->translate('Hosts UNREACHABLE Unhandled') ?>"> <td class="state change pending">
<?= $servicegroup->hosts_unreachable_unhandled; ?> <?= $this->translate('UNREACHABLE', 'icinga.state') ?> <strong><?= $this->translate('PENDING'); ?></strong>
</a> <br>
<?php endif ?> <?= $this->prefixedTimeSince($s->services_pending_last_state_change); ?>
<?php if ($servicegroup->hosts_unreachable_handled): ?> </td>
<a href="<?= $this->href( <?php endif ?>
'monitoring/list/hosts', <td>
array( <a href="<?= $this->href('monitoring/list/services', array('servicegroup' => $s->servicegroup)); ?>">
'host_state' => 2, <?= $s->servicegroup; ?>
'host_handled' => 1, </a>
'servicegroup' => $servicegroup->servicegroup </td>
) <td class="services-total">
); ?>" title="<?= $this->translate('Hosts UNREACHABLE Handled') ?>"> <?= $s->services_total; ?>
<?= $servicegroup->hosts_unreachable_handled . ' ' . ($servicegroup->hosts_unreachable_unhandled ? $this->translate('Acknowledged') : 'UNREACHABLE'); ?> </td>
</a> <td class="state">
<?php endif ?> <?php if ($s->services_ok): ?>
</div> <span class="state ok">
<!-- End of Hosts UNREACHABLE --> <a href="<?= $this->href(
<?php endif ?> 'monitoring/list/services',
<?php if ($servicegroup->hosts_up): ?> array(
<!-- Hosts UP --> 'service_state' => 0,
<div class="box entry state_up"> 'servicegroup' => $s->servicegroup,
<a href="<?= $this->href( 'sort' => 'service_severity'
'monitoring/list/hosts', )
array( ); ?>" title="<?= $this->translate('Services OK'); ?>">
'host_state' => 0, <?= $s->services_ok; ?>
'servicegroup' => $servicegroup->servicegroup </a>
) </span>
); ?>" title="<?= $this->translate('Hosts UP') ?>"> <?php else: ?>
<?= $servicegroup->hosts_up; ?> <?= $this->translate('UP', 'icinga.state') ?> <span class="no-state">
</a> -
</div> </span>
<!-- End of Hosts UP --> <?php endif ?>
<?php endif ?> </td>
<?php if ($servicegroup->hosts_pending): ?> <td class="state">
<!-- Hosts PENDING --> <?php if ($s->services_critical_unhandled): ?>
<div class="box entry state_pending"> <span class="state critical">
<a href="<?= $this->href( <a href="<?= $this->href(
'monitoring/list/hosts', 'monitoring/list/services',
array( array(
'host_state' => 99, 'service_state' => 2,
'servicegroup' => $servicegroup->servicegroup 'service_acknowledged' => 0,
) 'service_in_downtime' => 0,
); ?>" title="<?= $this->translate('Hosts PENDING') ?>"> 'host_problem' => 0,
<?= $servicegroup->hosts_pending; ?> <?= $this->translate('PENDING', 'icinga.state') ?> 'servicegroup' => $s->servicegroup,
</a> 'sort' => 'service_severity'
</div> )
<!-- End of Hosts PENDING --> ); ?>" title="<?= $this->translate('Services CRITICAL Unhandled'); ?>">
<?php endif ?> <?= $s->services_critical_unhandled; ?>
</td> </a>
<td> <?php endif ?>
<?php if ($servicegroup->services_critical_handled || $servicegroup->services_critical_unhandled): ?> <?php if ($s->services_critical_handled): ?>
<!-- Services CRITICAL --> <span class="state critical handled">
<div class="box entry state_critical <?= $servicegroup->services_critical_unhandled ? '' : 'handled'; ?>"> <a href="<?= $this->href(
<?php if ($servicegroup->services_critical_unhandled): ?> 'monitoring/list/services',
<a href="<?= $this->href( array(
'monitoring/list/services', 'service_state' => 2,
array( 'service_handled' => 1,
'service_state' => 2, 'servicegroup' => $s->servicegroup,
'service_acknowledged' => 0, 'sort' => 'service_severity'
'service_in_downtime' => 0, )
'host_problem' => 0, ); ?>" title="<?= $this->translate('Services CRITICAL Handled'); ?>">
'servicegroup' => $servicegroup->servicegroup, <?= $s->services_critical_handled; ?>
'sort' => 'service_severity' </a>
) </span>
); ?>" title="<?= $this->translate('Services CRITICAL Unhandled') ?>"> <?php endif ?>
<?= $servicegroup->services_critical_unhandled; ?> <?= $this->translate('CRITICAL', 'icinga.state') ?> <?php if ($s->services_critical_unhandled): ?>
</a> </span>
<?php endif ?> <?php endif ?>
<?php if ($servicegroup->services_critical_handled): ?> <?php if (! $s->services_critical_unhandled && !$s->services_critical_handled): ?>
<a href="<?= $this->href( <span class="no-state">
'monitoring/list/services', -
array( </span>
'service_state' => 2, <?php endif ?>
'service_handled' => 1, </td>
'servicegroup' => $servicegroup->servicegroup, <td class="state">
'sort' => 'service_severity' <?php if ($s->services_unknown_unhandled): ?>
) <span class="state unknown">
); ?>" title="<?= $this->translate('Services CRITICAL Handled') ?>"> <a href="<?= $this->href(
<?= $servicegroup->services_critical_handled . ' ' . ($servicegroup->services_critical_unhandled ? $this->translate('Acknowledged') : 'CRITICAL'); ?> 'monitoring/list/services',
</a> array(
<?php endif ?> 'service_state' => 3,
</div> 'service_acknowledged' => 0,
<!-- End of Services CRITICAL --> 'service_in_downtime' => 0,
<?php endif ?> 'host_problem' => 0,
<?php if ($servicegroup->services_warning_handled || $servicegroup->services_warning_unhandled): ?> 'servicegroup' => $s->servicegroup,
<!-- Services WARNING --> 'sort' => 'service_severity'
<div class="box entry state_warning <?= $servicegroup->services_warning_unhandled ? '' : 'handled'; ?>"> )
<?php if ($servicegroup->services_warning_unhandled): ?> ); ?>" title="<?= $this->translate('Services UNKNOWN Unhandled'); ?>">
<a href="<?= $this->href( <?= $s->services_unknown_unhandled; ?>
'monitoring/list/services', </a>
array( <?php endif ?>
'service_state' => 1, <?php if ($s->services_unknown_handled): ?>
'service_acknowledged' => 0, <span class="state unknown handled">
'service_in_downtime' => 0, <a href="<?= $this->href(
'host_problem' => 0, 'monitoring/list/services',
'servicegroup' => $servicegroup->servicegroup, array(
'sort' => 'service_severity' 'service_state' => 3,
) 'service_handled' => 1,
); ?>" title="<?= $this->translate('Services WARNING Unhandled') ?>"> 'servicegroup' => $s->servicegroup,
<?= $servicegroup->services_warning_unhandled; ?> <?= $this->translate('WARNING', 'icinga.state') ?> 'sort' => 'service_severity'
</a> )
<?php endif ?> ); ?>" title="<?= $this->translate('Services UNKNOWN Handled'); ?>">
<?php if ($servicegroup->services_warning_handled): ?> <?= $s->services_unknown_handled; ?>
<a href="<?= $this->href( </a>
'monitoring/list/services', </span>
array( <?php endif ?>
'service_state' => 1, <?php if ($s->services_unknown_unhandled): ?>
'service_handled' => 1, </span>
'servicegroup' => $servicegroup->servicegroup, <?php endif ?>
'sort' => 'service_severity' <?php if (! $s->services_unknown_unhandled && !$s->services_unknown_handled): ?>
) <span class="no-state">
); ?>" title="<?= $this->translate('Services WARNING Handled') ?>"> -
<?= $servicegroup->services_warning_handled . ' ' . ($servicegroup->services_warning_unhandled ? $this->translate('Acknowledged') : 'WARNING'); ?> </span>
</a> <?php endif ?>
<?php endif ?> </td>
</div> <td class="state">
<!-- End of Services WARNING --> <?php if ($s->services_warning_unhandled): ?>
<?php endif ?> <span class="state warning">
<?php if ($servicegroup->services_unknown_handled || $servicegroup->services_unknown_unhandled): ?> <a href="<?= $this->href(
<!-- Services UNKNOWN --> 'monitoring/list/services',
<div class="box entry state_unknown <?= $servicegroup->services_unknown_unhandled ? '' : 'handled'; ?>"> array(
<?php if ($servicegroup->services_unknown_unhandled): ?> 'service_state' => 1,
<a href="<?= $this->href( 'service_acknowledged' => 0,
'monitoring/list/services', 'service_in_downtime' => 0,
array( 'host_problem' => 0,
'service_state' => 3, 'servicegroup' => $s->servicegroup,
'service_acknowledged' => 0, 'sort' => 'service_severity'
'service_in_downtime' => 0, )
'host_problem' => 0, ); ?>" title="<?= $this->translate('Services WARNING Unhandled'); ?>">
'servicegroup' => $servicegroup->servicegroup, <?= $s->services_warning_unhandled; ?>
'sort' => 'service_severity' </a>
) <?php endif ?>
); ?>" title="<?= $this->translate('Services UNKNOWN Unhandled') ?>"> <?php if ($s->services_warning_handled): ?>
<?= $servicegroup->services_unknown_unhandled; ?> <?= $this->translate('UNKNOWN', 'icinga.state') ?> <span class="state warning handled">
</a> <a href="<?= $this->href(
<?php endif ?> 'monitoring/list/services',
<?php if ($servicegroup->services_unknown_handled): ?> array(
<a href="<?= $this->href( 'service_state' => 1,
'monitoring/list/services', 'service_handled' => 1,
array( 'servicegroup' => $s->servicegroup,
'service_state' => 3, 'sort' => 'service_severity'
'service_handled' => 1, )
'servicegroup' => $servicegroup->servicegroup, ); ?>" title="<?= $this->translate('Services WARNING Handled'); ?>">
'sort' => 'service_severity' <?= $s->services_warning_handled; ?>
) </a>
); ?>" title="<?= $this->translate('Services UNKNOWN Handled') ?>"> </span>
<?= $servicegroup->services_unknown_handled . ' ' . ($servicegroup->services_unknown_unhandled ? $this->translate('Acknowledged') : 'UNKNOWN'); ?> <?php endif ?>
</a> <?php if ($s->services_warning_unhandled): ?>
<?php endif ?> </span>
</div> <?php endif ?>
<!-- End of Services UNKNOWN --> <?php if (! $s->services_warning_unhandled && !$s->services_warning_handled): ?>
<?php endif ?> <span class="no-state">
<?php if ($servicegroup->services_ok): ?> -
<!-- Services OK --> </span>
<div class="box entry state_ok"> <?php endif ?>
<a href="<?= $this->href( </td>
'monitoring/list/services', <td class="state">
array( <?php if ($s->services_pending): ?>
'service_state' => 0, <span class="state pending">
'servicegroup' => $servicegroup->servicegroup, <a href="<?= $this->href(
'sort' => 'service_severity' 'monitoring/list/services',
) array(
); ?>" title="<?= $this->translate('Services OK') ?>"> 'service_state' => 99,
<?= $servicegroup->services_ok; ?> <?= $this->translate('OK', 'icinga.state') ?> 'servicegroup' => $s->servicegroup,
</a> 'sort' => 'service_severity'
</div> )
<!-- End of Services OK --> ); ?>" title="<?= $this->translate('Services PENDING'); ?>">
<?php endif ?> <?= $s->services_pending; ?>
<?php if ($servicegroup->services_pending): ?> </a>
<!-- Services PENDING --> </span>
<div class="box entry state_pending"> <?php else: ?>
<a href="<?= $this->href( <span class="no-state">
'monitoring/list/services', -
array( </span>
'service_state' => 99, <?php endif ?>
'servicegroup' => $servicegroup->servicegroup, </td>
'sort' => 'service_severity' </tr>
) <?php endforeach ?>
); ?>" title="<?= $this->translate('Services PENDING') ?>"> </tbody>
<?= $servicegroup->services_pending; ?> <?= $this->translate('PENDING', 'icinga.state') ?> </table>
</a>
</div>
<!-- End of Services PENDING -->
<?php endif ?>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<?php endforeach; ?>
</div>
</div> </div>

View File

@ -24,6 +24,7 @@ class GroupSummaryQuery extends IdoQuery
'hostgroup' => 'hostgroup' 'hostgroup' => 'hostgroup'
), ),
'servicestatussummary' => array( 'servicestatussummary' => array(
'services_total' => 'SUM(CASE WHEN object_type = \'service\' THEN 1 ELSE 0 END)',
'services_ok' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 THEN 1 ELSE 0 END)', 'services_ok' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 THEN 1 ELSE 0 END)',
'services_pending' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 THEN 1 ELSE 0 END)', 'services_pending' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 THEN 1 ELSE 0 END)',
'services_warning' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 THEN 1 ELSE 0 END)', 'services_warning' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 THEN 1 ELSE 0 END)',
@ -35,6 +36,14 @@ class GroupSummaryQuery extends IdoQuery
'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND acknowledged + in_downtime + host_state = 0 THEN 1 ELSE 0 END)', 'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND acknowledged + in_downtime + host_state = 0 THEN 1 ELSE 0 END)',
'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND acknowledged + in_downtime + host_state = 0 THEN 1 ELSE 0 END)', 'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND acknowledged + in_downtime + host_state = 0 THEN 1 ELSE 0 END)',
'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND acknowledged + in_downtime + host_state = 0 THEN 1 ELSE 0 END)', 'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND acknowledged + in_downtime + host_state = 0 THEN 1 ELSE 0 END)',
'services_ok_last_state_change' => 'MAX(CASE WHEN object_type = \'service\' AND state = 0 THEN state_change ELSE 0 END)',
'services_pending_last_state_change' => 'MAX(CASE WHEN object_type = \'service\' AND state = 99 THEN state_change ELSE 0 END)',
'services_warning_last_state_change_handled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 1 AND acknowledged + in_downtime + host_state > 0 THEN state_change ELSE 0 END)',
'services_critical_last_state_change_handled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 2 AND acknowledged + in_downtime + host_state > 0 THEN state_change ELSE 0 END)',
'services_unknown_last_state_change_handled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 3 AND acknowledged + in_downtime + host_state > 0 THEN state_change ELSE 0 END)',
'services_warning_last_state_change_unhandled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 1 AND acknowledged + in_downtime + host_state = 0 THEN state_change ELSE 0 END)',
'services_critical_last_state_change_unhandled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 2 AND acknowledged + in_downtime + host_state = 0 THEN state_change ELSE 0 END)',
'services_unknown_last_state_change_unhandled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 3 AND acknowledged + in_downtime + host_state = 0 THEN state_change ELSE 0 END)',
'servicegroup' => 'servicegroup' 'servicegroup' => 'servicegroup'
) )
); );
@ -57,7 +66,8 @@ class GroupSummaryQuery extends IdoQuery
$columns + array( $columns + array(
'state' => 'host_state', 'state' => 'host_state',
'acknowledged' => 'host_acknowledged', 'acknowledged' => 'host_acknowledged',
'in_downtime' => 'host_in_downtime' 'in_downtime' => 'host_in_downtime',
'state_change' => 'host_last_state_change'
) )
); );
if (in_array('servicegroup', $this->desiredColumns)) { if (in_array('servicegroup', $this->desiredColumns)) {
@ -68,7 +78,8 @@ class GroupSummaryQuery extends IdoQuery
$columns + array( $columns + array(
'state' => 'service_state', 'state' => 'service_state',
'acknowledged' => 'service_acknowledged', 'acknowledged' => 'service_acknowledged',
'in_downtime' => 'service_in_downtime' 'in_downtime' => 'service_in_downtime',
'state_change' => 'service_last_state_change'
) )
); );

View File

@ -820,3 +820,126 @@ div.timeline {
} }
/* End of monitoring timeline styles */ /* End of monitoring timeline styles */
/* Monitoring groupsummary styles */
table.groupview {
width: 100%;
margin-top: 1em;
border-collapse: separate;
border-spacing: 0.1em;
thead th {
font-size: 0.9em;
}
tbody {
tr {
&:hover {
color: #333;
}
a {
color: #333;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
td.services-total {
width: 10%;
text-align: center;
}
td.state {
width: 10%;
color: white;
text-align: center;
&.change {
width: 10%;
white-space: nowrap;
padding: 0.3em 0.5em 0.3em 0.5em;
strong {
font-size: 0.8em;
}
span.timesince {
font-size: 0.8em;
}
}
&.ok {
color: #333;
border-left-style: solid;
border-left-width: 1.5em;
border-color: @colorOk;
}
&.pending {
color: #333;
border-left-style: solid;
border-left-width: 1.5em;
border-color: @colorPending;
}
&.warning {
background-color: @colorWarning;
&.handled {
background-color: inherit;
color: #333;
border-left-style: solid;
border-left-width: 1.5em;
border-color: @colorWarningHandled;
}
}
&.unknown {
background-color: @colorUnknown;
&.handled {
color: #333;
background-color: inherit;
border-left-style: solid;
border-left-width: 1.5em;
border-color: @colorUnknownHandled;
}
}
&.critical {
background-color: @colorCritical;
&.handled {
color: #333;
background-color: inherit;
border-left-style: solid;
border-left-width: 1.5em;
border-color: @colorCriticalHandled;
}
}
span {
&.no-state {
color: #333;
}
&.state {
&.handled {
margin-right: 2px;
}
a {
color: white;
}
}
}
}
}
}
/* End of monitoring groupsummary styles */