2015-03-06 12:31:34 +01:00
|
|
|
<?php
|
|
|
|
use Icinga\Module\Monitoring\Object\Host;
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$i = 0;
|
|
|
|
$hidden = array();
|
|
|
|
$hiddenRich = array();
|
|
|
|
?>
|
|
|
|
|
2015-04-09 13:53:05 +02:00
|
|
|
<div class="hbox-item">
|
|
|
|
<?= $this->translate('States:') ?>
|
|
|
|
<?= $hostStatesPieChart; ?>
|
|
|
|
</div>
|
|
|
|
|
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">
|
|
|
|
|
|
|
|
<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 ?>
|
|
|
|
|
2015-04-07 17:41:38 +02:00
|
|
|
<tr>
|
|
|
|
<td class="state">
|
2015-04-09 13:53:05 +02:00
|
|
|
<div <?= count($hidden) ?
|
|
|
|
'data-title-rich="<span align=\'left\'>' . join('<br>', $hiddenRich) . '</span>"' : ''; ?>
|
2015-04-07 17:41:38 +02:00
|
|
|
title="<?= join(', ', $hidden) ?>">
|
|
|
|
<?php
|
|
|
|
echo $this->qlink(
|
|
|
|
count($hidden) ? sprintf(
|
|
|
|
$this->translate('%d more ...'),
|
|
|
|
count($hidden)
|
|
|
|
) : $this->translate('list all ...'),
|
2015-03-06 18:03:56 +01:00
|
|
|
$listAllLink,
|
2015-04-07 17:41:38 +02:00
|
|
|
null,
|
|
|
|
array('data-base-target' => '_next')
|
|
|
|
);
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2015-03-06 12:31:34 +01:00
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
2015-03-05 18:32:38 +01:00
|
|
|
<?php endif ?>
|
2015-03-06 12:31:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|