List view script adjustments
This commit is contained in:
parent
1634fcd662
commit
20b7b4bbf7
|
@ -1,162 +1,137 @@
|
||||||
<?php
|
<?php
|
||||||
$dateHelper = $this->getHelper('DateFormat');
|
$dateHelper = $this->getHelper('DateFormat');
|
||||||
|
$commandHelper = $this->getHelper('CommandForm');
|
||||||
|
$viewHelper = $this->getHelper('MonitoringState');
|
||||||
|
|
||||||
/** @var Zend_View_Helper_CommandForm $commandHelper */
|
|
||||||
$commandHelper = $this->getHelper('CommandForm');
|
|
||||||
$viewHelper = $this->getHelper('MonitoringState');
|
|
||||||
?>
|
?>
|
||||||
|
<div class="controls">
|
||||||
<div class="row">
|
<?= $this->tabs ?>
|
||||||
<div class="pull-left">
|
<?= $this->sortControl->render($this); ?>
|
||||||
<h1>Comments</h1>
|
<?= $this->paginationControl($comments, null, null, array('preserve' => $this->preserve)); ?>
|
||||||
</div>
|
|
||||||
<div class="pull-right">
|
|
||||||
<?= $this->tabs->render($this); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single">
|
|
||||||
|
|
||||||
<div class="container pull-left">
|
<div class="content">
|
||||||
|
<table class="action">
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($comments as $comment):
|
||||||
|
|
||||||
<div class="row">
|
$objectType = ($comment->comment_objecttype_id === '1') ? 'host' : 'service';
|
||||||
<div class="col-md-12">
|
$objectName = ($objectType === 'host') ? $comment->host_name : $comment->service_name;
|
||||||
<?= $this->sortControl->render($this); ?>
|
$hrefParameters = array(
|
||||||
|
$objectType => $objectName,
|
||||||
|
'comment_id' => $comment->comment_id
|
||||||
|
);
|
||||||
|
if ($objectType === 'service') {
|
||||||
|
$hrefParameters['host'] = $comment->host_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
$detailLink = $this->href(
|
||||||
|
'monitoring/show/' . $objectType,
|
||||||
|
$hrefParameters
|
||||||
|
);
|
||||||
|
|
||||||
|
$hostLink = $this->href(
|
||||||
|
'monitoring/show/host',
|
||||||
|
array(
|
||||||
|
'host' => $comment->host_name
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<?= date('d.m. H:i', $comment->comment_timestamp); ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<?php if ($comment->comment_objecttype_id === '1'): ?>
|
||||||
|
<?= $this->img('img/icons/host.png', array('title' => 'Host comment')) ?>
|
||||||
|
<?php elseif ($comment->comment_objecttype_id === '2'): ?>
|
||||||
|
<?= $this->img('img/icons/service.png', array('title' => 'Service comment')) ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<small>
|
||||||
|
<?php
|
||||||
|
switch ($comment->comment_type) {
|
||||||
|
case 'flapping':
|
||||||
|
$icon = 'flapping';
|
||||||
|
$tooltip = 'Comment was caused by a flapping host or service.';
|
||||||
|
break;
|
||||||
|
case 'comment':
|
||||||
|
$icon = 'user';
|
||||||
|
$tooltip = 'Comment was created by an user.';
|
||||||
|
break;
|
||||||
|
case 'downtime':
|
||||||
|
$icon = 'down';
|
||||||
|
$tooltip = 'Comment was caused by a downtime.';
|
||||||
|
case 'ack':
|
||||||
|
$icon = 'acknowledgement';
|
||||||
|
$tooltip = 'Comment was caused by an acknowledgement.';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?= $this->img('img/icons/' . $icon . '.png', array('title' => $tooltip)) ?>
|
||||||
|
</small>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<a class="hidden" href="<?= $detailLink; ?>"></a>
|
||||||
|
|
||||||
|
<div rel="tooltip" title="Comment #<?=$comment->comment_id ?>">
|
||||||
|
For
|
||||||
|
<?php if ($comment->service_name): ?>
|
||||||
|
<a href="<?= $detailLink ?>">
|
||||||
|
<?= $comment->service_name ?>
|
||||||
|
on
|
||||||
|
<?= $comment->host_name; ?>
|
||||||
|
</a>
|
||||||
|
<?php else: ?>
|
||||||
|
<a href="<?= $hostLink ?>">
|
||||||
|
<?= $comment->host_name; ?>
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
by
|
||||||
|
<?= $comment->comment_author; ?>
|
||||||
|
<div class="small-row">
|
||||||
|
<?= $comment->comment_data; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<small>
|
||||||
<?= $this->paginationControl($comments, null, null, array('preserve' => $this->preserve)); ?>
|
<span>
|
||||||
</div>
|
<b>Persists: </b><?= ($comment->comment_is_persistent === '1') ? 'Yes' : 'No'; ?>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<b>Expires: </b> <?=
|
||||||
|
($comment->comment_expiration_timestamp) ?
|
||||||
|
'at ' . date('d.m H:i', $comment->comment_expiration_timestamp) :
|
||||||
|
'Never';
|
||||||
|
?>
|
||||||
|
</span>
|
||||||
|
</small>
|
||||||
|
|
||||||
<div class="row">
|
</td>
|
||||||
<?= $this->selectionToolbar('single'); ?>
|
<td>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<table class="table table-condensed pull-left">
|
|
||||||
<tbody>
|
|
||||||
<?php foreach ($comments as $comment): ?>
|
|
||||||
<?php
|
<?php
|
||||||
$objectType = ($comment->comment_objecttype_id === '1') ? 'host' : 'service';
|
$data = array(
|
||||||
$objectName = ($objectType === 'host') ? $comment->host_name : $comment->service_name;
|
'commentid' => $comment->comment_id,
|
||||||
$hrefParameters = array(
|
'host' => $comment->host_name
|
||||||
$objectType => $objectName,
|
|
||||||
'comment_id' => $comment->comment_id
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($objectType === 'service') {
|
if ($objectType === 'service') {
|
||||||
$hrefParameters['host'] = $comment->host_name;
|
$data['service'] = $comment->service_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$detailLink = $this->href(
|
echo $commandHelper->iconSubmitForm(
|
||||||
'monitoring/show/' . $objectType,
|
'img/icons/remove.png',
|
||||||
$hrefParameters
|
'Remove comment',
|
||||||
);
|
'btn-small',
|
||||||
|
'removecomment',
|
||||||
$hostLink = $this->href(
|
$data
|
||||||
'monitoring/show/host',
|
|
||||||
array(
|
|
||||||
'host' => $comment->host_name
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
<tr>
|
</td>
|
||||||
<td>
|
</div>
|
||||||
<?= date('d.m. H:i', $comment->comment_timestamp); ?>
|
</tr>
|
||||||
</td>
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
<td>
|
|
||||||
<?php if ($comment->comment_objecttype_id === '1'): ?>
|
|
||||||
<?= $this->img('img/icons/host.png', array('title' => 'Host comment')) ?>
|
|
||||||
<?php elseif ($comment->comment_objecttype_id === '2'): ?>
|
|
||||||
<?= $this->img('img/icons/service.png', array('title' => 'Service comment')) ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<small>
|
|
||||||
<?php
|
|
||||||
switch ($comment->comment_type) {
|
|
||||||
case 'flapping':
|
|
||||||
$icon = 'flapping';
|
|
||||||
$tooltip = 'Comment was caused by a flapping host or service.';
|
|
||||||
break;
|
|
||||||
case 'comment':
|
|
||||||
$icon = 'user';
|
|
||||||
$tooltip = 'Comment was created by an user.';
|
|
||||||
break;
|
|
||||||
case 'downtime':
|
|
||||||
$icon = 'down';
|
|
||||||
$tooltip = 'Comment was caused by a downtime.';
|
|
||||||
case 'ack':
|
|
||||||
$icon = 'acknowledgement';
|
|
||||||
$tooltip = 'Comment was caused by an acknowledgement.';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<?= $this->img('img/icons/' . $icon . '.png', array('title' => $tooltip)) ?>
|
|
||||||
</small>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
<a class="hidden" href="<?= $detailLink; ?>"></a>
|
|
||||||
|
|
||||||
<div rel="tooltip" title="Comment #<?=$comment->comment_id ?>">
|
|
||||||
For
|
|
||||||
<?php if ($comment->service_name): ?>
|
|
||||||
<a href="<?= $detailLink ?>">
|
|
||||||
<?= $comment->service_name ?>
|
|
||||||
on
|
|
||||||
<?= $comment->host_name; ?>
|
|
||||||
</a>
|
|
||||||
<?php else: ?>
|
|
||||||
<a href="<?= $hostLink ?>">
|
|
||||||
<?= $comment->host_name; ?>
|
|
||||||
</a>
|
|
||||||
<?php endif; ?>
|
|
||||||
by
|
|
||||||
<?= $comment->comment_author; ?>
|
|
||||||
<div class="small-row">
|
|
||||||
<?= $comment->comment_data; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<small>
|
|
||||||
<span>
|
|
||||||
<b>Persists: </b><?= ($comment->comment_is_persistent === '1') ? 'Yes' : 'No'; ?>
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
<b>Expires: </b> <?=
|
|
||||||
($comment->comment_expiration_timestamp) ?
|
|
||||||
'at ' . date('d.m H:i', $comment->comment_expiration_timestamp) :
|
|
||||||
'Never';
|
|
||||||
?>
|
|
||||||
</span>
|
|
||||||
</small>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?php
|
|
||||||
$data = array(
|
|
||||||
'commentid' => $comment->comment_id,
|
|
||||||
'host' => $comment->host_name
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($objectType === 'service') {
|
|
||||||
$data['service'] = $comment->service_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo $commandHelper->iconSubmitForm(
|
|
||||||
'icinga-icon-remove',
|
|
||||||
'Remove comment',
|
|
||||||
'btn-small',
|
|
||||||
'removecomment',
|
|
||||||
$data
|
|
||||||
);
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
</div>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<div class="container pull-left">
|
|
||||||
<?= $this->paginationControl($comments, null, null, array('preserve' => $this->preserve)); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,87 +1,59 @@
|
||||||
<?php
|
<?php
|
||||||
$commandHelper = $this->getHelper('CommandForm');
|
$helper = $this->getHelper('CommandForm');
|
||||||
?>
|
?>
|
||||||
<div class="row">
|
<div class="controls">
|
||||||
<div class="pull-left">
|
<?= $this->tabs ?>
|
||||||
<h1>Downtimes</h1>
|
<?= $this->sortControl->render($this); ?>
|
||||||
</div>
|
<?= $this->paginationControl($downtimes, null, null, array('preserve' => $this->preserve)); ?>
|
||||||
<div class="pull-right">
|
|
||||||
<?= $this->tabs->render($this); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div data-icinga-component="app/mainDetailGrid" data-icinga-grid-selection-type="single">
|
|
||||||
|
|
||||||
<div class="container pull-left">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<?= $this->sortControl->render($this); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<?= $this->paginationControl($downtimes, null, null, array('preserve' => $this->preserve)); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<?= $this->selectionToolbar('single'); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?= $this->paginationControl($downtimes, null, null, array('preserve' => $this->preserve)); ?>
|
|
||||||
<table class="table table-condensed">
|
|
||||||
<tbody>
|
|
||||||
<?php foreach ($downtimes as $downtime): ?>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<?= $this->dateFormat()->formatDateTime((int) $downtime->downtime_start); ?> -
|
|
||||||
<?= $this->dateFormat()->formatDateTime((int) $downtime->downtime_end); ?>
|
|
||||||
<br />
|
|
||||||
<small>Duration: <?= $this->util()->showHourMin((int) $downtime->downtime_duration); ?></small>
|
|
||||||
<br />
|
|
||||||
<small>The <?php if($downtime->downtime_is_flexible): ?>flexible<?php else: ?>fixed<?php endif; ?> downtime is <?php if(!$downtime->downtime_is_in_effect): ?>not <?php endif; ?>in effect</small>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?php if (isset($downtime->service)): ?>
|
|
||||||
<a href="<?= $this->href('monitoring/show/service', array(
|
|
||||||
'host' => (string) $downtime->host,
|
|
||||||
'service' => (string) $downtime->service
|
|
||||||
)); ?>"><?= $downtime->service ?></a>
|
|
||||||
<small>on <?= $downtime->host ?></small>
|
|
||||||
<?php else: ?>
|
|
||||||
<a href="<?= $this->href('monitoring/show/host', array(
|
|
||||||
'host' => (string) $downtime->host
|
|
||||||
)); ?>"><?= $downtime->host ?> </a>
|
|
||||||
<?php endif; ?>
|
|
||||||
<br />
|
|
||||||
<?= $downtime->downtime_author ?>: <?= $downtime->downtime_comment ?>
|
|
||||||
<br />
|
|
||||||
<small>Entry Time: <?= ($downtime->downtime_entry_time) ? $this->dateFormat()->formatDateTime((int) $downtime->downtime_entry_time) : ''; ?>
|
|
||||||
</small>
|
|
||||||
<td>
|
|
||||||
<?php
|
|
||||||
$data = array(
|
|
||||||
'downtimeid' => $downtime->downtime_internal_downtime_id,
|
|
||||||
'host' => $downtime->host
|
|
||||||
);
|
|
||||||
if (isset($downtime->service)) {
|
|
||||||
$data['service'] = $downtime->service;
|
|
||||||
}
|
|
||||||
echo $commandHelper->iconSubmitForm(
|
|
||||||
'icinga-icon-remove',
|
|
||||||
'Remove Downtime',
|
|
||||||
'btn-small',
|
|
||||||
'removedowntime',
|
|
||||||
$data
|
|
||||||
);
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<div class="container pull-left">
|
|
||||||
<?= $this->paginationControl($downtimes, null, null, array('preserve' => $this->preserve)); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<table class="action">
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($downtimes as $downtime): ?>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<?= $this->dateFormat()->formatDateTime((int) $downtime->downtime_start); ?> -
|
||||||
|
<?= $this->dateFormat()->formatDateTime((int) $downtime->downtime_end); ?>
|
||||||
|
<br />
|
||||||
|
<small>Duration: <?= $this->util()->showHourMin((int) $downtime->downtime_duration); ?></small>
|
||||||
|
<br />
|
||||||
|
<small>The <?php if($downtime->downtime_is_flexible): ?>flexible<?php else: ?>fixed<?php endif; ?> downtime is <?php if(!$downtime->downtime_is_in_effect): ?>not <?php endif; ?>in effect</small>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php if (isset($downtime->service)): ?>
|
||||||
|
<a href="<?= $this->href('monitoring/show/service', array(
|
||||||
|
'host' => (string) $downtime->host,
|
||||||
|
'service' => (string) $downtime->service
|
||||||
|
)); ?>"><?= $downtime->service ?></a>
|
||||||
|
<small>on <?= $downtime->host ?></small>
|
||||||
|
<?php else: ?>
|
||||||
|
<a href="<?= $this->href('monitoring/show/host', array(
|
||||||
|
'host' => (string) $downtime->host
|
||||||
|
)); ?>"><?= $downtime->host ?> </a>
|
||||||
|
<?php endif; ?>
|
||||||
|
<br />
|
||||||
|
<?= $downtime->downtime_author ?>: <?= $downtime->downtime_comment ?>
|
||||||
|
<br />
|
||||||
|
<small>Entry Time: <?= ($downtime->downtime_entry_time) ? $this->dateFormat()->formatDateTime((int) $downtime->downtime_entry_time) : ''; ?>
|
||||||
|
</small>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
$data = array(
|
||||||
|
'downtimeid' => $downtime->downtime_internal_downtime_id,
|
||||||
|
'host' => $downtime->host
|
||||||
|
);
|
||||||
|
if (isset($downtime->service)) {
|
||||||
|
$data['service'] = $downtime->service;
|
||||||
|
}
|
||||||
|
echo $helper->iconSubmitForm(
|
||||||
|
'img/icons/remove.png',
|
||||||
|
'Remove Downtime',
|
||||||
|
'btn-small',
|
||||||
|
'removedowntime',
|
||||||
|
$data
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
|
@ -1,29 +1,22 @@
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<?= $this->tabs ?>
|
<?= $this->tabs ?>
|
||||||
<?= $this->paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?>
|
|
||||||
<table class="action wide">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th style="width: 40%; padding-left: 1em;">Hosts</th>
|
|
||||||
<th style="width: 60%; padding-left: 1em;">Services</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="content">
|
||||||
<table class="action wide">
|
<div class="summary" data-base-target="col2">
|
||||||
<tbody>
|
|
||||||
<?php foreach($hostgroups as $h): ?>
|
<?php foreach($hostgroups as $h): ?>
|
||||||
<tr>
|
<span class="state">
|
||||||
<td style="width: 40%" class="summary">
|
|
||||||
<a href="<?= $this->href(
|
<table><tr><td>
|
||||||
|
<strong><a href="<?= $this->href(
|
||||||
'monitoring/list/services',
|
'monitoring/list/services',
|
||||||
array('hostgroup' => $h->hostgroup))
|
array('hostgroup' => $h->hostgroup))
|
||||||
?>"><?= $h->hostgroup; ?></a>
|
?>"><?= $h->hostgroup; ?></a></strong>
|
||||||
|
|
||||||
<?php if ($h->hosts_up): ?>
|
<?php if ($h->hosts_up): ?>
|
||||||
<!-- Hosts UP -->
|
<!-- Hosts UP -->
|
||||||
<span class="state up">
|
<span class="state up">
|
||||||
|
|
||||||
|
|
||||||
<a href="<?= $this->href(
|
<a href="<?= $this->href(
|
||||||
'monitoring/list/hosts',
|
'monitoring/list/hosts',
|
||||||
array('host_state' => 0, 'hostgroup' => $h->hostgroup)
|
array('host_state' => 0, 'hostgroup' => $h->hostgroup)
|
||||||
|
@ -75,8 +68,9 @@
|
||||||
</span>
|
</span>
|
||||||
<!-- End of hosts PENDING -->
|
<!-- End of hosts PENDING -->
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</td>
|
|
||||||
<td style="width: 60%" class="summary">
|
</td><td>
|
||||||
|
Services
|
||||||
<?php if ($h->services_ok): ?>
|
<?php if ($h->services_ok): ?>
|
||||||
<!-- Services OK -->
|
<!-- Services OK -->
|
||||||
<span class="state ok">
|
<span class="state ok">
|
||||||
|
@ -97,7 +91,8 @@
|
||||||
'monitoring/list/services',
|
'monitoring/list/services',
|
||||||
array(
|
array(
|
||||||
'service_state' => 2,
|
'service_state' => 2,
|
||||||
'hostgroup' => $h->hostgroup
|
'hostgroup' => $h->hostgroup,
|
||||||
|
'sort' => 'service_severity'
|
||||||
)) ?>" title="Services Critical"><?= $h->services_critical ?> CRITICAL: </a>
|
)) ?>" title="Services Critical"><?= $h->services_critical ?> CRITICAL: </a>
|
||||||
|
|
||||||
<?php if ($h->services_critical_unhandled): ?>
|
<?php if ($h->services_critical_unhandled): ?>
|
||||||
|
@ -106,7 +101,8 @@
|
||||||
array(
|
array(
|
||||||
'service_state' => 2,
|
'service_state' => 2,
|
||||||
'service_unhandled' => 1,
|
'service_unhandled' => 1,
|
||||||
'hostgroup' => $h->hostgroup
|
'hostgroup' => $h->hostgroup,
|
||||||
|
'sort' => 'service_severity'
|
||||||
)
|
)
|
||||||
) ?>" title="Services Critical Unhandled"><?= $h->services_critical_unhandled ?> Unhandled</a>
|
) ?>" title="Services Critical Unhandled"><?= $h->services_critical_unhandled ?> Unhandled</a>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
@ -178,8 +174,8 @@
|
||||||
) ?>" title="Services Pending"><?= $h->services_pending ?></a>
|
) ?>" title="Services Pending"><?= $h->services_pending ?></a>
|
||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</td>
|
</td></tr></table>
|
||||||
</tr>
|
</span><!-- end of services -->
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</div>
|
||||||
</table>
|
</div>
|
||||||
|
|
|
@ -1,16 +1,22 @@
|
||||||
<?php
|
<?php
|
||||||
|
$helper = $this->getHelper('MonitoringState');
|
||||||
$viewHelper = $this->getHelper('MonitoringState');
|
|
||||||
?>
|
?>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<?= $this->tabs ?>
|
<?= $this->tabs ?>
|
||||||
|
<div style="display: inline-block; margin: 1em; vertical-align: top;">
|
||||||
<?= $this->filterBox->render($this); ?>
|
<?= $this->filterBox->render($this); ?>
|
||||||
<?= $this->sortControl->render($this); ?><br />
|
</div>
|
||||||
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?>
|
<div style="display: inline-block; margin: 1em; vertical-align: top;">
|
||||||
|
<?= $this->sortControl->render($this); ?>
|
||||||
|
</div><br />
|
||||||
|
<div style="display: inline-block; margin: 1em; vertical-align: top;">
|
||||||
<?= $this->selectionToolbar('multi', $this->href('monitoring/multi/host',array( 'host' => '*' ))); ?>
|
<?= $this->selectionToolbar('multi', $this->href('monitoring/multi/host',array( 'host' => '*' ))); ?>
|
||||||
</div>
|
</div>
|
||||||
|
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)); ?>
|
||||||
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($hosts->count() === 0) {
|
if ($hosts->count() === 0) {
|
||||||
echo '<p>No host found</p>';
|
echo '<p>No host found</p>';
|
||||||
return;
|
return;
|
||||||
|
@ -18,107 +24,93 @@ if ($hosts->count() === 0) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<table class="action multiselect">
|
<table class="action multiselect">
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach($hosts as $host): ?>
|
<?php foreach($hosts as $host):
|
||||||
<?php $hostStateName = strtolower($this->util()->getHostStateName($host->host_state)); ?>
|
|
||||||
<?php $hostLink = $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>
|
|
||||||
<!--<tr> -->
|
|
||||||
<tr class="state <?= $hostStateName ?><?= $host->host_handled ? ' handled' : '' ?>">
|
|
||||||
<!-- Color column -->
|
|
||||||
<!-- <td class="tacheader-status-<?= $hostStateName; ?>">
|
|
||||||
<a style="visibility:hidden" href="<?= $hostLink; ?>"></a>
|
|
||||||
</td>
|
|
||||||
-->
|
|
||||||
<!-- Icons -->
|
|
||||||
<!-- <td>
|
|
||||||
<?php if (!$host->host_handled && $host->host_state > 0): ?>
|
|
||||||
<a href="#" title="Unhandled">
|
|
||||||
<i class="icon-table icinga-icon-unhandled"></i>
|
|
||||||
</a>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
|
$hostStateName = strtolower($this->util()->getHostStateName($host->host_state));
|
||||||
<a href="#" title="Acknowledged">
|
$hostLink = $this->href('monitoring/show/host', array('host' => $host->host_name));
|
||||||
<i class="icon-table icinga-icon-acknowledgement"></i>
|
|
||||||
</a>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ($host->host_is_flapping): ?>
|
$icons = array();
|
||||||
<a href="#" title="Flapping">
|
if (!$host->host_handled && $host->host_state > 0){
|
||||||
<i class="icon-table icinga-icon-flapping"></i>
|
$icons[] = $this->img('img/icons/unhandled.png', array(
|
||||||
</a>
|
'title' => 'Unhandled'
|
||||||
<?php endif; ?>
|
));
|
||||||
|
}
|
||||||
|
|
||||||
<?php if (!$host->host_notifications_enabled): ?>
|
if ($host->host_acknowledged && !$host->host_in_downtime) {
|
||||||
<a href="#" title="Notifications Disabled">
|
$icons[] = $this->img('img/icons/acknowledgement.png', array(
|
||||||
<i class="icon-table icinga-icon-notification-disabled"></i>
|
'title' => 'Acknowledged'
|
||||||
</a>
|
));
|
||||||
<?php endif; ?>
|
}
|
||||||
|
|
||||||
<?php if ($host->host_in_downtime): ?>
|
if ($host->host_is_flapping) {
|
||||||
<a href="#" title="In Downtime">
|
$icons[] = $this->img('img/icons/flapping.png', array(
|
||||||
<i class="icon-table icinga-icon-in-downtime"></i>
|
'title' => 'Flapping'
|
||||||
</a>
|
));
|
||||||
<?php endif; ?>
|
}
|
||||||
|
|
||||||
<?php if (!$host->host_active_checks_enabled): ?>
|
if (!$host->host_notifications_enabled) {
|
||||||
<?php if (!$host->host_passive_checks_enabled): ?>
|
$icons[] = $this->img('img/icons/notification_disabled.png', array(
|
||||||
<a href="#" title="Active And Passive Checks Disabled">
|
'title' => 'Notifications Disabled'
|
||||||
<i class="icinga-icon-active-passive-checks-disabled"></i>
|
));
|
||||||
</a>
|
}
|
||||||
<?php else: ?>
|
|
||||||
<a href="#" title="Active Checks Disabled">
|
|
||||||
<i class="icon-table icinga-icon-active-checks-disabled"></i>
|
|
||||||
</a>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if (isset($host->host_last_comment) && $host->host_last_comment !== null): ?>
|
if (!$host->host_in_downtime) {
|
||||||
<a href="#" title="Comments">
|
$icons[] = $this->img('img/icons/in_downtime.png', array(
|
||||||
<i class="icon-table icinga-icon-comment"></i>
|
'title' => 'In Downtime'
|
||||||
</a>
|
));
|
||||||
<?php endif; ?>
|
}
|
||||||
</td>
|
|
||||||
-->
|
|
||||||
<!-- State -->
|
|
||||||
<td class="state" title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
|
|
||||||
<div>
|
|
||||||
<?php if (isset($host->host_unhandled_service_count) && $host->host_unhandled_service_count > 0): ?>
|
|
||||||
<span class="badge pull-right" title="<?= $host->host_unhandled_service_count; ?> Service Problems on Host">
|
|
||||||
<a data-icinga-target="detail" href="<?= $this->href('monitoring/list/services', array('host' => $host->host_name, 'service_problem' => 1)); ?>">
|
|
||||||
<?= $host->host_unhandled_service_count; ?>
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<strong><?= ucfirst($viewHelper->monitoringState($host, 'host')); ?></strong><br />
|
if (!$host->host_active_checks_enabled) {
|
||||||
<div class="small-row">
|
if (!$host->host_passive_checks_enabled) {
|
||||||
Since <?= $this->timeSince($host->host_last_state_change); ?>
|
$icons[] = $this->img('img/icons/active_passive_checks_disabled.png', array(
|
||||||
<?php if ($host->host_state > 0): ?>
|
'title' => 'Active And Passive Checks Disabled'
|
||||||
<br />
|
));
|
||||||
<strong><?= ($host->host_state_type === '1') ? 'Hard' : 'Soft'; ?> </strong> <?= $host->host_current_check_attempt; ?>/<?= $host->host_max_check_attempts; ?>
|
} else {
|
||||||
<?php endif; ?>
|
$icons[] = $this->img('img/icons/active_checks_disabled.png', array(
|
||||||
</div>
|
'title' => 'Active Checks Disabled'
|
||||||
</div>
|
));
|
||||||
</td>
|
}
|
||||||
|
}
|
||||||
|
|
||||||
<!-- Host / Status / Output -->
|
// Not available right now:
|
||||||
<td>
|
if (isset($host->host_last_comment) && $host->host_last_comment !== null) {
|
||||||
<?php if ($host->host_icon_image) : ?>
|
$icons[] = $this->img('img/icons/comment.png', array(
|
||||||
<div class="pull-left" style="margin-right: 2px;">
|
'title' => 'Comments'
|
||||||
<i class="inline-image" style="background-image: url(<?= $this->escape($this->resolveMacros($host->host_icon_image, $host)); ?>);"></i>
|
));
|
||||||
</div>
|
}
|
||||||
<?php endif; ?>
|
?>
|
||||||
<a href="<?= $this->href('monitoring/list/services', array('host' => $host->host_name)) ?>">
|
<tr class="state <?= $hostStateName ?><?= $host->host_handled ? ' handled' : '' ?>">
|
||||||
<strong><?= $host->host_name ?></strong>
|
<!-- State -->
|
||||||
</a>
|
<td class="state" title="<?= $helper->getStateTitle($host, 'host'); ?>">
|
||||||
|
<div>
|
||||||
|
<?php if (isset($host->host_unhandled_service_count) && $host->host_unhandled_service_count > 0): ?>
|
||||||
|
<span class="badge pull-right" title="<?= $host->host_unhandled_service_count; ?> Service Problems on Host">
|
||||||
|
<a href="<?= $this->href('monitoring/list/services', array('host' => $host->host_name, 'service_problem' => 1)) ?>"><?= $host->host_unhandled_service_count; ?></a>
|
||||||
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="output-text">
|
<strong><?= ucfirst($helper->monitoringState($host, 'host')); ?></strong><br />
|
||||||
<?= $this->escape(substr(strip_tags($host->host_output), 0, 10000)); ?>
|
<div class="small-row">
|
||||||
</div>
|
Since <?= $this->timeSince($host->host_last_state_change); ?>
|
||||||
</td>
|
<?php if ($host->host_state > 0): ?>
|
||||||
</tr>
|
<br />
|
||||||
<?php endforeach; ?>
|
<strong><?= ($host->host_state_type === '1') ? 'Hard' : 'Soft'; ?> </strong> <?= $host->host_current_check_attempt; ?>/<?= $host->host_max_check_attempts; ?>
|
||||||
</tbody>
|
<?php endif ?>
|
||||||
</table>
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- Host / Status / Output -->
|
||||||
|
<td>
|
||||||
|
<?php if ($host->host_icon_image) : ?>
|
||||||
|
<?= $this->img($this->resolveMacros($host->host_icon_image, $host), array('align' => 'right')) ?>
|
||||||
|
<?php endif ?>
|
||||||
|
<a href="<?= $this->href('monitoring/list/services', array('host' => $host->host_name)) ?>"><?= $host->host_name ?></a><br />
|
||||||
|
<?= $this->escape(substr(strip_tags($host->host_output), 0, 10000)); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,7 +9,8 @@ $helper = $this->getHelper('MonitoringState');
|
||||||
<div style="display: inline-block; margin: 1em; vertical-align: top;">
|
<div style="display: inline-block; margin: 1em; vertical-align: top;">
|
||||||
<?= $this->sortControl->render($this); ?>
|
<?= $this->sortControl->render($this); ?>
|
||||||
</div><br />
|
</div><br />
|
||||||
<?= $this->selectionToolbar('multi', $this->href('monitoring/multi/service', array( 'service' => '*', 'host' => '*' ))); ?> <?= $this->paginationControl($services, null, null, array('preserve' => $this->preserve)); ?>
|
<div style="display: inline-block; margin: 1em; vertical-align: top;">
|
||||||
|
<?= $this->selectionToolbar('multi', $this->href('monitoring/multi/service', array( 'service' => '*', 'host' => '*' ))); ?></div> <?= $this->paginationControl($services, null, null, array('preserve' => $this->preserve)); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
@ -92,7 +93,7 @@ foreach ($services as $service):
|
||||||
</td>
|
</td>
|
||||||
-->
|
-->
|
||||||
<td class="state" title="<?= $helper->getStateTitle($service, 'service'); ?>">
|
<td class="state" title="<?= $helper->getStateTitle($service, 'service'); ?>">
|
||||||
<strong><?= ucfirst($helper->monitoringState($service, 'service')); ?></strong><br />
|
<strong><?= strtoupper($helper->monitoringState($service, 'service')); ?></strong><br />
|
||||||
|
|
||||||
<div class="small-row">
|
<div class="small-row">
|
||||||
Since <?= $this->timeSince($service->service_last_state_change); ?>
|
Since <?= $this->timeSince($service->service_last_state_change); ?>
|
||||||
|
@ -106,6 +107,7 @@ foreach ($services as $service):
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td title="<?= $helper->getStateTitle($service, 'host'); ?>">
|
<td title="<?= $helper->getStateTitle($service, 'host'); ?>">
|
||||||
|
<?= $this->perfdata($service->service_perfdata, true) ?>
|
||||||
<!-- <?php if ($service->service_icon_image): ?>
|
<!-- <?php if ($service->service_icon_image): ?>
|
||||||
<div class="pull-left" style="margin-right: 2px;">
|
<div class="pull-left" style="margin-right: 2px;">
|
||||||
<i class="inline-image" style="background-image: url(<?= $this->escape($this->resolveMacros($service->service_icon_image, $service)); ?>);"></i>
|
<i class="inline-image" style="background-image: url(<?= $this->escape($this->resolveMacros($service->service_icon_image, $service)); ?>);"></i>
|
||||||
|
@ -116,7 +118,7 @@ foreach ($services as $service):
|
||||||
(<?= ucfirst($helper->monitoringState($service, 'host')); ?>)
|
(<?= ucfirst($helper->monitoringState($service, 'host')); ?>)
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</a><br />
|
</a><br />
|
||||||
<?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
|
<p class="pluginoutput"><?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?></p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
Loading…
Reference in New Issue