2015-02-02 16:26:55 +01:00
|
|
|
<?php
|
|
|
|
use Icinga\Module\Monitoring\Object\Host;
|
2017-12-06 17:43:42 +01:00
|
|
|
use Icinga\Web\Url;
|
|
|
|
|
2015-09-25 11:18:00 +02:00
|
|
|
/** @var Host $object */
|
2017-12-06 17:43:42 +01:00
|
|
|
|
|
|
|
$url = Url::fromRequest();
|
|
|
|
$linkHostName = ! ($url->getPath() === 'monitoring/host/show' && $url->getParam('host') === $object->host_name);
|
2015-02-02 16:26:55 +01:00
|
|
|
?>
|
2015-11-12 11:40:32 +01:00
|
|
|
<table class="state-table host-detail-state">
|
2015-09-25 11:18:53 +02:00
|
|
|
<tr>
|
2015-09-28 17:03:20 +02:00
|
|
|
<td class="state-col state-<?= Host::getStateText($object->host_state) ?><?= $object->host_handled ? ' handled' : '' ?>">
|
2015-10-28 11:11:03 +01:00
|
|
|
<div class="state-header"><?= Host::getStateText($object->host_state, true) ?></div>
|
2015-10-28 12:08:37 +01:00
|
|
|
<div class="state-meta">
|
|
|
|
<?= $this->timeSince($object->host_last_state_change) ?>
|
|
|
|
<?php if ((int) $object->host_state > 0 && (int) $object->host_state_type === 0): ?>
|
|
|
|
<div><?= $this->translate('Soft', 'Soft state') ?> <?= $object->host_attempt ?></div>
|
|
|
|
<?php endif ?>
|
|
|
|
</div>
|
2015-02-02 16:26:55 +01:00
|
|
|
</td>
|
|
|
|
<td>
|
2015-10-28 11:11:03 +01:00
|
|
|
<?= $this->iconImage()->host($object) ?>
|
2017-12-06 17:43:42 +01:00
|
|
|
<?php
|
|
|
|
if ($linkHostName) {
|
|
|
|
echo '<a href="' . Url::fromPath('monitoring/host/show', array('host' => $object->host_name)) . '">';
|
|
|
|
}
|
|
|
|
?>
|
2015-10-28 11:11:03 +01:00
|
|
|
<span class="selectable"><?= $this->escape($object->host_display_name) ?></span>
|
|
|
|
<?php if ($object->host_display_name !== $object->host_name): ?>
|
|
|
|
<span class="selectable host-meta">(<?= $this->escape($object->host_name) ?>)</span>
|
2016-06-01 13:12:48 +02:00
|
|
|
<?php endif ?>
|
2017-12-06 17:43:42 +01:00
|
|
|
<?php
|
|
|
|
if ($linkHostName) {
|
|
|
|
echo '</a>';
|
|
|
|
}
|
|
|
|
?>
|
2016-06-01 13:12:48 +02:00
|
|
|
<?php if ($object->host_alias !== $object->host_display_name && $object->host_alias !== $object->host_name): ?>
|
|
|
|
<div class="selectable host-meta">
|
|
|
|
<?= $this->escape($this->translate('Alias', 'host') . ': ' . $object->host_alias) ?>
|
|
|
|
</div>
|
2015-10-28 11:11:03 +01:00
|
|
|
<?php endif ?>
|
2016-11-21 10:26:35 +01:00
|
|
|
<?= $this->hostFlags($object) ?>
|
2015-10-28 11:11:03 +01:00
|
|
|
<?php if ($object->host_address6 && $object->host_address6 !== $object->host_name): ?>
|
2017-12-15 13:08:14 +01:00
|
|
|
<div class="selectable host-meta" title="<?= $this->translate('IPv6 address') ?>"><?= $this->escape($object->host_address6) ?></div>
|
2015-10-28 11:11:03 +01:00
|
|
|
<?php endif ?>
|
|
|
|
<?php if ($object->host_address && $object->host_address !== $object->host_name): ?>
|
2017-12-15 13:08:14 +01:00
|
|
|
<div class="selectable host-meta" title="<?= $this->translate('IPv4 address') ?>"><?= $this->escape($object->host_address) ?></div>
|
2015-10-28 11:11:03 +01:00
|
|
|
<?php endif ?>
|
2015-02-02 16:26:55 +01:00
|
|
|
</td>
|
|
|
|
</tr>
|
2015-04-15 15:02:27 +02:00
|
|
|
</table>
|