2015-03-05 18:32:38 +01:00
|
|
|
<?php
|
|
|
|
use Icinga\Module\Monitoring\Object\Service;
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$i = 0;
|
|
|
|
$hidden = array();
|
|
|
|
$hiddenRich = array();
|
|
|
|
?>
|
2015-02-02 16:26:55 +01:00
|
|
|
<?php if (($serviceCount = count($objects)) > 0): ?>
|
2015-03-05 18:32:38 +01:00
|
|
|
<p>
|
|
|
|
<table class="state statesummary">
|
|
|
|
<tbody>
|
|
|
|
<?php foreach ($objects as $service): /** @var Service $service */ ?>
|
|
|
|
<?php
|
|
|
|
$i++;
|
|
|
|
if ($i > 5) {
|
2015-03-06 09:48:42 +01:00
|
|
|
$desc = $service->getName() . ' on ' . $service->getHost()->getName();
|
2015-03-05 18:32:38 +01:00
|
|
|
$hidden[] = $desc;
|
|
|
|
$hiddenRich[] = sprintf("<div class='color-box badge-%s'></div>%s", $service->getStateText($service->service_state) ,$desc);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<tr class="state <?= Service::getStateText($service->service_state); ?><?= $service->service_handled ? ' handled' : '' ?>">
|
|
|
|
<td class="state"><?= Service::getStateText($service->service_state, true); ?><br /></td>
|
2015-03-06 15:22:14 +01:00
|
|
|
|
2015-03-05 18:32:38 +01:00
|
|
|
<td>
|
2015-03-06 15:22:14 +01:00
|
|
|
|
2015-03-05 18:32:38 +01:00
|
|
|
<?php if (!$service->service_handled && $service->service_state > 0): ?>
|
|
|
|
<?= $this->icon('attention-alt', $this->translate('Unhandled')) ?>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
|
|
|
|
<?= $this->icon('ok', $this->translate('Acknowledged') . (
|
|
|
|
$service->service_last_ack ? ': ' . $service->service_last_ack : ''
|
|
|
|
)) ?>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<?php if ($service->service_is_flapping): ?>
|
|
|
|
<?= $this->icon('flapping', $this->translate('Flapping')) ?>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<?php if (!$service->service_notifications_enabled): ?>
|
|
|
|
<?= $this->icon('bell-off-empty', $this->translate('Notifications Disabled')) ?>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<?php if ($service->service_in_downtime): ?>
|
|
|
|
<?= $this->icon('plug', $this->translate('In Downtime')) ?>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<?php if (isset($service->service_last_comment) && $service->service_last_comment !== null): ?>
|
|
|
|
<?= $this->icon('comment', $this->translate('Last Comment: ') . $service->service_last_comment) ?>
|
|
|
|
<?php endif ?>
|
2015-03-06 15:22:14 +01:00
|
|
|
|
2015-03-05 18:32:38 +01:00
|
|
|
</td>
|
2015-03-06 14:49:33 +01:00
|
|
|
<td class="name oneline"><?= $this->escape($service->getName()); ?></td>
|
|
|
|
<td class="name oneline"><?= $this->escape($service->getHost()->getName()); ?></b></td>
|
|
|
|
<td><?= $this->escape($service->service_output) ?></td>
|
2015-03-05 18:32:38 +01:00
|
|
|
</tr>
|
|
|
|
<?php endforeach ?>
|
|
|
|
|
2015-04-07 17:41:38 +02:00
|
|
|
<tr>
|
2015-03-06 14:49:33 +01:00
|
|
|
<td class="state">
|
2015-04-07 17:41:38 +02:00
|
|
|
<div data-title-rich="<span align='left'><?= join('<br>', $hiddenRich) ?></span>"
|
|
|
|
title="<?= join(', ', $hidden) ?>">
|
2015-03-06 18:03:56 +01:00
|
|
|
|
2015-04-07 17:41:38 +02:00
|
|
|
<?php
|
|
|
|
echo $this->qlink(
|
|
|
|
count($hidden) ? sprintf(
|
|
|
|
$this->translate('%d more ...'),
|
|
|
|
count($hidden)
|
|
|
|
) : $this->translate('list all ...'),
|
|
|
|
$listAllLink,
|
|
|
|
null,
|
|
|
|
array('data-base-target' => '_next')
|
|
|
|
);
|
|
|
|
?>
|
|
|
|
</div>
|
2015-03-05 18:32:38 +01:00
|
|
|
</td>
|
2015-04-07 17:41:38 +02:00
|
|
|
</tr>
|
2015-03-05 18:32:38 +01:00
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</p>
|
|
|
|
<?php endif ?>
|