Add yet hidden hostgroup summary w/ hostgroup overview rendered to detail

refs #4186
refs #4184
This commit is contained in:
Eric Lippmann 2013-10-15 15:12:59 +02:00
parent 2291e73c4c
commit f8938b34a4
5 changed files with 250 additions and 7 deletions

View File

@ -2,6 +2,30 @@
<div class="navbar-header">
<a href="<?= $this->baseUrl('/') ?>" class="navbar-brand icinga-logo">Icinga</a>
</div>
<div class="pull-left icinga-navbar icinga-navbar-hosts-container">
<span class="icinga-navbar-pills icinga-navbar-pills-up">999/999</span>
<span class="icinga-navbar-pills icinga-navbar-pills-unreachable">999/999</span>
<span class="icinga-navbar-pills icinga-navbar-pills-down">999/999</span>
</div>
<div class="pull-left icinga-navbar icinga-navbar-services-container">
<span class="icinga-navbar-pills icinga-navbar-pills-ok">999/999</span>
<span class="icinga-navbar-pills icinga-navbar-pills-critical">999/999</span>
<span class="icinga-navbar-pills icinga-navbar-pills-warning">999/999</span>
<span class="icinga-navbar-pills icinga-navbar-pills-unknown">999/999</span>
</div>
<div class="pull-left icinga-navbar icinga-navbar-reload">
<a class="button btn-common btn-small" href="#">
<span class="icon-refresh icon-btn-small"></span>
</a>
</div>
<div class="pull-left icinga-navbar icinga-navbar-search-container">
<input type="text" class="form-control input-sm icinga-navbar-search" />
</div>
<?php if ($this->auth()->isAuthenticated()): ?>
<ul class="nav navbar-nav pull-right" >
<!-- Remove component as of #4583 since it's not working-->

View File

