2015-03-06 12:31:34 +01:00
|
|
|
<?php
|
|
|
|
use Icinga\Module\Monitoring\Object\Host;
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$i = 0;
|
|
|
|
$hidden = array();
|
|
|
|
$hiddenRich = array();
|
|
|
|
?>
|
|
|
|
|
2015-02-02 16:26:55 +01:00
|
|
|
<?php if (($hostCount = count($objects)) > 0): ?>
|
2015-03-06 12:31:34 +01:00
|
|
|
|
|
|
|
<p>
|
|
|
|
<table class="state statesummary">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th></th>
|
|
|
|
<th></th>
|
2015-03-06 14:49:33 +01:00
|
|
|
<th class="oneline"><?= $this->icon('host'); ?> <?= $this->translate('Host'); ?></th>
|
|
|
|
<th class="oneline"><?= $this->icon('paste'); ?> <?= $this->translate('Plugin Output'); ?></th>
|
2015-03-06 12:31:34 +01:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<?php foreach ($objects as $host): /** @var Host $host */ ?>
|
|
|
|
<?php
|
|
|
|
$i++;
|
|
|
|
if ($i > 5) {
|
|
|
|
$desc = $host->getName();
|
|
|
|
$hidden[] = $desc;
|
|
|
|
$hiddenRich[] = sprintf("<div class='color-box badge-%s'></div>%s", $host->getStateText($host->host_state) ,$desc);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<tr class="state <?= Host::getStateText($host->host_state); ?><?= $host->host_handled ? ' handled' : '' ?>">
|
|
|
|
<td class="state"><?= Host::getStateText($host->host_state, true); ?><br /></td>
|
|
|
|
<td>
|
|
|
|
<?php if (!$host->host_handled && $host->host_state > 0): ?>
|
|
|
|
<?= $this->icon('attention-alt', $this->translate('Unhandled')) ?>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
|
|
|
|
<?= $this->icon('ok', $this->translate('Acknowledged') . (
|
|
|
|
$host->host_last_ack ? ': ' . $host->host_last_ack : ''
|
|
|
|
)) ?>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<?php if ($host->host_is_flapping): ?>
|
|
|
|
<?= $this->icon('flapping', $this->translate('Flapping')) ?>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<?php if (!$host->host_notifications_enabled): ?>
|
|
|
|
<?= $this->icon('bell-off-empty', $this->translate('Notifications Disabled')) ?>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<?php if ($host->host_in_downtime): ?>
|
|
|
|
<?= $this->icon('plug', $this->translate('In Downtime')) ?>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<?php if (isset($host->host_last_comment) && $host->host_last_comment !== null): ?>
|
|
|
|
<?= $this->icon('comment', $this->translate('Last Comment: ') . $host->host_last_comment) ?>
|
|
|
|
<?php endif ?>
|
|
|
|
</td>
|
2015-03-06 14:49:33 +01:00
|
|
|
<td class="name oneline"><?= $this->escape($host->getName()); ?></td>
|
|
|
|
<td><?= $this->escape($host->host_output) ?></td>
|
2015-03-06 12:31:34 +01:00
|
|
|
</tr>
|
|
|
|
<?php endforeach ?>
|
|
|
|
|
|
|
|
<?php if (count($hidden)): ?>
|
|
|
|
<tr>
|
2015-03-06 16:13:00 +01:00
|
|
|
<td class="state">
|
|
|
|
<div data-title-rich="<span align='left'><?= join('<br>', $hiddenRich) ?></span>"
|
2015-03-06 12:31:34 +01:00
|
|
|
title="<?= join(', ', $hidden) ?>">
|
2015-03-06 15:22:14 +01:00
|
|
|
<?= sprintf($this->translate('%d more ...'), count($hidden)) ?>
|
2015-03-06 12:31:34 +01:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
2015-03-05 18:32:38 +01:00
|
|
|
<?php endif ?>
|
2015-03-06 12:31:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|