2014-03-08 17:02:14 +01:00
|
|
|
<?php
|
|
|
|
|
2015-03-12 13:39:17 +01:00
|
|
|
/** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
|
2014-03-08 17:02:14 +01:00
|
|
|
|
2014-09-12 16:52:45 +02:00
|
|
|
if ($object->getType() === $object::TYPE_HOST) {
|
2015-01-23 10:40:48 +01:00
|
|
|
$isService = false;
|
2014-11-18 10:29:47 +01:00
|
|
|
$checkAttempts = $object->host_current_check_attempt . '/' . $object->host_max_check_attempts;
|
|
|
|
$stateType = (int) $object->host_state_type;
|
2014-09-12 16:52:45 +02:00
|
|
|
} else {
|
2015-01-23 10:40:48 +01:00
|
|
|
$isService = true;
|
2014-11-18 10:29:47 +01:00
|
|
|
$checkAttempts = $object->service_attempt;
|
|
|
|
$stateType = (int) $object->service_state_type;
|
2014-09-12 16:52:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('Last check') ?></th>
|
|
|
|
<td data-base-target="_self">
|
2015-01-22 17:13:35 +01:00
|
|
|
<?php if (isset($checkNowForm)) { // Form is unset if the current user lacks the respective permission
|
|
|
|
echo $checkNowForm;
|
|
|
|
} ?>
|
2015-04-10 10:27:57 +02:00
|
|
|
<?= $this->timeAgo($object->last_check) ?>
|
2014-09-12 16:52:45 +02:00
|
|
|
</td>
|
2014-03-06 19:36:26 +01:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('Next check') ?></th>
|
2014-09-12 16:52:45 +02:00
|
|
|
<td>
|
2015-01-23 10:40:48 +01:00
|
|
|
<?php if ($this->hasPermission('monitoring/command/schedule-check')) {
|
|
|
|
if ($isService) {
|
2015-02-23 17:26:42 +01:00
|
|
|
echo $this->qlink(
|
2015-02-24 11:35:25 +01:00
|
|
|
$this->translate('Reschedule'),
|
2015-01-23 10:40:48 +01:00
|
|
|
'monitoring/service/reschedule-check',
|
2015-04-20 16:11:08 +02:00
|
|
|
array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
|
2015-02-23 17:26:42 +01:00
|
|
|
array(
|
2015-02-24 11:35:25 +01:00
|
|
|
'icon' => 'reschedule',
|
2015-02-23 17:26:42 +01:00
|
|
|
'data-base-target' => '_self',
|
|
|
|
'title' => $this->translate(
|
|
|
|
'Schedule the next active check at a different time than the current one'
|
|
|
|
)
|
2015-02-24 11:35:25 +01:00
|
|
|
)
|
2015-01-23 10:40:48 +01:00
|
|
|
);
|
|
|
|
} else {
|
2015-02-23 17:26:42 +01:00
|
|
|
echo $this->qlink(
|
2015-02-24 11:35:25 +01:00
|
|
|
$this->translate('Reschedule'),
|
2015-01-23 10:40:48 +01:00
|
|
|
'monitoring/host/reschedule-check',
|
2015-04-20 16:11:08 +02:00
|
|
|
array('host' => $object->getName()),
|
2015-02-23 17:26:42 +01:00
|
|
|
array(
|
2015-02-24 11:35:25 +01:00
|
|
|
'icon' => 'reschedule',
|
2015-02-23 17:26:42 +01:00
|
|
|
'data-base-target' => '_self',
|
|
|
|
'title' => $this->translate(
|
|
|
|
'Schedule the next active check at a different time than the current one'
|
|
|
|
)
|
2015-02-24 11:35:25 +01:00
|
|
|
)
|
2015-01-23 10:40:48 +01:00
|
|
|
);
|
|
|
|
}
|
2015-04-10 10:27:57 +02:00
|
|
|
} ?>
|
|
|
|
<?= $this->timeUntil($object->next_check) ?>
|
2014-09-12 16:52:45 +02:00
|
|
|
</td>
|
2014-03-06 19:36:26 +01:00
|
|
|
</tr>
|
2014-11-17 18:54:40 +01:00
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('Check attempts') ?></th>
|
2014-11-18 10:29:47 +01:00
|
|
|
<?php if ($stateType === 0): ?>
|
2015-01-23 10:41:42 +01:00
|
|
|
<td><?= $checkAttempts ?> (<?= $this->translate('soft state') ?>)</td>
|
2014-11-17 18:54:40 +01:00
|
|
|
<?php else: ?>
|
2015-01-23 10:41:42 +01:00
|
|
|
<td><?= $checkAttempts ?> (<?= $this->translate('hard state') ?>)</td>
|
2014-11-17 18:54:40 +01:00
|
|
|
<?php endif; ?>
|
|
|
|
</tr>
|
2014-03-06 19:36:26 +01:00
|
|
|
<?php if ($object->check_execution_time): ?>
|
2015-01-23 10:40:48 +01:00
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('Check execution time') ?></th>
|
2015-05-18 13:35:38 +02:00
|
|
|
<td><?= $object->check_execution_time === null
|
|
|
|
? '-' : round((float) $object->check_execution_time, 3)
|
2015-05-15 17:32:13 +02:00
|
|
|
?>s</td>
|
2015-01-23 10:40:48 +01:00
|
|
|
</tr>
|
2014-03-06 19:36:26 +01:00
|
|
|
<?php endif ?>
|
|
|
|
<?php if ($object->check_latency): ?>
|
2015-01-23 10:40:48 +01:00
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('Check latency') ?></th>
|
|
|
|
<td><?= $object->check_latency ?>s</td>
|
|
|
|
</tr>
|
2014-03-06 19:36:26 +01:00
|
|
|
<?php endif ?>
|