mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
Host/Detail: List properties explicitly, not with view helper
refs #4823
This commit is contained in:
parent
b28b4ba96a
commit
408f369e45
@ -1,15 +1,93 @@
|
|||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">Properties</div>
|
||||||
<span>Properties</span>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<?php foreach ($this->monitoringProperties($object) as $label => $value): ?>
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= $label ?></th>
|
<th>Current Attempt</th>
|
||||||
<td><?= $value ?></td>
|
<td>
|
||||||
|
<?= sprintf(
|
||||||
|
'%s/%s (%s state)',
|
||||||
|
$object->current_check_attempt,
|
||||||
|
$object->max_check_attempts,
|
||||||
|
($object->state_type === '1') ? 'HARD' : 'SOFT'
|
||||||
|
); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Check Type</th>
|
||||||
|
<td>
|
||||||
|
<?php if ($object->passive_checks_enabled === '1' && $object->active_checks_enabled === '0'): ?>
|
||||||
|
PASSIVE
|
||||||
|
<?php elseif ($object->passive_checks_enabled === '0' && $object->active_checks_enabled === '0'): ?>
|
||||||
|
DISABLED
|
||||||
|
<?php else: ?>
|
||||||
|
ACTIVE
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Check Latency / Duration</th>
|
||||||
|
<td>
|
||||||
|
<?php if ($object->passive_checks_enabled === '0' && $object->active_checks_enabled === '0'): ?>
|
||||||
|
N/A
|
||||||
|
<?php else: ?>
|
||||||
|
<?= sprintf('%.4f', $object->check_latency); ?> / <?= sprintf('%.4f', $object->check_execution_time); ?> seconds
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Last Notification</th>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
if ($object->service_description) {
|
||||||
|
$notificationsHref = $this->href('monitoring/list/notifications',
|
||||||
|
array(
|
||||||
|
'host' => $object->host_name,
|
||||||
|
'service' => $object->service_description
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$notificationsHref = $this->href('monitoring/list/notifications',
|
||||||
|
array(
|
||||||
|
'host' => $object->host_name
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<a href="<?= $notificationsHref ?>">
|
||||||
|
<?php if ($object->last_notification === '0000-00-00 00:00:00'): ?>
|
||||||
|
N/A
|
||||||
|
<?php else: ?>
|
||||||
|
<?= $object->last_notification ?>
|
||||||
|
<?php if ($object->current_notification_number > 0): ?>
|
||||||
|
<br />
|
||||||
|
<?= $object->current_notification_number ?> notifications sent during current problem state
|
||||||
|
<?php endif ;?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Is This <?= $object->service_description ? 'Service' : 'Host' ?> Flapping?</th>
|
||||||
|
<td>
|
||||||
|
<?php if ($object->is_flapping === '1'): ?>
|
||||||
|
YES
|
||||||
|
<?php else: ?>
|
||||||
|
NO
|
||||||
|
<?php endif; ?>
|
||||||
|
<?= sprintf('%.2f', $object->percent_state_change); ?>% state change
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>In Scheduled Downtime?</th>
|
||||||
|
<td>
|
||||||
|
<?php if ($object->in_downtime === '1'): ?>
|
||||||
|
YES
|
||||||
|
<?php else: ?>
|
||||||
|
NO
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,7 +10,9 @@
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<h4>
|
<h4>
|
||||||
Host Status
|
Host Status
|
||||||
<?= $this->escape($this->object->host_name); ?>
|
<a href="<?= $this->href('monitoring/list/services', array('host' => $object->host_name)); ?>">
|
||||||
|
<?= $this->escape($this->object->host_name); ?>
|
||||||
|
</a>
|
||||||
<?php if ($this->object->host_address && $this->object->host_address !== $this->object->host_name): ?>
|
<?php if ($this->object->host_address && $this->object->host_address !== $this->object->host_name): ?>
|
||||||
(<?= $this->object->host_address; ?>)
|
(<?= $this->object->host_address; ?>)
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@ -53,6 +55,7 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<table>
|
<table>
|
||||||
|
<i class="successIcon"></i>
|
||||||
<tr>
|
<tr>
|
||||||
<?php if (!$object->host_handled && $object->host_state > 0): ?>
|
<?php if (!$object->host_handled && $object->host_state > 0): ?>
|
||||||
<td>
|
<td>
|
||||||
@ -101,16 +104,6 @@
|
|||||||
<td><?= $this->perfdata($this->object->perfdata); ?></td>
|
<td><?= $this->perfdata($this->object->perfdata); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<a href="<?= $this->href('monitoring/list/services', array('host' => $object->host_name)); ?>">
|
|
||||||
View Services For This Host
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a class="button" href="#">{{{RECHECK_ALL_SERVICES_COMMAND}}</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -41,7 +41,7 @@ class Host extends AbstractObject
|
|||||||
'host_address',
|
'host_address',
|
||||||
'host_state',
|
'host_state',
|
||||||
'host_handled',
|
'host_handled',
|
||||||
'host_in_downtime',
|
'in_downtime' => 'host_in_downtime',
|
||||||
'host_acknowledged',
|
'host_acknowledged',
|
||||||
'host_last_state_change',
|
'host_last_state_change',
|
||||||
'last_check' => 'host_last_check',
|
'last_check' => 'host_last_check',
|
||||||
@ -58,7 +58,13 @@ class Host extends AbstractObject
|
|||||||
'notifications_enabled' => 'host_notifications_enabled',
|
'notifications_enabled' => 'host_notifications_enabled',
|
||||||
'event_handler_enabled' => 'host_event_handler_enabled',
|
'event_handler_enabled' => 'host_event_handler_enabled',
|
||||||
'flap_detection_enabled' => 'host_flap_detection_enabled',
|
'flap_detection_enabled' => 'host_flap_detection_enabled',
|
||||||
'active_checks_enabled' => 'host_active_checks_enabled'
|
'active_checks_enabled' => 'host_active_checks_enabled',
|
||||||
|
'current_check_attempt' => 'host_current_check_attempt',
|
||||||
|
'max_check_attempts' => 'host_max_check_attempts',
|
||||||
|
'last_notification' => 'host_last_notification',
|
||||||
|
'current_notification_number' => 'host_current_notification_number',
|
||||||
|
'percent_state_change' => 'host_percent_state_change',
|
||||||
|
'is_flapping' => 'host_is_flapping'
|
||||||
))->where('host_name', $this->name1)->fetchRow();
|
))->where('host_name', $this->name1)->fetchRow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user