@ -337,6 +337,35 @@ class Monitoring_ListController extends MonitoringController
));
}
public function hostgroupsAction()
{
$query = GroupsummaryView::fromRequest(
$this->_request,
array(
'hostgroup_name',
'cnt_hosts_up',
'cnt_hosts_unreachable',
'cnt_hosts_unreachable_unhandled',
'cnt_hosts_down',
'cnt_hosts_down_unhandled',
'cnt_hosts_pending',
'cnt_services_ok',
'cnt_services_unknown',
'cnt_services_unknown_unhandled',
'cnt_services_critical',
'cnt_services_critical_unhandled',
'cnt_services_warning',
'cnt_services_warning_unhandled',
'cnt_services_pending'
)
)->getQuery();
$this->handleFormatRequest($query);
$this->view->hostgroups = $query->paginate();
$this->setupSortControl(array(
'hostgroup_name' => 'Hostgroup Name'
));
}
/**
* Handle the 'format' and 'view' parameter
*

View File

@ -0,0 +1,34 @@
<div data-icinga-component="app/mainDetailGrid">
<?= $this->paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?>
<table class="table table-condensed">
<tbody>
<?php foreach($hostgroups as $hostgroup): ?>
<tr>
<td>
<a href="<?= $this->href('monitoring/list/services', array('hostgroups' => $hostgroup->hostgroup_name)); ?>">
<?= $hostgroup->hostgroup_name; ?>
</a>
</td>
<td>
<div>
<span><?= $hostgroup->cnt_hosts_up; ?></span>
<span><?= $hostgroup->cnt_hosts_unreachable; ?>/<?= $hostgroup->cnt_hosts_unreachable_unhandled; ?></span>
<span><?= $hostgroup->cnt_hosts_down; ?>/<?= $hostgroup->cnt_hosts_down_unhandled; ?></span>
<span><?= $hostgroup->cnt_hosts_pending; ?></span>
</div>
</td>
<td>
<div>
<span><?= $hostgroup->cnt_services_ok; ?></span>
<span><?= $hostgroup->cnt_services_unknown; ?>/<?= $hostgroup->cnt_services_unknown_unhandled; ?></span>
<span><?= $hostgroup->cnt_services_critical; ?>/<?= $hostgroup->cnt_services_critical_unhandled; ?></span>
<span><?= $hostgroup->cnt_services_warning; ?>/<?= $hostgroup->cnt_services_warning_unhandled; ?></span>
<span><?= $hostgroup->cnt_services_pending; ?></span>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?= $this->paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?>
</div>

View File

@ -77,7 +77,7 @@ class GroupsummaryQuery extends AbstractQuery
protected function joinHostgroups()
{
if ($this->hasJoinedVirtualTable('services')) {
if (in_array('servicegroup_name', $this->getColumns())){
return $this->joinServiceHostgroups();
} else {
return $this->joinHostHostgroups();
@ -96,7 +96,7 @@ class GroupsummaryQuery extends AbstractQuery
array()
)->join(
array('hgo' => $this->prefix . 'objects'),
'hgo.' . $this->object_id. ' = hg.hostgroup_object_id AND hgo.is_active = 1',
'hgo.' . $this->object_id . ' = hg.hostgroup_object_id AND hgo.is_active = 1',
array()
);
$this->baseQuery->group('hgo.name1');
@ -115,7 +115,7 @@ class GroupsummaryQuery extends AbstractQuery
array()
)->join(
array('hgo' => $this->prefix . 'objects'),
'hgo.' . $this->object_id. ' = hg.hostgroup_object_id AND hgo.is_active = 1',
'hgo.' . $this->object_id . ' = hg.hostgroup_object_id AND hgo.is_active = 1',
array()
);
return $this;

View File

@ -627,7 +627,7 @@ select.input-sm {
.nav-stacked {
#background-color: #f8f8f8;
background-color: #f8f8f8;
}
.icinga-subnavigation {
@ -641,11 +641,11 @@ select.input-sm {
padding-top: 1px;
padding-bottom: 1px;
border-bottom: 1px dotted #049baf;
#border-right: 1px dotted #049baf;
border-right: 1px dotted #049baf;
}
.nav-stacked > li:first-child {
#border-top: 1px dotted #049baf;
border-top: 1px dotted #049baf;
}
@ -654,7 +654,7 @@ select.input-sm {
padding-top: 8px;
padding-bottom: 8px;
border-bottom: 1px dotted #049baf;
#border-right: 1px dotted #049baf;
border-right: 1px dotted #049baf;
}
ul.icinga-subnavigation {
@ -809,3 +809,159 @@ ul.icinga-subnavigation {
border: 1px solid #ff3300;
}
.state-tile {
border-style: solid;
border-width: 1px;
padding: 3px 5px 3px 5px;
border-radius: 3px;
font-size: 13px;
}
.state-tile-up {
/* less */
border-style: solid;
border-width: 1px;
padding: 3px 5px 3px 5px;
border-radius: 3px;
font-size: 13px;
/* less */
border-color: #00CC33;
color: #00CC33;
}
.state-tile-unreachable {
/* less */
border-style: solid;
border-width: 1px;
padding: 3px 5px 3px 5px;
border-radius: 3px;
font-size: 13px;
/* less */
border-color: #E066FF;
color: #E066FF;
}
.state-tile-down {
/* less */
border-style: solid;
border-width: 1px;
padding: 3px 5px 3px 5px;
border-radius: 3px;
font-size: 13px;
/* less */
border-color: #FF3300;
color: #FF3300;
}
.state-tile-pending {
/* less */
border-style: solid;
border-width: 1px;
padding: 3px 5px 3px 5px;
border-radius: 3px;
font-size: 13px;
/* less */
border-color: #c0c0c0;
color: #c0c0c0;
}
.icinga-icon-user {
background-attachment: scroll;
background-clip: border-box;
background-color: rgba(0, 0, 0, 0);
background-image: url("../img/icons/user.png");
background-origin: padding-box;
background-position: center center;
background-repeat: no-repeat;
background-size: auto auto;
display: inline-block;
height: 16px;
width: 16px;
}
.icinga-navbar {
margin-right: 15px;
}
.icinga-navbar-reload {
margin-top: 13px;
margin-right: 40px;
}
.icinga-navbar-search {
background-image: url('../img/icons/search.png');
background-repeat: no-repeat;
background-position: 5px 50%;
padding-left: 25px !important;
}
.icinga-navbar-search-container {
border-left: 1px solid #ddd;
padding-left: 15px;
margin-top: 12px;
}
.icinga-navbar-hosts-container {
background-image: url('../img/icons/host.png');
background-repeat: no-repeat;
background-position: 5px 50%;
padding-left: 30px !important;
margin-top: 15px;
}
.icinga-navbar-services-container {
background-image: url('../img/icons/service.png');
background-repeat: no-repeat;
background-position: 5px 50%;
padding-left: 25px !important;
margin-top: 15px;
}
.icinga-navbar-pills {
border-style: solid;
border-width: 1px;
padding: 3px 5px 3px 5px;
border-radius: 3px;
font-size: 13px;
}
/** Service status **/
.icinga-navbar-pills-critical {
border-color: #FF3300;
color: #FF3300;
}
.icinga-navbar-pills-ok {
border-color: #00CC33;
color: #00CC33;
}
.icinga-navbar-pills-warning {
border-color: #FFA500;
color: #FFA500;
}
.icinga-navbar-pills-unknown {
border-color: #E066FF;
color: #E066FF;
}
/** Host status **/
.icinga-navbar-pills-unreachable {
border-color: #E066FF;
color: #E066FF;
}
.icinga-navbar-pills-down {
border-color: #FF3300;
color: #FF3300;
}
.icinga-navbar-pills-up {
border-color: #00CC33;
color: #00CC33;
}