Merge branch 'feature/non-collated-ido-queries-8613'

resolves #8613
This commit is contained in:
Johannes Meyer 2015-04-13 15:55:53 +02:00
commit 46296dce95
67 changed files with 432 additions and 380 deletions

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
<a href="/monitoring/host/show?host=localhost" <a href="/monitoring/host/show?host_name=localhost"
title="Show detailed information about the host localhost" title="Show detailed information about the host localhost"
aria-label="Show detailed information about the host localhost">localhost</a> aria-label="Show detailed information about the host localhost">localhost</a>
</body> </body>

View File

@ -183,10 +183,10 @@ class FilterEditor extends AbstractWidget
// TODO: Ask the view for (multiple) search columns // TODO: Ask the view for (multiple) search columns
switch($request->getActionName()) { switch($request->getActionName()) {
case 'services': case 'services':
$searchCol = 'service_description'; $searchCol = 'service';
break; break;
case 'hosts': case 'hosts':
$searchCol = 'host_name'; $searchCol = 'host';
break; break;
case 'hostgroups': case 'hostgroups':
$searchCol = 'hostgroup'; $searchCol = 'hostgroup';

View File

@ -59,12 +59,12 @@ class Monitoring_AlertsummaryController extends Controller
$query = $this->backend->select()->from( $query = $this->backend->select()->from(
'notification', 'notification',
array( array(
'host', 'host_name',
'host_display_name', 'host_display_name',
'service', 'service_description',
'service_display_name', 'service_display_name',
'notification_output', 'notification_output',
'notification_contact', 'notification_contact_name',
'notification_start_time', 'notification_start_time',
'notification_state' 'notification_state'
) )
@ -85,12 +85,7 @@ class Monitoring_AlertsummaryController extends Controller
$query = $this->backend->select()->from( $query = $this->backend->select()->from(
'notification', 'notification',
array( array(
'host', 'notification_start_time'
'service',
'notification_output',
'notification_contact',
'notification_start_time',
'notification_state'
) )
); );
@ -138,12 +133,7 @@ class Monitoring_AlertsummaryController extends Controller
$query = $this->backend->select()->from( $query = $this->backend->select()->from(
'notification', 'notification',
array( array(
'host', 'notification_start_time'
'service',
'notification_output',
'notification_contact',
'notification_start_time',
'notification_state'
) )
); );
@ -210,12 +200,7 @@ class Monitoring_AlertsummaryController extends Controller
$query = $this->backend->select()->from( $query = $this->backend->select()->from(
'notification', 'notification',
array( array(
'host', 'notification_start_time'
'service',
'notification_output',
'notification_contact',
'notification_start_time',
'notification_state'
) )
); );
@ -263,20 +248,9 @@ class Monitoring_AlertsummaryController extends Controller
$interval = $this->getInterval(); $interval = $this->getInterval();
$query = $this->backend->select()->from( $query = $this->backend->select()->from(
'EventHistory', 'eventHistory',
array( array(
'host_name', 'timestamp'
'service_description',
'object_type',
'timestamp',
'state',
'attempt',
'max_attempts',
'output',
'type',
'host',
'service',
'service_host_name'
) )
); );
@ -338,11 +312,7 @@ class Monitoring_AlertsummaryController extends Controller
$query = $this->backend->select()->from( $query = $this->backend->select()->from(
'notification', 'notification',
array( array(
'host',
'service',
'notification_object_id', 'notification_object_id',
'notification_output',
'notification_contact',
'notification_start_time', 'notification_start_time',
'notification_state', 'notification_state',
'acknowledgement_entry_time' 'acknowledgement_entry_time'
@ -507,12 +477,12 @@ class Monitoring_AlertsummaryController extends Controller
$query = $this->backend->select()->from( $query = $this->backend->select()->from(
'notification', 'notification',
array( array(
'host', 'host_name',
'host_display_name', 'host_display_name',
'service', 'service_description',
'service_display_name', 'service_display_name',
'notification_output', 'notification_output',
'notification_contact', 'notification_contact_name',
'notification_start_time', 'notification_start_time',
'notification_state' 'notification_state'
) )

View File

@ -26,7 +26,7 @@ class Monitoring_HostController extends MonitoredObjectController
*/ */
public function init() public function init()
{ {
$host = new Host($this->backend, $this->params->get('host')); $host = new Host($this->backend, $this->params->get('host_name'));
$this->applyRestriction('monitoring/hosts/filter', $host); $this->applyRestriction('monitoring/hosts/filter', $host);

View File

@ -123,7 +123,7 @@ class Monitoring_HostsController extends Controller
} }
if ((bool) $host->in_downtime === true) { if ((bool) $host->in_downtime === true) {
$objectsInDowntime[] = $host; $objectsInDowntime[] = $host;
$downtimeFilterExpressions[] = Filter::where('downtime_host', $host->getName()); $downtimeFilterExpressions[] = Filter::where('host_name', $host->getName());
} }
++$hostStates[$host::getStateText($host->state)]; ++$hostStates[$host::getStateText($host->state)];
} }

View File

@ -169,11 +169,9 @@ class Monitoring_ListController extends Controller
$this->addTitleTab('services', $this->translate('Services'), $this->translate('List services')); $this->addTitleTab('services', $this->translate('Services'), $this->translate('List services'));
$this->view->showHost = true; $this->view->showHost = true;
if ($host = $this->_getParam('host')) { if (strpos($this->params->get('host_name', '*'), '*') === false) {
if (strpos($host, '*') === false) {
$this->view->showHost = false; $this->view->showHost = false;
} }
}
$this->setAutorefreshInterval(10); $this->setAutorefreshInterval(10);
$columns = array_merge(array( $columns = array_merge(array(
@ -271,7 +269,7 @@ class Monitoring_ListController extends Controller
'id' => 'downtime_internal_id', 'id' => 'downtime_internal_id',
'objecttype' => 'downtime_objecttype', 'objecttype' => 'downtime_objecttype',
'comment' => 'downtime_comment', 'comment' => 'downtime_comment',
'author' => 'downtime_author', 'author_name' => 'downtime_author_name',
'start' => 'downtime_start', 'start' => 'downtime_start',
'scheduled_start' => 'downtime_scheduled_start', 'scheduled_start' => 'downtime_scheduled_start',
'scheduled_end' => 'downtime_scheduled_end', 'scheduled_end' => 'downtime_scheduled_end',
@ -281,10 +279,10 @@ class Monitoring_ListController extends Controller
'is_fixed' => 'downtime_is_fixed', 'is_fixed' => 'downtime_is_fixed',
'is_in_effect' => 'downtime_is_in_effect', 'is_in_effect' => 'downtime_is_in_effect',
'entry_time' => 'downtime_entry_time', 'entry_time' => 'downtime_entry_time',
'host' => 'host_name',
'service' => 'service_description',
'host_state' => 'downtime_host_state', 'host_state' => 'downtime_host_state',
'service_state' => 'downtime_service_state', 'service_state' => 'downtime_service_state',
'host_name',
'service_description',
'host_display_name', 'host_display_name',
'service_display_name' 'service_display_name'
)); ));
@ -326,10 +324,10 @@ class Monitoring_ListController extends Controller
); );
$this->setAutorefreshInterval(15); $this->setAutorefreshInterval(15);
$query = $this->backend->select()->from('notification', array( $query = $this->backend->select()->from('notification', array(
'host', 'host_name',
'service', 'service_description',
'notification_output', 'notification_output',
'notification_contact', 'notification_contact_name',
'notification_start_time', 'notification_start_time',
'notification_state', 'notification_state',
'host_display_name', 'host_display_name',
@ -470,13 +468,13 @@ class Monitoring_ListController extends Controller
'id' => 'comment_internal_id', 'id' => 'comment_internal_id',
'objecttype' => 'comment_objecttype', 'objecttype' => 'comment_objecttype',
'comment' => 'comment_data', 'comment' => 'comment_data',
'author' => 'comment_author', 'author' => 'comment_author_name',
'timestamp' => 'comment_timestamp', 'timestamp' => 'comment_timestamp',
'type' => 'comment_type', 'type' => 'comment_type',
'persistent' => 'comment_is_persistent', 'persistent' => 'comment_is_persistent',
'expiration' => 'comment_expiration', 'expiration' => 'comment_expiration',
'host' => 'comment_host', 'host_name',
'service' => 'comment_service', 'service_description',
'host_display_name', 'host_display_name',
'service_display_name' 'service_display_name'
)); ));
@ -510,7 +508,7 @@ class Monitoring_ListController extends Controller
); );
$this->setAutorefreshInterval(12); $this->setAutorefreshInterval(12);
$query = $this->backend->select()->from('groupsummary', array( $query = $this->backend->select()->from('groupsummary', array(
'servicegroup', 'servicegroup_name',
'servicegroup_alias', 'servicegroup_alias',
'hosts_up', 'hosts_up',
'hosts_unreachable_handled', 'hosts_unreachable_handled',
@ -560,7 +558,7 @@ class Monitoring_ListController extends Controller
$this->addTitleTab('hostgroups', $this->translate('Host Groups'), $this->translate('List host groups')); $this->addTitleTab('hostgroups', $this->translate('Host Groups'), $this->translate('List host groups'));
$this->setAutorefreshInterval(12); $this->setAutorefreshInterval(12);
$query = $this->backend->select()->from('groupsummary', array( $query = $this->backend->select()->from('groupsummary', array(
'hostgroup', 'hostgroup_name',
'hostgroup_alias', 'hostgroup_alias',
'hosts_up', 'hosts_up',
'hosts_unreachable_handled', 'hosts_unreachable_handled',
@ -624,9 +622,7 @@ class Monitoring_ListController extends Controller
'attempt', 'attempt',
'max_attempts', 'max_attempts',
'output', 'output',
'type', 'type'
'host',
'service'
)); ));
$this->filterQuery($query); $this->filterQuery($query);

View File

@ -25,7 +25,11 @@ class Monitoring_ServiceController extends MonitoredObjectController
*/ */
public function init() public function init()
{ {
$service = new Service($this->backend, $this->params->get('host'), $this->params->get('service')); $service = new Service(
$this->backend,
$this->params->get('host_name'),
$this->params->get('service_description')
);
$this->applyRestriction('monitoring/services/filter', $service); $this->applyRestriction('monitoring/services/filter', $service);

View File

@ -158,8 +158,8 @@ class Monitoring_ServicesController extends Controller
if ((bool) $service->in_downtime === true) { if ((bool) $service->in_downtime === true) {
$objectsInDowntime[] = $service; $objectsInDowntime[] = $service;
$downtimeFilterExpressions[] = Filter::matchAll( $downtimeFilterExpressions[] = Filter::matchAll(
Filter::where('downtime_host', $service->getHost()->getName()), Filter::where('host_name', $service->getHost()->getName()),
Filter::where('downtime_service', $service->getName()) Filter::where('service_description', $service->getName())
); );
} }
++$serviceStates[$service::getStateText($service->state)]; ++$serviceStates[$service::getStateText($service->state)];

View File

@ -1,7 +1,6 @@
<?php <?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ /* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
use Icinga\Application\Benchmark;
use Icinga\Module\Monitoring\Object\MonitoredObject; use Icinga\Module\Monitoring\Object\MonitoredObject;
use Icinga\Web\Hook; use Icinga\Web\Hook;
use Icinga\Web\Url; use Icinga\Web\Url;
@ -10,8 +9,6 @@ use Icinga\Web\Widget\Tabextension\OutputFormat;
use Icinga\Web\Widget\Tabextension\DashboardAction; use Icinga\Web\Widget\Tabextension\DashboardAction;
use Icinga\Module\Monitoring\Backend; use Icinga\Module\Monitoring\Backend;
use Icinga\Module\Monitoring\Controller; use Icinga\Module\Monitoring\Controller;
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
/** /**
* Class Monitoring_ShowController * Class Monitoring_ShowController
@ -115,11 +112,11 @@ class Monitoring_ShowController extends Controller
public function contactAction() public function contactAction()
{ {
$contactName = $this->getParam('contact'); $contactName = $this->getParam('contact_name');
if (! $contactName) { if (! $contactName) {
throw new Zend_Controller_Action_Exception( throw new Zend_Controller_Action_Exception(
$this->translate('The parameter `contact\' is required'), $this->translate('The parameter `contact_name\' is required'),
404 404
); );
} }
@ -159,10 +156,10 @@ class Monitoring_ShowController extends Controller
$this->view->commands = $commands->paginate(); $this->view->commands = $commands->paginate();
$notifications = $this->backend->select()->from('notification', array( $notifications = $this->backend->select()->from('notification', array(
'host', 'host_name',
'service', 'service_description',
'notification_output', 'notification_output',
'notification_contact', 'notification_contact_name',
'notification_start_time', 'notification_start_time',
'notification_state', 'notification_state',
'host_display_name', 'host_display_name',
@ -191,13 +188,13 @@ class Monitoring_ShowController extends Controller
if ($object->getType() === $object::TYPE_HOST) { if ($object->getType() === $object::TYPE_HOST) {
$isService = false; $isService = false;
$params = array( $params = array(
'host' => $object->getName() 'host_name' => $object->getName()
); );
} else { } else {
$isService = true; $isService = true;
$params = array( $params = array(
'host' => $object->getHost()->getName(), 'host_name' => $object->getHost()->getName(),
'service' => $object->getName() 'service_description' => $object->getName()
); );
} }
$tabs = $this->getTabs(); $tabs = $this->getTabs();
@ -210,7 +207,7 @@ class Monitoring_ShowController extends Controller
), ),
'label' => $this->translate('Host'), 'label' => $this->translate('Host'),
'icon' => 'host', 'icon' => 'host',
'url' => 'monitoring/show/host', 'url' => 'monitoring/host/show',
'urlParams' => $params, 'urlParams' => $params,
) )
); );
@ -225,7 +222,7 @@ class Monitoring_ShowController extends Controller
), ),
'label' => $this->translate('Service'), 'label' => $this->translate('Service'),
'icon' => 'service', 'icon' => 'service',
'url' => 'monitoring/show/service', 'url' => 'monitoring/service/show',
'urlParams' => $params, 'urlParams' => $params,
) )
); );

View File

@ -33,7 +33,7 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract
return $this->view->qlink( return $this->view->qlink(
$linkText, $linkText,
'monitoring/host/show', 'monitoring/host/show',
array('host' => $host), array('host_name' => $host),
array('title' => sprintf($this->view->translate('Show detailed information for host %s'), $host)) array('title' => sprintf($this->view->translate('Show detailed information for host %s'), $host))
); );
} }
@ -55,7 +55,7 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract
$this->view->qlink( $this->view->qlink(
$serviceLinkText, $serviceLinkText,
'monitoring/service/show', 'monitoring/service/show',
array('host' => $host, 'service' => $service), array('host_name' => $host, 'service_description' => $service),
array('title' => sprintf( array('title' => sprintf(
$this->view->translate('Show detailed information for service %s on host %s'), $this->view->translate('Show detailed information for service %s on host %s'),
$service, $service,

View File

@ -65,7 +65,7 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
parse_str($m[1], $params); parse_str($m[1], $params);
if (isset($params['host'])) { if (isset($params['host'])) {
$tag->setAttribute('href', $this->view->baseUrl( $tag->setAttribute('href', $this->view->baseUrl(
'/monitoring/host/show?host=' . urlencode($params['host'] '/monitoring/host/show?host_name=' . urlencode($params['host']
))); )));
} }
} else { } else {

View File

@ -52,11 +52,14 @@
<?php if ($comment->objecttype === 'service'): ?> <?php if ($comment->objecttype === 'service'): ?>
<?= $this->icon('service', $this->translate('Service')); ?> <?= $this->icon('service', $this->translate('Service')); ?>
<?= $this->link()->service( <?= $this->link()->service(
$comment->service, $comment->service_display_name, $comment->host, $comment->host_display_name $comment->service_description,
) ?> $comment->service_display_name,
$comment->host_name,
$comment->host_display_name
); ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('host', $this->translate('Host')); ?> <?= $this->icon('host', $this->translate('Host')); ?>
<?= $this->link()->host($comment->host, $comment->host_display_name) ?> <?= $this->link()->host($comment->host_name, $comment->host_display_name); ?>
<?php endif ?> <?php endif ?>
<br> <br>
<?= $this->icon('comment', $this->translate('Comment')); ?> <?= isset($comment->author) <?= $this->icon('comment', $this->translate('Comment')); ?> <?= isset($comment->author)
@ -81,9 +84,14 @@
$delCommentForm = clone $delCommentForm; $delCommentForm = clone $delCommentForm;
$delCommentForm->populate(array('comment_id' => $comment->id, 'redirect' => $this->url)); $delCommentForm->populate(array('comment_id' => $comment->id, 'redirect' => $this->url));
if ($comment->objecttype === 'host') { if ($comment->objecttype === 'host') {
$delCommentForm->setAction($this->url('monitoring/host/delete-comment', array('host' => $comment->host))); $delCommentForm->setAction(
$this->url('monitoring/host/delete-comment', array('host_name' => $comment->host_name))
);
} else { } else {
$delCommentForm->setAction($this->url('monitoring/service/delete-comment', array('host' => $comment->host, 'service' => $comment->service))); $delCommentForm->setAction($this->url('monitoring/service/delete-comment', array(
'host_name' => $comment->host_name,
'service_description' => $comment->service_description
)));
} }
echo $delCommentForm; echo $delCommentForm;
?> ?>

View File

@ -24,7 +24,7 @@ foreach ($groupData as $groupName => $groupInfo): ?>
<?= $this->qlink( <?= $this->qlink(
$c->contact_alias, $c->contact_alias,
'monitoring/show/contact', 'monitoring/show/contact',
array('contact' => $c->contact_name), array('contact_name' => $c->contact_name),
array('title' => sprintf( array('title' => sprintf(
$this->translate('Show detailed information about %s'), $this->translate('Show detailed information about %s'),
$c->contact_alias $c->contact_alias

View File

@ -18,7 +18,7 @@
<strong><?= $this->qlink( <strong><?= $this->qlink(
$contact->contact_name, $contact->contact_name,
'monitoring/show/contact', 'monitoring/show/contact',
array('contact' => $contact->contact_name), array('contact_name' => $contact->contact_name),
array('title' => sprintf( array('title' => sprintf(
$this->translate('Show detailed information about %s'), $this->translate('Show detailed information about %s'),
$contact->contact_alias $contact->contact_alias

View File

@ -30,7 +30,7 @@ use Icinga\Module\Monitoring\Object\Service;
<tbody> <tbody>
<?php foreach ($downtimes as $downtime): ?> <?php foreach ($downtimes as $downtime): ?>
<?php <?php
if (isset($downtime->service)) { if (isset($downtime->service_description)) {
$isService = true; $isService = true;
$stateName = Service::getStateText($downtime->service_state); $stateName = Service::getStateText($downtime->service_state);
} else { } else {
@ -57,20 +57,20 @@ use Icinga\Module\Monitoring\Object\Service;
<?php if ($isService): ?> <?php if ($isService): ?>
<?= $this->icon('service', $this->translate('Service')); ?> <?= $this->icon('service', $this->translate('Service')); ?>
<?= $this->link()->service( <?= $this->link()->service(
$downtime->service, $downtime->service_display_name, $downtime->host, $downtime->host_display_name $downtime->service_description, $downtime->service_display_name, $downtime->host_name, $downtime->host_display_name
) ?> ) ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('host', $this->translate('Host')); ?> <?= $this->icon('host', $this->translate('Host')); ?>
<?= $this->link()->host($downtime->host, $downtime->host_display_name) ?> <?= $this->link()->host($downtime->host_name, $downtime->host_display_name) ?>
<?php endif ?> <?php endif ?>
<br> <br>
<?= $this->icon('comment', $this->translate('Comment')); ?> [<?= $this->escape($downtime->author) ?>] <?= $this->escape($downtime->comment) ?> <?= $this->icon('comment', $this->translate('Comment')); ?> [<?= $this->escape($downtime->author_name) ?>] <?= $this->escape($downtime->comment) ?>
<br> <br>
<small> <small>
<?php if ($downtime->is_flexible): ?> <?php if ($downtime->is_flexible): ?>
<?php if ($downtime->is_in_effect): ?> <?php if ($downtime->is_in_effect): ?>
<?= sprintf( <?= sprintf(
isset($downtime->service) $isService
? $this->translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.') ? $this->translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.')
: $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'), : $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'),
date('d.m.y', $downtime->start), date('d.m.y', $downtime->start),
@ -81,7 +81,7 @@ use Icinga\Module\Monitoring\Object\Service;
); ?> ); ?>
<?php else: ?> <?php else: ?>
<?= sprintf( <?= sprintf(
isset($downtime->service) $isService
? $this->translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.') ? $this->translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.')
: $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'), : $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'),
date('d.m.y H:i', $downtime->scheduled_start), date('d.m.y H:i', $downtime->scheduled_start),
@ -92,7 +92,7 @@ use Icinga\Module\Monitoring\Object\Service;
<?php else: ?> <?php else: ?>
<?php if ($downtime->is_in_effect): ?> <?php if ($downtime->is_in_effect): ?>
<?= sprintf( <?= sprintf(
isset($downtime->service) $isService
? $this->translate('This fixed service downtime was started on %s at %s and expires on %s at %s.') ? $this->translate('This fixed service downtime was started on %s at %s and expires on %s at %s.')
: $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'), : $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'),
date('d.m.y', $downtime->start), date('d.m.y', $downtime->start),
@ -102,7 +102,7 @@ use Icinga\Module\Monitoring\Object\Service;
); ?> ); ?>
<?php else: ?> <?php else: ?>
<?= sprintf( <?= sprintf(
isset($downtime->service) $isService
? $this->translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.') ? $this->translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.')
: $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'), : $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'),
date('d.m.y', $downtime->scheduled_start), date('d.m.y', $downtime->scheduled_start),
@ -119,10 +119,13 @@ use Icinga\Module\Monitoring\Object\Service;
<?php <?php
$delDowntimeForm = clone $delDowntimeForm; $delDowntimeForm = clone $delDowntimeForm;
$delDowntimeForm->populate(array('downtime_id' => $downtime->id, 'redirect' => $this->url)); $delDowntimeForm->populate(array('downtime_id' => $downtime->id, 'redirect' => $this->url));
if (! isset($downtime->service)) { if (! $isService) {
$delDowntimeForm->setAction($this->url('monitoring/host/delete-downtime', array('host' => $downtime->host))); $delDowntimeForm->setAction($this->url('monitoring/host/delete-downtime', array('host_name' => $downtime->host_name)));
} else { } else {
$delDowntimeForm->setAction($this->url('monitoring/service/delete-downtime', array('host' => $downtime->host, 'service' => $downtime->service))); $delDowntimeForm->setAction($this->url('monitoring/service/delete-downtime', array(
'host_name' => $downtime->host_name,
'service_description' => $downtime->service_description
)));
} }
echo $delDowntimeForm; echo $delDowntimeForm;
?> ?>

View File

@ -22,7 +22,7 @@ use Icinga\Module\Monitoring\Object\Service;
<div class="content"> <div class="content">
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
<?php if (empty($history)): ?> <?php if (count($history) === 0): ?>
<?= $this->translate('No history events matching the filter') ?> <?= $this->translate('No history events matching the filter') ?>
</div> </div>
<?php return; endif ?> <?php return; endif ?>
@ -34,7 +34,7 @@ use Icinga\Module\Monitoring\Object\Service;
$icon = 'help'; $icon = 'help';
$title = $event->type; $title = $event->type;
$stateName = 'invalid'; $stateName = 'invalid';
$isService = isset($event->service); $isService = isset($event->service_description);
switch ($event->type) { switch ($event->type) {
case 'notify': case 'notify':
$icon = 'bell'; $icon = 'bell';
@ -99,10 +99,10 @@ use Icinga\Module\Monitoring\Object\Service;
<td> <td>
<?php if ($isService): ?> <?php if ($isService): ?>
<?= $this->link()->service( <?= $this->link()->service(
$event->service, $event->service_display_name, $event->host, $event->host_display_name $event->service_description, $event->service_display_name, $event->host_name, $event->host_display_name
) ?> ) ?>
<?php else: ?> <?php else: ?>
<?= $this->link()->host($event->host, $event->host_display_name) ?> <?= $this->link()->host($event->host_name, $event->host_display_name) ?>
<?php endif ?> <?php endif ?>
<br> <br>
<div> <div>

View File

@ -28,7 +28,7 @@
</thead> </thead>
<tbody> <tbody>
<?php foreach ($hostgroups as $h): ?> <?php foreach ($hostgroups as $h): ?>
<tr href="<?= $this->href('monitoring/list/hosts', array('hostgroup' => $h->hostgroup)) ?>"> <tr href="<?= $this->href('monitoring/list/hosts', array('hostgroup_name' => $h->hostgroup_name)) ?>">
<?php if ($h->services_critical_last_state_change_unhandled): ?> <?php if ($h->services_critical_last_state_change_unhandled): ?>
<td class="state change critical unhandled"> <td class="state change critical unhandled">
<strong><?= $this->translate('CRITICAL'); ?></strong> <strong><?= $this->translate('CRITICAL'); ?></strong>
@ -82,7 +82,7 @@
<?= $this->qlink( <?= $this->qlink(
$h->hostgroup_alias, $h->hostgroup_alias,
'monitoring/list/hosts', 'monitoring/list/hosts',
array('hostgroup' => $h->hostgroup), array('hostgroup_name' => $h->hostgroup_name),
array('title' => sprintf($this->translate('List all hosts in the group "%s"'), $h->hostgroup_alias)) array('title' => sprintf($this->translate('List all hosts in the group "%s"'), $h->hostgroup_alias))
); ?> ); ?>
</td> </td>
@ -90,7 +90,7 @@
<?= $this->qlink( <?= $this->qlink(
$h->services_total, $h->services_total,
'monitoring/list/services', 'monitoring/list/services',
array('hostgroup' => $h->hostgroup), array('hostgroup_name' => $h->hostgroup_name),
array('title' => sprintf( array('title' => sprintf(
$this->translate('List all services of all hosts in host group "%s"'), $this->translate('List all services of all hosts in host group "%s"'),
$h->hostgroup_alias $h->hostgroup_alias
@ -105,7 +105,7 @@
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 0, 'service_state' => 0,
'hostgroup' => $h->hostgroup, 'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -132,7 +132,7 @@
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'hostgroup' => $h->hostgroup, 'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -156,7 +156,7 @@
array( array(
'service_state' => 2, 'service_state' => 2,
'service_handled' => 1, 'service_handled' => 1,
'hostgroup' => $h->hostgroup, 'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -186,7 +186,7 @@
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'hostgroup' => $h->hostgroup, 'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -210,7 +210,7 @@
array( array(
'service_state' => 3, 'service_state' => 3,
'service_handled' => 1, 'service_handled' => 1,
'hostgroup' => $h->hostgroup, 'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -240,7 +240,7 @@
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'hostgroup' => $h->hostgroup, 'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -264,7 +264,7 @@
array( array(
'service_state' => 1, 'service_state' => 1,
'service_handled' => 1, 'service_handled' => 1,
'hostgroup' => $h->hostgroup, 'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -291,7 +291,7 @@
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 99, 'service_state' => 99,
'hostgroup' => $h->hostgroup, 'hostgroup_name' => $h->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(

View File

@ -36,13 +36,13 @@ if ($hosts->count() === 0) {
data-base-target="_next" data-base-target="_next"
class="action multiselect" class="action multiselect"
data-icinga-multiselect-url="<?= $this->href('monitoring/hosts/show') ?>" data-icinga-multiselect-url="<?= $this->href('monitoring/hosts/show') ?>"
data-icinga-multiselect-data="host" data-icinga-multiselect-data="host_name"
> >
<tbody> <tbody>
<?php foreach($hosts as $host): <?php foreach($hosts as $host):
$hostStateName = Host::getStateText($host->host_state); $hostStateName = Host::getStateText($host->host_state);
$hostLink = $this->href('monitoring/host/show', array('host' => $host->host_name)); $hostLink = $this->href('monitoring/host/show', array('host_name' => $host->host_name));
$icons = array(); $icons = array();
if (! $host->host_handled && $host->host_state > 0){ if (! $host->host_handled && $host->host_state > 0){
@ -112,7 +112,7 @@ if ($hosts->count() === 0) {
), ),
'monitoring/show/services', 'monitoring/show/services',
array( array(
'host' => $host->host_name, 'host_name' => $host->host_name,
'service_problem' => 1, 'service_problem' => 1,
'service_handled' => 0 'service_handled' => 0
), ),

View File

@ -24,7 +24,7 @@ use Icinga\Module\Monitoring\Object\Service;
<table data-base-target="_next" class="action"> <table data-base-target="_next" class="action">
<tbody> <tbody>
<?php foreach ($notifications as $notification): <?php foreach ($notifications as $notification):
if (isset($notification->service)) { if (isset($notification->service_description)) {
$isService = true; $isService = true;
$stateName = Service::getStateText($notification->notification_state); $stateName = Service::getStateText($notification->notification_state);
} else { } else {
@ -44,14 +44,14 @@ use Icinga\Module\Monitoring\Object\Service;
<?php if ($isService): ?> <?php if ($isService): ?>
<?= $this->icon('service', $this->translate('Service')); ?> <?= $this->icon('service', $this->translate('Service')); ?>
<?= $this->link()->service( <?= $this->link()->service(
$notification->service, $notification->service_description,
$notification->service_display_name, $notification->service_display_name,
$notification->host, $notification->host_name,
$notification->host_display_name $notification->host_display_name
) ?> ) ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('host', $this->translate('Host')); ?> <?= $this->icon('host', $this->translate('Host')); ?>
<?= $this->link()->host($notification->host, $notification->host_display_name) ?> <?= $this->link()->host($notification->host_name, $notification->host_display_name) ?>
<?php endif ?> <?php endif ?>
<br> <br>
<?= $this->escape($this->ellipsis($notification->notification_output, 10000)) ?> <?= $this->escape($this->ellipsis($notification->notification_output, 10000)) ?>
@ -61,9 +61,9 @@ use Icinga\Module\Monitoring\Object\Service;
<?= sprintf( <?= sprintf(
$this->translate('Sent to %s'), $this->translate('Sent to %s'),
$this->qlink( $this->qlink(
$notification->notification_contact, $notification->notification_contact_name,
'monitoring/show/contact', 'monitoring/show/contact',
array('contact' => $notification->notification_contact) array('contact_name' => $notification->notification_contact_name)
) )
) ?> ) ?>
</small> </small>

View File

@ -68,7 +68,7 @@ foreach ($serviceDescriptions as $service_description): ?>
<?= $this->qlink( <?= $this->qlink(
$host_name, $host_name,
'monitoring/show/services?' . $serviceFilter, 'monitoring/show/services?' . $serviceFilter,
array('host' => $host_name), array('host_name' => $host_name),
array('title' => sprintf($this->translate('List all reported services on host %s'), $host_name)) array('title' => sprintf($this->translate('List all reported services on host %s'), $host_name))
); ?> ); ?>
</th> </th>
@ -80,10 +80,10 @@ foreach ($serviceDescriptions as $service_description): ?>
</span> </span>
<?= $this->qlink( <?= $this->qlink(
'', '',
'monitoring/show/service', 'monitoring/service/show',
array( array(
'host' => $service->host_name, 'host_name' => $service->host_name,
'service' => $service->service_description 'service_description' => $service->service_description
), ),
array( array(
'aria-describedby' => $service->host_name . '_' . $service->service_description . '_desc', 'aria-describedby' => $service->host_name . '_' . $service->service_description . '_desc',

View File

@ -28,7 +28,7 @@
</thead> </thead>
<tbody> <tbody>
<?php foreach ($servicegroups as $s): ?> <?php foreach ($servicegroups as $s): ?>
<tr href="<?= $this->href('monitoring/list/services', array('servicegroup' => $s->servicegroup)); ?>"> <tr href="<?= $this->href('monitoring/list/services', array('servicegroup_name' => $s->servicegroup_name)); ?>">
<?php if ($s->services_critical_last_state_change_unhandled): ?> <?php if ($s->services_critical_last_state_change_unhandled): ?>
<td class="state change critical unhandled"> <td class="state change critical unhandled">
<strong><?= $this->translate('CRITICAL'); ?></strong> <strong><?= $this->translate('CRITICAL'); ?></strong>
@ -82,7 +82,7 @@
<?= $this->qlink( <?= $this->qlink(
$s->servicegroup_alias, $s->servicegroup_alias,
'monitoring/list/services', 'monitoring/list/services',
array('servicegroup' => $s->servicegroup), array('servicegroup_name' => $s->servicegroup_name),
array('title' => sprintf($this->translate('List all services in the group "%s"'), $s->servicegroup_alias)) array('title' => sprintf($this->translate('List all services in the group "%s"'), $s->servicegroup_alias))
); ?> ); ?>
</td> </td>
@ -97,7 +97,7 @@
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 0, 'service_state' => 0,
'servicegroup' => $s->servicegroup, 'servicegroup_name' => $s->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -124,7 +124,7 @@
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'servicegroup' => $s->servicegroup, 'servicegroup_name' => $s->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -148,7 +148,7 @@
array( array(
'service_state' => 2, 'service_state' => 2,
'service_handled' => 1, 'service_handled' => 1,
'servicegroup' => $s->servicegroup, 'servicegroup_name' => $s->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -178,7 +178,7 @@
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'servicegroup' => $s->servicegroup, 'servicegroup_name' => $s->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -202,7 +202,7 @@
array( array(
'service_state' => 3, 'service_state' => 3,
'service_handled' => 1, 'service_handled' => 1,
'servicegroup' => $s->servicegroup, 'servicegroup_name' => $s->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -232,7 +232,7 @@
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'servicegroup' => $s->servicegroup, 'servicegroup_name' => $s->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -256,7 +256,7 @@
array( array(
'service_state' => 1, 'service_state' => 1,
'service_handled' => 1, 'service_handled' => 1,
'servicegroup' => $s->servicegroup, 'servicegroup_name' => $s->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(
@ -283,7 +283,7 @@
'monitoring/list/services', 'monitoring/list/services',
array( array(
'service_state' => 99, 'service_state' => 99,
'servicegroup' => $s->servicegroup, 'servicegroup_name' => $s->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
array( array(

View File

@ -31,7 +31,7 @@ if (!$this->compact): ?>
<table data-base-target="_next" <table data-base-target="_next"
class="action multiselect <?php if ($this->compact): ?> compact<?php endif ?>" style="table-layout: auto;" class="action multiselect <?php if ($this->compact): ?> compact<?php endif ?>" style="table-layout: auto;"
data-icinga-multiselect-url="<?= $this->href("monitoring/services/show") ?>" data-icinga-multiselect-url="<?= $this->href("monitoring/services/show") ?>"
data-icinga-multiselect-data="service,host"> data-icinga-multiselect-data="service_description,host_name">
<tbody> <tbody>
<?php <?php
@ -42,14 +42,14 @@ foreach ($services as $service):
$serviceLink = $this->href( $serviceLink = $this->href(
'monitoring/service/show', 'monitoring/service/show',
array( array(
'host' => $service->host_name, 'host_name' => $service->host_name,
'service' => $service->service_description 'service_description' => $service->service_description
) )
); );
$hostLink = $this->href( $hostLink = $this->href(
'monitoring/show/host', 'monitoring/host/show',
array( array(
'host' => $service->host_name, 'host_name' => $service->host_name,
) )
); );
$serviceStateName = Service::getStateText($service->service_state); $serviceStateName = Service::getStateText($service->service_state);

View File

@ -3,7 +3,7 @@
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
$selfUrl = Url::fromPath('monitoring/show/services', array('host' => $object->host_name)); $selfUrl = Url::fromPath('monitoring/show/services', array('host_name' => $object->host_name));
$currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl(); $currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl();
?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>> ?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>>
<?php if ($object->stats->services_total): ?> <?php if ($object->stats->services_total): ?>

View File

@ -26,12 +26,12 @@ if ($object->acknowledged): ?>
if ($object->getType() === $object::TYPE_HOST) { if ($object->getType() === $object::TYPE_HOST) {
$ackLink = $this->href( $ackLink = $this->href(
'monitoring/host/acknowledge-problem', 'monitoring/host/acknowledge-problem',
array('host' => $object->getName()) array('host_name' => $object->getName())
); );
} else { } else {
$ackLink = $this->href( $ackLink = $this->href(
'monitoring/service/acknowledge-problem', 'monitoring/service/acknowledge-problem',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()) array('host_name' => $object->getHost()->getName(), 'service_description' => $object->getName())
); );
} }
?> ?>

View File

@ -31,7 +31,7 @@ if ($object->getType() === $object::TYPE_HOST) {
echo $this->qlink( echo $this->qlink(
$this->translate('Reschedule'), $this->translate('Reschedule'),
'monitoring/service/reschedule-check', 'monitoring/service/reschedule-check',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()), array('host_name' => $object->getHost()->getName(), 'service_description' => $object->getName()),
array( array(
'icon' => 'reschedule', 'icon' => 'reschedule',
'data-base-target' => '_self', 'data-base-target' => '_self',
@ -44,7 +44,7 @@ if ($object->getType() === $object::TYPE_HOST) {
echo $this->qlink( echo $this->qlink(
$this->translate('Reschedule'), $this->translate('Reschedule'),
'monitoring/host/reschedule-check', 'monitoring/host/reschedule-check',
array('host' => $object->getName()), array('host_name' => $object->getName()),
array( array(
'icon' => 'reschedule', 'icon' => 'reschedule',
'data-base-target' => '_self', 'data-base-target' => '_self',

View File

@ -15,7 +15,7 @@ $command = array_shift($parts);
echo $this->qlink( echo $this->qlink(
$this->translate('Process check result'), $this->translate('Process check result'),
'monitoring/host/process-check-result', 'monitoring/host/process-check-result',
array('host' => $object->getName()), array('host_name' => $object->getName()),
array( array(
'icon' => 'reply', 'icon' => 'reply',
'data-base-target' => '_self', 'data-base-target' => '_self',
@ -26,7 +26,7 @@ $command = array_shift($parts);
echo $this->qlink( echo $this->qlink(
$this->translate('Process check result'), $this->translate('Process check result'),
'monitoring/service/process-check-result', 'monitoring/service/process-check-result',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()), array('host_name' => $object->getHost()->getName(), 'service_description' => $object->getName()),
array( array(
'icon' => 'reply', 'icon' => 'reply',
'data-base-target' => '_self', 'data-base-target' => '_self',

View File

@ -7,7 +7,7 @@
echo $this->qlink( echo $this->qlink(
$this->translate('Add comment'), $this->translate('Add comment'),
'monitoring/host/add-comment', 'monitoring/host/add-comment',
array('host' => $object->getName()), array('host_name' => $object->getName()),
array( array(
'icon' => 'comment', 'icon' => 'comment',
'data-base-target' => '_self', 'data-base-target' => '_self',
@ -18,7 +18,7 @@
echo $this->qlink( echo $this->qlink(
$this->translate('Add comment'), $this->translate('Add comment'),
'monitoring/service/add-comment', 'monitoring/service/add-comment',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()), array('host_name' => $object->getHost()->getName(), 'service_description' => $object->getName()),
array( array(
'icon' => 'comment', 'icon' => 'comment',
'data-base-target' => '_self', 'data-base-target' => '_self',

View File

@ -7,7 +7,7 @@ if (! empty($object->contacts)) {
$list[] = $this->qlink( $list[] = $this->qlink(
$contact->contact_alias, $contact->contact_alias,
'monitoring/show/contact', 'monitoring/show/contact',
array('contact' => $contact->contact_name), array('contact_name' => $contact->contact_name),
array('title' => sprintf($this->translate('Show detailed information about %s'), $contact->contact_alias)) array('title' => sprintf($this->translate('Show detailed information about %s'), $contact->contact_alias))
); );
} }
@ -27,7 +27,7 @@ if (! empty($object->contactgroups)) {
$list[] = $this->qlink( $list[] = $this->qlink(
$contactgroup->contactgroup_alias, $contactgroup->contactgroup_alias,
'monitoring/list/contactgroups', 'monitoring/list/contactgroups',
array('contactgroup' => $contactgroup->contactgroup_name), array('contactgroup_name' => $contactgroup->contactgroup_name),
array('title' => sprintf($this->translate('List contacts in contact-group "%s"'), $contactgroup->contactgroup_alias)) array('title' => sprintf($this->translate('List contacts in contact-group "%s"'), $contactgroup->contactgroup_alias))
); );
} }

View File

@ -7,7 +7,7 @@
echo $this->qlink( echo $this->qlink(
$this->translate('Schedule downtime'), $this->translate('Schedule downtime'),
'monitoring/host/schedule-downtime', 'monitoring/host/schedule-downtime',
array('host' => $object->getName()), array('host_name' => $object->getName()),
array( array(
'icon' => 'plug', 'icon' => 'plug',
'data-base-target' => '_self', 'data-base-target' => '_self',
@ -20,7 +20,7 @@
echo $this->qlink( echo $this->qlink(
$this->translate('Schedule downtime'), $this->translate('Schedule downtime'),
'monitoring/service/schedule-downtime', 'monitoring/service/schedule-downtime',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()), array('host_name' => $object->getHost()->getName(), 'service_description' => $object->getName()),
array( array(
'icon' => 'plug', 'icon' => 'plug',
'data-base-target' => '_self', 'data-base-target' => '_self',
@ -58,7 +58,7 @@ foreach ($object->downtimes as $downtime) {
?> ?>
<tr> <tr>
<th><?= $this->escape($downtime->author); ?></th> <th><?= $this->escape($downtime->author_name); ?></th>
<td data-base-target="_self"> <td data-base-target="_self">
<?php if (isset($delDowntimeForm)) { // Form is unset if the current user lacks the respective permission <?php if (isset($delDowntimeForm)) { // Form is unset if the current user lacks the respective permission
$delDowntimeForm = clone $delDowntimeForm; $delDowntimeForm = clone $delDowntimeForm;

View File

@ -7,7 +7,7 @@ foreach ($object->hostgroups as $name => $alias) {
$list[] = $this->qlink( $list[] = $this->qlink(
$alias, $alias,
'monitoring/list/hosts', 'monitoring/list/hosts',
array('hostgroup' => $name), array('hostgroup_name' => $name),
array('title' => sprintf($this->translate('List all hosts in the group "%s"'), $alias)) array('title' => sprintf($this->translate('List all hosts in the group "%s"'), $alias))
); );
} }

View File

@ -5,12 +5,12 @@
if ($object->getType() === $object::TYPE_HOST) { if ($object->getType() === $object::TYPE_HOST) {
$ackLink = $this->href( $ackLink = $this->href(
'monitoring/host/send-custom-notification', 'monitoring/host/send-custom-notification',
array('host' => $object->getName()) array('host_name' => $object->getName())
); );
} else { } else {
$ackLink = $this->href( $ackLink = $this->href(
'monitoring/service/send-custom-notification', 'monitoring/service/send-custom-notification',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()) array('host_name' => $object->getHost()->getName(), 'service_description' => $object->getName())
); );
} }
?> ?>

View File

@ -7,7 +7,7 @@ foreach ($object->servicegroups as $name => $alias) {
$list[] = $this->qlink( $list[] = $this->qlink(
$alias, $alias,
'monitoring/list/services', 'monitoring/list/services',
array('servicegroup' => $name), array('servicegroup_name' => $name),
array('title' => sprintf($this->translate('List all services in the group "%s"'), $alias)) array('title' => sprintf($this->translate('List all services in the group "%s"'), $alias))
); );
} }

View File

@ -20,7 +20,7 @@ $hostContext = $object->getType() === 'host';
</div> </div>
<div class="content"> <div class="content">
<?php if (empty($history)): ?> <?php if (count($history) === 0): ?>
<?= $this->translate('No history available for this object'); ?> <?= $this->translate('No history available for this object'); ?>
</div> </div>
<?php return; endif ?> <?php return; endif ?>
@ -32,7 +32,7 @@ function contactsLink($match, $view) {
$links[] = $view->qlink( $links[] = $view->qlink(
$contact, $contact,
'monitoring/show/contact', 'monitoring/show/contact',
array('contact' => $contact), array('contact_name' => $contact),
array('title' => sprintf($view->translate('Show detailed information about %s'), $contact)) array('title' => sprintf($view->translate('Show detailed information about %s'), $contact))
); );
} }
@ -142,10 +142,10 @@ $output = $this->tickets ? preg_replace_callback(
$this->translate('%s on %s', 'Service running on host'), $this->translate('%s on %s', 'Service running on host'),
$hostContext ? $this->qlink( $hostContext ? $this->qlink(
$event->service_display_name, $event->service_display_name,
'monitoring/show/service', 'monitoring/service/show',
array( array(
'host' => $event->host_name, 'host_name' => $event->host_name,
'service' => $event->service_description 'service_description' => $event->service_description
), ),
array('title' => sprintf( array('title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'), $this->translate('Show detailed information for service %s on host %s'),

View File

@ -13,17 +13,17 @@ class CommentQuery extends IdoQuery
'comment_internal_id' => 'cm.internal_comment_id', 'comment_internal_id' => 'cm.internal_comment_id',
'comment_data' => 'cm.comment_data', 'comment_data' => 'cm.comment_data',
'comment_author' => 'cm.author_name COLLATE latin1_general_ci', 'comment_author' => 'cm.author_name COLLATE latin1_general_ci',
'comment_author_name' => 'cm.author_name',
'comment_timestamp' => 'UNIX_TIMESTAMP(cm.comment_time)', 'comment_timestamp' => 'UNIX_TIMESTAMP(cm.comment_time)',
'comment_type' => "CASE cm.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'downtime' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END", 'comment_type' => "CASE cm.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'downtime' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END",
'comment_is_persistent' => 'cm.is_persistent', 'comment_is_persistent' => 'cm.is_persistent',
'comment_expiration' => 'CASE cm.expires WHEN 1 THEN UNIX_TIMESTAMP(cm.expiration_time) ELSE NULL END', 'comment_expiration' => 'CASE cm.expires WHEN 1 THEN UNIX_TIMESTAMP(cm.expiration_time) ELSE NULL END',
'comment_host' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END COLLATE latin1_general_ci',
'host' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END COLLATE latin1_general_ci', // #7278, #7279
'comment_service' => 'so.name2 COLLATE latin1_general_ci',
'service' => 'so.name2 COLLATE latin1_general_ci', // #7278, #7279
'comment_objecttype' => "CASE WHEN ho.object_id IS NOT NULL THEN 'host' ELSE CASE WHEN so.object_id IS NOT NULL THEN 'service' ELSE NULL END END", 'comment_objecttype' => "CASE WHEN ho.object_id IS NOT NULL THEN 'host' ELSE CASE WHEN so.object_id IS NOT NULL THEN 'service' ELSE NULL END END",
'service_description' => 'so.name2', 'host' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END COLLATE latin1_general_ci',
'host_name' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END', 'host_name' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END',
'service' => 'so.name2 COLLATE latin1_general_ci',
'service_description' => 'so.name2',
'service_host' => 'so.name1 COLLATE latin1_general_ci',
'service_host_name' => 'so.name1' 'service_host_name' => 'so.name1'
), ),
'hosts' => array( 'hosts' => array(

View File

@ -20,10 +20,8 @@ class CommentdeletionhistoryQuery extends IdoQuery
'host' => 'o.name1 COLLATE latin1_general_ci', 'host' => 'o.name1 COLLATE latin1_general_ci',
'service' => 'o.name2 COLLATE latin1_general_ci', 'service' => 'o.name2 COLLATE latin1_general_ci',
'host_name' => 'o.name1 COLLATE latin1_general_ci', 'host_name' => 'o.name1',
'service_description' => 'o.name2 COLLATE latin1_general_ci', 'service_description' => 'o.name2',
'service_host_name' => 'o.name1 COLLATE latin1_general_ci',
'service_description' => 'o.name2 COLLATE latin1_general_ci',
'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END" 'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END"
) )
); );

View File

@ -20,10 +20,8 @@ class CommenthistoryQuery extends IdoQuery
'host' => 'o.name1 COLLATE latin1_general_ci', 'host' => 'o.name1 COLLATE latin1_general_ci',
'service' => 'o.name2 COLLATE latin1_general_ci', 'service' => 'o.name2 COLLATE latin1_general_ci',
'host_name' => 'o.name1 COLLATE latin1_general_ci', 'host_name' => 'o.name1',
'service_description' => 'o.name2 COLLATE latin1_general_ci', 'service_description' => 'o.name2',
'service_host_name' => 'o.name1 COLLATE latin1_general_ci',
'service_description' => 'o.name2 COLLATE latin1_general_ci',
'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END" 'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END"
) )
); );

View File

@ -8,7 +8,8 @@ class ContactQuery extends IdoQuery
protected $columnMap = array( protected $columnMap = array(
'contacts' => array( 'contacts' => array(
'contact_id' => 'c.contact_id', 'contact_id' => 'c.contact_id',
'contact_name' => 'co.name1 COLLATE latin1_general_ci', 'contact' => 'co.name1 COLLATE latin1_general_ci',
'contact_name' => 'co.name1',
'contact_alias' => 'c.alias COLLATE latin1_general_ci', 'contact_alias' => 'c.alias COLLATE latin1_general_ci',
'contact_email' => 'c.email_address COLLATE latin1_general_ci', 'contact_email' => 'c.email_address COLLATE latin1_general_ci',
'contact_pager' => 'c.pager_address', 'contact_pager' => 'c.pager_address',
@ -34,12 +35,13 @@ class ContactQuery extends IdoQuery
), ),
'hosts' => array( 'hosts' => array(
'host' => 'ho.name1 COLLATE latin1_general_ci', 'host' => 'ho.name1 COLLATE latin1_general_ci',
'host_name' => 'ho.name1', 'host_name' => 'ho.name1'
), ),
'services' => array( 'services' => array(
'service' => 'so.name1 COLLATE latin1_general_ci', 'service' => 'so.name2 COLLATE latin1_general_ci',
'service_description' => 'so.name2', 'service_description' => 'so.name2',
'service_host_name' => 'so.name1', 'service_host' => 'so.name1 COLLATE latin1_general_ci',
'service_host_name' => 'so.name1'
) )
); );

View File

@ -8,14 +8,14 @@ class ContactgroupQuery extends IdoQuery
protected $columnMap = array( protected $columnMap = array(
'contactgroups' => array( 'contactgroups' => array(
'contactgroup' => 'cgo.name1 COLLATE latin1_general_ci', 'contactgroup' => 'cgo.name1 COLLATE latin1_general_ci',
'contactgroup_name' => 'cgo.name1 COLLATE latin1_general_ci', 'contactgroup_name' => 'cgo.name1',
'contactgroup_alias' => 'cg.alias', 'contactgroup_alias' => 'cg.alias COLLATE latin1_general_ci'
), ),
'contacts' => array( 'contacts' => array(
'contact' => 'co.name1 COLLATE latin1_general_ci', 'contact' => 'co.name1 COLLATE latin1_general_ci',
'contact_name' => 'co.name1 COLLATE latin1_general_ci', 'contact_name' => 'co.name1',
'contact_alias' => 'c.alias', 'contact_alias' => 'c.alias COLLATE latin1_general_ci',
'contact_email' => 'c.email_address', 'contact_email' => 'c.email_address COLLATE latin1_general_ci',
'contact_pager' => 'c.pager_address', 'contact_pager' => 'c.pager_address',
'contact_has_host_notfications' => 'c.host_notifications_enabled', 'contact_has_host_notfications' => 'c.host_notifications_enabled',
'contact_has_service_notfications' => 'c.service_notifications_enabled', 'contact_has_service_notfications' => 'c.service_notifications_enabled',
@ -39,6 +39,7 @@ class ContactgroupQuery extends IdoQuery
'services' => array( 'services' => array(
'service' => 'so.name2 COLLATE latin1_general_ci', 'service' => 'so.name2 COLLATE latin1_general_ci',
'service_description' => 'so.name2', 'service_description' => 'so.name2',
'service_host' => 'so.name1 COLLATE latin1_general_ci',
'service_host_name' => 'so.name1' 'service_host_name' => 'so.name1'
) )
); );

View File

@ -13,11 +13,11 @@ class CustomvarQuery extends IdoQuery
), ),
'objects' => array( 'objects' => array(
'host' => 'cvo.name1 COLLATE latin1_general_ci', 'host' => 'cvo.name1 COLLATE latin1_general_ci',
'host_name' => 'cvo.name1 COLLATE latin1_general_ci', 'host_name' => 'cvo.name1',
'service_host_name' => 'cvo.name1 COLLATE latin1_general_ci',
'service' => 'cvo.name2 COLLATE latin1_general_ci', 'service' => 'cvo.name2 COLLATE latin1_general_ci',
'service_description' => 'cvo.name2 COLLATE latin1_general_ci', 'service_description' => 'cvo.name2',
'contact_name' => 'cvo.name1 COLLATE latin1_general_ci', 'contact' => 'cvo.name1 COLLATE latin1_general_ci',
'contact_name' => 'cvo.name1',
'object_type' => "CASE cvo.objecttype_id WHEN 1 THEN 'host' WHEN 2 THEN 'service' WHEN 10 THEN 'contact' ELSE 'invalid' END", 'object_type' => "CASE cvo.objecttype_id WHEN 1 THEN 'host' WHEN 2 THEN 'service' WHEN 10 THEN 'contact' ELSE 'invalid' END",
'object_type_id' => 'cvo.objecttype_id' 'object_type_id' => 'cvo.objecttype_id'
// 'object_type' => "CASE cvo.objecttype_id WHEN 1 THEN 'host' WHEN 2 THEN 'service' WHEN 3 THEN 'hostgroup' WHEN 4 THEN 'servicegroup' WHEN 5 THEN 'hostescalation' WHEN 6 THEN 'serviceescalation' WHEN 7 THEN 'hostdependency' WHEN 8 THEN 'servicedependency' WHEN 9 THEN 'timeperiod' WHEN 10 THEN 'contact' WHEN 11 THEN 'contactgroup' WHEN 12 THEN 'command' ELSE 'other' END" // 'object_type' => "CASE cvo.objecttype_id WHEN 1 THEN 'host' WHEN 2 THEN 'service' WHEN 3 THEN 'hostgroup' WHEN 4 THEN 'servicegroup' WHEN 5 THEN 'hostescalation' WHEN 6 THEN 'serviceescalation' WHEN 7 THEN 'hostdependency' WHEN 8 THEN 'servicedependency' WHEN 9 THEN 'timeperiod' WHEN 10 THEN 'contact' WHEN 11 THEN 'contactgroup' WHEN 12 THEN 'command' ELSE 'other' END"

View File

@ -13,8 +13,8 @@ class DowntimeQuery extends IdoQuery
*/ */
protected $columnMap = array( protected $columnMap = array(
'downtime' => array( 'downtime' => array(
'downtime_author' => 'sd.author_name', 'downtime_author_name' => 'sd.author_name',
'author' => 'sd.author_name', 'author' => 'sd.author_name COLLATE latin1_general_ci',
'downtime_comment' => 'sd.comment_data', 'downtime_comment' => 'sd.comment_data',
'downtime_entry_time' => 'UNIX_TIMESTAMP(sd.entry_time)', 'downtime_entry_time' => 'UNIX_TIMESTAMP(sd.entry_time)',
'downtime_is_fixed' => 'sd.is_fixed', 'downtime_is_fixed' => 'sd.is_fixed',
@ -28,12 +28,11 @@ class DowntimeQuery extends IdoQuery
'downtime_is_in_effect' => 'sd.is_in_effect', 'downtime_is_in_effect' => 'sd.is_in_effect',
'downtime_internal_id' => 'sd.internal_downtime_id', 'downtime_internal_id' => 'sd.internal_downtime_id',
'downtime_objecttype' => "CASE WHEN ho.object_id IS NULL THEN 'service' ELSE 'host' END", 'downtime_objecttype' => "CASE WHEN ho.object_id IS NULL THEN 'service' ELSE 'host' END",
'downtime_host' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END COLLATE latin1_general_ci', // #7278, #7279
'host' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END COLLATE latin1_general_ci', 'host' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END COLLATE latin1_general_ci',
'host_name' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END', 'host_name' => 'CASE WHEN ho.name1 IS NULL THEN so.name1 ELSE ho.name1 END',
'downtime_service' => 'so.name2 COLLATE latin1_general_ci', 'service' => 'so.name2 COLLATE latin1_general_ci',
'service' => 'so.name2 COLLATE latin1_general_ci', // #7278, #7279
'service_description' => 'so.name2', 'service_description' => 'so.name2',
'service_host' => 'so.name1 COLLATE latin1_general_ci',
'service_host_name' => 'so.name1' 'service_host_name' => 'so.name1'
), ),
'hosts' => array( 'hosts' => array(

View File

@ -20,10 +20,8 @@ class DowntimeendhistoryQuery extends IdoQuery
'host' => 'o.name1 COLLATE latin1_general_ci', 'host' => 'o.name1 COLLATE latin1_general_ci',
'service' => 'o.name2 COLLATE latin1_general_ci', 'service' => 'o.name2 COLLATE latin1_general_ci',
'host_name' => 'o.name1 COLLATE latin1_general_ci', 'host_name' => 'o.name1',
'service_description' => 'o.name2 COLLATE latin1_general_ci', 'service_description' => 'o.name2',
'service_host_name' => 'o.name1 COLLATE latin1_general_ci',
'service_description' => 'o.name2 COLLATE latin1_general_ci',
'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END" 'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END"
) )
); );

View File

@ -20,10 +20,8 @@ class DowntimestarthistoryQuery extends IdoQuery
'host' => 'o.name1 COLLATE latin1_general_ci', 'host' => 'o.name1 COLLATE latin1_general_ci',
'service' => 'o.name2 COLLATE latin1_general_ci', 'service' => 'o.name2 COLLATE latin1_general_ci',
'host_name' => 'o.name1 COLLATE latin1_general_ci', 'host_name' => 'o.name1',
'service_description' => 'o.name2 COLLATE latin1_general_ci', 'service_description' => 'o.name2',
'service_host_name' => 'o.name1 COLLATE latin1_general_ci',
'service_description' => 'o.name2 COLLATE latin1_general_ci',
'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END" 'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END"
) )
); );

View File

@ -32,19 +32,19 @@ class EventHistoryQuery extends IdoQuery
'cnt_downtime_end' => "SUM(CASE eh.type WHEN 'dt_end' THEN 1 ELSE 0 END)", 'cnt_downtime_end' => "SUM(CASE eh.type WHEN 'dt_end' THEN 1 ELSE 0 END)",
'host' => 'eho.name1 COLLATE latin1_general_ci', 'host' => 'eho.name1 COLLATE latin1_general_ci',
'service' => 'eho.name2 COLLATE latin1_general_ci', 'service' => 'eho.name2 COLLATE latin1_general_ci',
'host_name' => 'eho.name1 COLLATE latin1_general_ci', 'host_name' => 'eho.name1',
'service_description' => 'eho.name2 COLLATE latin1_general_ci', 'service_description' => 'eho.name2',
'object_type' => 'eh.object_type', 'object_type' => 'eh.object_type',
'timestamp' => 'eh.timestamp', 'timestamp' => 'eh.timestamp',
'state' => 'eh.state', 'state' => 'eh.state',
'attempt' => 'eh.attempt', 'attempt' => 'eh.attempt',
'max_attempts' => 'eh.max_attempts', 'max_attempts' => 'eh.max_attempts',
'output' => 'eh.output', // we do not want long_output 'output' => 'eh.output', // we do not want long_output
'type' => 'eh.type', 'type' => 'eh.type'
'service_host_name' => 'eho.name1 COLLATE latin1_general_ci'
), ),
'hostgroups' => array( 'hostgroups' => array(
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
'hostgroup_name' => 'hgo.name1'
), ),
'hosts' => array( 'hosts' => array(
'host_display_name' => 'CASE WHEN sh.display_name IS NOT NULL THEN sh.display_name ELSE h.display_name END' 'host_display_name' => 'CASE WHEN sh.display_name IS NOT NULL THEN sh.display_name ELSE h.display_name END'

View File

@ -25,17 +25,19 @@ class EventgridQuery extends IdoQuery
'cnt_ok' => 'SUM(CASE WHEN sho.objecttype_id = 2 AND sh.state = 0 THEN 1 ELSE 0 END)', 'cnt_ok' => 'SUM(CASE WHEN sho.objecttype_id = 2 AND sh.state = 0 THEN 1 ELSE 0 END)',
'host' => 'sho.name1 COLLATE latin1_general_ci', 'host' => 'sho.name1 COLLATE latin1_general_ci',
'service' => 'sho.name2 COLLATE latin1_general_ci', 'service' => 'sho.name2 COLLATE latin1_general_ci',
'host_name' => 'sho.name1 COLLATE latin1_general_ci', 'host_name' => 'sho.name1',
'service_description' => 'sho.name2 COLLATE latin1_general_ci', 'service_description' => 'sho.name2',
'timestamp' => 'UNIX_TIMESTAMP(sh.state_time)' 'timestamp' => 'UNIX_TIMESTAMP(sh.state_time)'
), ),
'servicegroups' => array( 'servicegroups' => array(
'servicegroup' => 'sgo.name1' 'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
'servicegroup_name' => 'sgo.name1'
), ),
'hostgroups' => array( 'hostgroups' => array(
'hostgroup' => 'hgo.name1' 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
'hostgroup_name' => 'hgo.name1'
) )
); );

View File

@ -19,7 +19,7 @@ class GroupSummaryQuery extends IdoQuery
'hosts_down_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime != 0 THEN 1 ELSE 0 END)', 'hosts_down_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime != 0 THEN 1 ELSE 0 END)',
'hosts_down_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)', 'hosts_down_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
'hosts_pending' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 THEN 1 ELSE 0 END)', 'hosts_pending' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 THEN 1 ELSE 0 END)',
'hostgroup' => 'hostgroup', 'hostgroup_name' => 'hostgroup_name',
'hostgroup_alias' => 'hostgroup_alias' 'hostgroup_alias' => 'hostgroup_alias'
), ),
'servicestatussummary' => array( 'servicestatussummary' => array(
@ -44,7 +44,7 @@ class GroupSummaryQuery extends IdoQuery
'services_warning_last_state_change_unhandled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 1 AND acknowledged + in_downtime + host_state = 0 THEN state_change ELSE 0 END)', 'services_warning_last_state_change_unhandled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 1 AND acknowledged + in_downtime + host_state = 0 THEN state_change ELSE 0 END)',
'services_critical_last_state_change_unhandled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 2 AND acknowledged + in_downtime + host_state = 0 THEN state_change ELSE 0 END)', 'services_critical_last_state_change_unhandled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 2 AND acknowledged + in_downtime + host_state = 0 THEN state_change ELSE 0 END)',
'services_unknown_last_state_change_unhandled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 3 AND acknowledged + in_downtime + host_state = 0 THEN state_change ELSE 0 END)', 'services_unknown_last_state_change_unhandled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 3 AND acknowledged + in_downtime + host_state = 0 THEN state_change ELSE 0 END)',
'servicegroup' => 'servicegroup', 'servicegroup_name' => 'servicegroup_name',
'servicegroup_alias' => 'servicegroup_alias' 'servicegroup_alias' => 'servicegroup_alias'
) )
); );
@ -56,14 +56,14 @@ class GroupSummaryQuery extends IdoQuery
'host_state' 'host_state'
); );
if (in_array('servicegroup', $this->desiredColumns)) { if (in_array('servicegroup_name', $this->desiredColumns)) {
$columns[] = 'servicegroup'; $columns[] = 'servicegroup_name';
$columns[] = 'servicegroup_alias'; $columns[] = 'servicegroup_alias';
$groupColumns = array('servicegroup', 'servicegroup_alias'); $groupColumns = array('servicegroup_name', 'servicegroup_alias');
} else { } else {
$columns[] = 'hostgroup'; $columns[] = 'hostgroup_name';
$columns[] = 'hostgroup_alias'; $columns[] = 'hostgroup_alias';
$groupColumns = array('hostgroup', 'hostgroup_alias'); $groupColumns = array('hostgroup_name', 'hostgroup_alias');
} }
$hosts = $this->createSubQuery( $hosts = $this->createSubQuery(
'Hoststatus', 'Hoststatus',
@ -75,7 +75,7 @@ class GroupSummaryQuery extends IdoQuery
'severity' => 'host_severity' 'severity' => 'host_severity'
) )
); );
if (in_array('servicegroup', $this->desiredColumns)) { if (in_array('servicegroup_name', $this->desiredColumns)) {
$hosts->group(array( $hosts->group(array(
'sgo.name1', 'sgo.name1',
'ho.object_id', 'ho.object_id',

View File

@ -8,13 +8,13 @@ class HostgroupQuery extends IdoQuery
protected $columnMap = array( protected $columnMap = array(
'hostgroups' => array( 'hostgroups' => array(
'hostgroups' => 'hgo.name1 COLLATE latin1_general_ci', 'hostgroups' => 'hgo.name1 COLLATE latin1_general_ci',
'hostgroup_name' => 'hgo.name1 COLLATE latin1_general_ci', 'hostgroup_name' => 'hgo.name1',
'hostgroup_alias' => 'hg.alias', 'hostgroup_alias' => 'hg.alias',
'id' => 'hg.hostgroup_id', 'hostgroup_id' => 'hg.hostgroup_id'
), ),
'hosts' => array( 'hosts' => array(
'host' => 'ho.name1 COLLATE latin1_general_ci', 'host' => 'ho.name1 COLLATE latin1_general_ci',
'host_name' => 'ho.name1 COLLATE latin1_general_ci' 'host_name' => 'ho.name1'
) )
); );

View File

@ -83,11 +83,11 @@ class HoststatusQuery extends IdoQuery
END' END'
), ),
'hostgroups' => array( 'hostgroups' => array(
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', 'hostgroup_name' => 'hgo.name1',
'hostgroup_alias' => 'hg.alias' 'hostgroup_alias' => 'hg.alias'
), ),
'servicegroups' => array( 'servicegroups' => array(
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci', 'servicegroup_name' => 'sgo.name1',
'servicegroup_alias' => 'sg.alias' 'servicegroup_alias' => 'sg.alias'
), ),
'contactgroups' => array( 'contactgroups' => array(

View File

@ -13,11 +13,14 @@ class NotificationQuery extends IdoQuery
'notification_object_id' => 'n.object_id' 'notification_object_id' => 'n.object_id'
), ),
'objects' => array( 'objects' => array(
'host' => 'o.name1', 'host' => 'o.name1 COLLATE latin1_general_ci',
'service' => 'o.name2' 'host_name' => 'o.name1',
'service' => 'o.name2 COLLATE latin1_general_ci',
'service_description' => 'o.name2'
), ),
'contact' => array( 'contact' => array(
'notification_contact' => 'c_o.name1', 'contact' => 'c_o.name1 COLLATE latin1_general_ci',
'notification_contact_name' => 'c_o.name1',
'contact_object_id' => 'c_o.object_id' 'contact_object_id' => 'c_o.object_id'
), ),
'command' => array( 'command' => array(

View File

@ -7,9 +7,9 @@ class NotificationhistoryQuery extends IdoQuery
{ {
protected $columnMap = array( protected $columnMap = array(
'history' => array( 'history' => array(
'state_time' => 'n.start_time',
'timestamp' => 'UNIX_TIMESTAMP(n.start_time)', 'timestamp' => 'UNIX_TIMESTAMP(n.start_time)',
'raw_timestamp' => 'n.start_time', 'raw_timestamp' => 'n.start_time',
'state_time' => 'n.start_time',
'object_id' => 'n.object_id', 'object_id' => 'n.object_id',
'type' => "('notify')", 'type' => "('notify')",
'state' => 'n.state', 'state' => 'n.state',
@ -20,10 +20,8 @@ class NotificationhistoryQuery extends IdoQuery
'host' => 'o.name1 COLLATE latin1_general_ci', 'host' => 'o.name1 COLLATE latin1_general_ci',
'service' => 'o.name2 COLLATE latin1_general_ci', 'service' => 'o.name2 COLLATE latin1_general_ci',
'host_name' => 'o.name1 COLLATE latin1_general_ci', 'host_name' => 'o.name1',
'service_description' => 'o.name2 COLLATE latin1_general_ci', 'service_description' => 'o.name2',
'service_host_name' => 'o.name1 COLLATE latin1_general_ci',
'service_description' => 'o.name2 COLLATE latin1_general_ci',
'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END" 'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END"
) )
); );

View File

@ -7,15 +7,16 @@ class ServicegroupQuery extends IdoQuery
{ {
protected $columnMap = array( protected $columnMap = array(
'servicegroups' => array( 'servicegroups' => array(
'servicegroup_name' => 'sgo.name1 COLLATE latin1_general_ci', 'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
'servicegroup_alias' => 'sg.alias', 'servicegroup_name' => 'sgo.name1',
'servicegroup_alias' => 'sg.alias COLLATE latin1_general_ci'
), ),
'services' => array( 'services' => array(
'host' => 'so.name1 COLLATE latin1_general_ci', 'host' => 'so.name1 COLLATE latin1_general_ci',
'host_name' => 'so.name1 COLLATE latin1_general_ci', 'host_name' => 'so.name1',
'service' => 'so.name2 COLLATE latin1_general_ci', 'service' => 'so.name2 COLLATE latin1_general_ci',
'service_host_name' => 'so.name1 COLLATE latin1_general_ci', 'service_host_name' => 'so.name1',
'service_description' => 'so.name2 COLLATE latin1_general_ci' 'service_description' => 'so.name2'
) )
); );

View File

@ -12,9 +12,9 @@ class StatehistoryQuery extends IdoQuery
protected $columnMap = array( protected $columnMap = array(
'statehistory' => array( 'statehistory' => array(
'raw_timestamp' => 'sh.state_time',
'timestamp' => 'UNIX_TIMESTAMP(sh.state_time)',
'state_time' => 'sh.state_time', 'state_time' => 'sh.state_time',
'timestamp' => 'UNIX_TIMESTAMP(sh.state_time)',
'raw_timestamp' => 'sh.state_time',
'object_id' => 'sho.object_id', 'object_id' => 'sho.object_id',
'type' => "(CASE WHEN sh.state_type = 1 THEN 'hard_state' ELSE 'soft_state' END)", 'type' => "(CASE WHEN sh.state_type = 1 THEN 'hard_state' ELSE 'soft_state' END)",
'state' => 'sh.state', 'state' => 'sh.state',
@ -22,11 +22,11 @@ class StatehistoryQuery extends IdoQuery
'output' => 'sh.output', 'output' => 'sh.output',
'attempt' => 'sh.current_check_attempt', 'attempt' => 'sh.current_check_attempt',
'max_attempts' => 'sh.max_check_attempts', 'max_attempts' => 'sh.max_check_attempts',
'host' => 'sho.name1 COLLATE latin1_general_ci', 'host' => 'sho.name1 COLLATE latin1_general_ci',
'host_name' => 'sho.name1 COLLATE latin1_general_ci',
'service' => 'sho.name2 COLLATE latin1_general_ci', 'service' => 'sho.name2 COLLATE latin1_general_ci',
'service_description' => 'sho.name2 COLLATE latin1_general_ci', 'host_name' => 'sho.name1',
'service_host_name' => 'sho.name1 COLLATE latin1_general_ci', 'service_description' => 'sho.name2',
'object_type' => "CASE WHEN sho.objecttype_id = 1 THEN 'host' ELSE 'service' END" 'object_type' => "CASE WHEN sho.objecttype_id = 1 THEN 'host' ELSE 'service' END"
) )
); );

View File

@ -35,7 +35,7 @@ class StatusQuery extends IdoQuery
protected $columnMap = array( protected $columnMap = array(
'hosts' => array( 'hosts' => array(
'host' => 'ho.name1 COLLATE latin1_general_ci', 'host' => 'ho.name1 COLLATE latin1_general_ci',
'host_name' => 'ho.name1 COLLATE latin1_general_ci', 'host_name' => 'ho.name1',
'host_display_name' => 'h.display_name', 'host_display_name' => 'h.display_name',
'host_alias' => 'h.alias', 'host_alias' => 'h.alias',
'host_address' => 'h.address', 'host_address' => 'h.address',
@ -161,16 +161,19 @@ class StatusQuery extends IdoQuery
), ),
'hostgroups' => array( 'hostgroups' => array(
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
'hostgroup_name' => 'hgo.name1',
'hostgroup_alias' => 'hg.alias' 'hostgroup_alias' => 'hg.alias'
), ),
'servicegroups' => array( 'servicegroups' => array(
'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci', 'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci',
'servicegroup_name' => 'sgo.name1',
'servicegroup_alias' => 'sg.alias' 'servicegroup_alias' => 'sg.alias'
), ),
'services' => array( 'services' => array(
'service_host_name' => 'so.name1 COLLATE latin1_general_ci', 'service_host' => 'so.name1 COLLATE latin1_general_ci',
'service_host_name' => 'so.name1',
'service' => 'so.name2 COLLATE latin1_general_ci', 'service' => 'so.name2 COLLATE latin1_general_ci',
'service_description' => 'so.name2 COLLATE latin1_general_ci', 'service_description' => 'so.name2',
'service_display_name' => 's.display_name', 'service_display_name' => 's.display_name',
'service_icon_image' => 's.icon_image', 'service_icon_image' => 's.icon_image',
'service_action_url' => 's.action_url', 'service_action_url' => 's.action_url',

View File

@ -17,17 +17,16 @@ class Comment extends DataView
'comment_objecttype', 'comment_objecttype',
'comment_internal_id', 'comment_internal_id',
'comment_data', 'comment_data',
'comment_author', 'comment_author_name',
'comment_timestamp', 'comment_timestamp',
'comment_type', 'comment_type',
'comment_is_persistent', 'comment_is_persistent',
'comment_expiration', 'comment_expiration',
'comment_host', 'host_name',
'comment_service', 'service_description',
'host',
'service',
'host_display_name', 'host_display_name',
'service_display_name' 'service_display_name',
'service_host_name'
); );
} }
@ -56,4 +55,12 @@ class Comment extends DataView
) )
); );
} }
/**
* {@inheritdoc}
*/
public function getFilterColumns()
{
return array('comment_author', 'host', 'service', 'service_host');
}
} }

View File

@ -8,7 +8,6 @@ namespace Icinga\Module\Monitoring\DataView;
*/ */
class Contact extends DataView class Contact extends DataView
{ {
/** /**
* Retrieve columns provided by this view * Retrieve columns provided by this view
* *
@ -17,7 +16,6 @@ class Contact extends DataView
public function getColumns() public function getColumns()
{ {
return array( return array(
'contact',
'contact_name', 'contact_name',
'contact_alias', 'contact_alias',
'contact_email', 'contact_email',
@ -43,9 +41,7 @@ class Contact extends DataView
'host_name', 'host_name',
'service_object_id', 'service_object_id',
'service_host_name', 'service_host_name',
'service_description', 'service_description'
'service',
'host',
); );
} }
@ -62,4 +58,9 @@ class Contact extends DataView
) )
); );
} }
public function getFilterColumns()
{
return array('contact', 'alias', 'email', 'host', 'service', 'service_host');
}
} }

View File

@ -8,7 +8,6 @@ namespace Icinga\Module\Monitoring\DataView;
*/ */
class Contactgroup extends DataView class Contactgroup extends DataView
{ {
/** /**
* Retrieve columns provided by this view * Retrieve columns provided by this view
* *
@ -17,13 +16,29 @@ class Contactgroup extends DataView
public function getColumns() public function getColumns()
{ {
return array( return array(
'contact',
'contact_name',
'contactgroup',
'contactgroup_name', 'contactgroup_name',
'contactgroup_alias', 'contactgroup_alias',
'host', 'contact_name',
'service' 'contact_alias',
'contact_email',
'contact_pager',
'contact_has_host_notfications',
'contact_has_service_notfications',
'contact_can_submit_commands',
'contact_notify_service_recovery',
'contact_notify_service_warning',
'contact_notify_service_critical',
'contact_notify_service_unknown',
'contact_notify_service_flapping',
'contact_notify_service_downtime',
'contact_notify_host_recovery',
'contact_notify_host_down',
'contact_notify_host_unreachable',
'contact_notify_host_flapping',
'contact_notify_host_downtime',
'host_name',
'service_description',
'service_host_name'
); );
} }
@ -43,4 +58,9 @@ class Contactgroup extends DataView
) )
); );
} }
public function getFilterColumns()
{
return array('contactgroup', 'contact', 'host', 'service', 'service_host');
}
} }

View File

@ -19,7 +19,11 @@ class Customvar extends DataView
'varname', 'varname',
'varvalue', 'varvalue',
'is_json', 'is_json',
'object_type' 'host_name',
'service_description',
'contact_name',
'object_type',
'object_type_id'
); );
} }
@ -37,4 +41,9 @@ class Customvar extends DataView
) )
); );
} }
public function getFilterColumns()
{
return array('host', 'service', 'contact');
}
} }

View File

@ -14,8 +14,7 @@ class Downtime extends DataView
{ {
return array( return array(
'downtime_objecttype', 'downtime_objecttype',
'downtime_author', 'downtime_author_name',
'author',
'downtime_comment', 'downtime_comment',
'downtime_entry_time', 'downtime_entry_time',
'downtime_is_fixed', 'downtime_is_fixed',
@ -28,8 +27,6 @@ class Downtime extends DataView
'downtime_is_in_effect', 'downtime_is_in_effect',
'downtime_triggered_by_id', 'downtime_triggered_by_id',
'downtime_internal_id', 'downtime_internal_id',
'downtime_host',
'downtime_service',
'downtime_host_state', 'downtime_host_state',
'downtime_service_state', 'downtime_service_state',
'host_display_name', 'host_display_name',
@ -69,4 +66,9 @@ class Downtime extends DataView
) )
); );
} }
public function getFilterColumns()
{
return array('author', 'host', 'service', 'service_host');
}
} }

View File

@ -22,16 +22,14 @@ class EventHistory extends DataView
'host_display_name', 'host_display_name',
'service_description', 'service_description',
'service_display_name', 'service_display_name',
'hostgroup_name',
'object_type', 'object_type',
'timestamp', 'timestamp',
'state', 'state',
'attempt', 'attempt',
'max_attempts', 'max_attempts',
'output', 'output',
'type', 'type'
'host',
'service',
'service_host_name'
); );
} }
@ -47,8 +45,6 @@ class EventHistory extends DataView
public function getFilterColumns() public function getFilterColumns()
{ {
return array( return array('host', 'service', 'hostgroup');
'hostgroups'
);
} }
} }

View File

@ -15,6 +15,7 @@ class Eventgrid extends DataView
return array( return array(
'day', 'day',
'cnt_events', 'cnt_events',
'objecttype_id',
'cnt_up', 'cnt_up',
'cnt_down_hard', 'cnt_down_hard',
'cnt_down', 'cnt_down',
@ -22,12 +23,16 @@ class Eventgrid extends DataView
'cnt_unreachable', 'cnt_unreachable',
'cnt_unknown_hard', 'cnt_unknown_hard',
'cnt_unknown', 'cnt_unknown',
'cnt_unknown_hard',
'cnt_critical', 'cnt_critical',
'cnt_critical_hard', 'cnt_critical_hard',
'cnt_warning', 'cnt_warning',
'cnt_warning_hard', 'cnt_warning_hard',
'cnt_ok', 'cnt_ok',
'host_name',
'service_description',
'timestamp',
'servicegroup_name',
'hostgroup_name'
); );
} }
@ -39,4 +44,9 @@ class Eventgrid extends DataView
) )
); );
} }
public function getFilterColumns()
{
return array('host', 'service', 'hostgroup', 'servicegroup');
}
} }

View File

@ -13,9 +13,9 @@ class Groupsummary extends DataView
public function getColumns() public function getColumns()
{ {
return array( return array(
'servicegroup', 'servicegroup_name',
'servicegroup_alias', 'servicegroup_alias',
'hostgroup', 'hostgroup_name',
'hostgroup_alias', 'hostgroup_alias',
'hosts_up', 'hosts_up',
'hosts_unreachable', 'hosts_unreachable',

View File

@ -21,7 +21,6 @@ class HostStatus extends DataView
public function getColumns() public function getColumns()
{ {
return array( return array(
'host',
'host_name', 'host_name',
'host_display_name', 'host_display_name',
'host_alias', 'host_alias',
@ -114,7 +113,7 @@ class HostStatus extends DataView
public function getFilterColumns() public function getFilterColumns()
{ {
return array('hostgroup', 'service_problems', 'servicegroup'); return array('host', 'hostgroup', 'hostgroup_name', 'service', 'servicegroup', 'servicegroup_name');
} }
public function isValidFilterTarget($column) public function isValidFilterTarget($column)

View File

@ -1,7 +1,6 @@
<?php <?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ /* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
namespace Icinga\Module\Monitoring\DataView; namespace Icinga\Module\Monitoring\DataView;
/** /**
@ -17,9 +16,10 @@ class Hostgroup extends DataView
public function getColumns() public function getColumns()
{ {
return array( return array(
'host',
'hostgroup_name', 'hostgroup_name',
'hostgroup_alias' 'hostgroup_alias',
'hostgroup_id',
'host_name'
); );
} }
@ -33,7 +33,15 @@ class Hostgroup extends DataView
return array( return array(
'hostgroup_name' => array( 'hostgroup_name' => array(
'order' => self::SORT_ASC 'order' => self::SORT_ASC
),
'hostgroup_alias' => array(
'order' => self::SORT_ASC
) )
); );
} }
public function getFilterColumns()
{
return array('hostgroup', 'host');
}
} }

View File

@ -13,11 +13,11 @@ class Notification extends DataView
public function getColumns() public function getColumns()
{ {
return array( return array(
'host', 'host_name',
'service', 'service_description',
'notification_state', 'notification_state',
'notification_start_time', 'notification_start_time',
'notification_contact', 'notification_contact_name',
'notification_output', 'notification_output',
'notification_command', 'notification_command',
'host_display_name', 'host_display_name',
@ -34,4 +34,9 @@ class Notification extends DataView
) )
); );
} }
public function getFilterColumns()
{
return array('host', 'service', 'contact');
}
} }

View File

@ -72,7 +72,6 @@ class ServiceStatus extends DataView
'host_action_url', 'host_action_url',
'host_notes_url', 'host_notes_url',
'host_last_comment', 'host_last_comment',
'host',
'host_display_name', 'host_display_name',
'host_alias', 'host_alias',
'host_ipv4', 'host_ipv4',
@ -87,7 +86,6 @@ class ServiceStatus extends DataView
'host_last_time_down', 'host_last_time_down',
'host_last_time_unreachable', 'host_last_time_unreachable',
'host_modified_host_attributes', 'host_modified_host_attributes',
'service',
'service_hard_state', 'service_hard_state',
'service_problem', 'service_problem',
'service_perfdata', 'service_perfdata',
@ -165,7 +163,15 @@ class ServiceStatus extends DataView
public function getFilterColumns() public function getFilterColumns()
{ {
return array('hostgroup', 'servicegroup', 'service_problems'); return array(
'host',
'hostgroup',
'hostgroup_name',
'service',
'service_host',
'servicegroup',
'servicegroup_name'
);
} }
public function isValidFilterTarget($column) public function isValidFilterTarget($column)

View File

@ -1,10 +1,8 @@
<?php <?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ /* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
namespace Icinga\Module\Monitoring\DataView; namespace Icinga\Module\Monitoring\DataView;
class Servicegroup extends DataView class Servicegroup extends DataView
{ {
/** /**
@ -15,10 +13,11 @@ class Servicegroup extends DataView
public function getColumns() public function getColumns()
{ {
return array( return array(
'service',
'host',
'servicegroup_name', 'servicegroup_name',
'servicegroup_alias' 'servicegroup_alias',
'host_name',
'service_host_name',
'service_description'
); );
} }
@ -32,7 +31,15 @@ class Servicegroup extends DataView
return array( return array(
'servicegroup_name' => array( 'servicegroup_name' => array(
'order' => self::SORT_ASC 'order' => self::SORT_ASC
),
'servicegroup_alias' => array(
'order' => self::SORT_ASC
) )
); );
} }
public function getFilterColumns()
{
return array('servicegroup', 'host', 'service');
}
} }

View File

@ -248,7 +248,7 @@ abstract class MonitoredObject implements Filterable
$comments = $this->backend->select()->from('comment', array( $comments = $this->backend->select()->from('comment', array(
'id' => 'comment_internal_id', 'id' => 'comment_internal_id',
'timestamp' => 'comment_timestamp', 'timestamp' => 'comment_timestamp',
'author' => 'comment_author', 'author' => 'comment_author_name',
'comment' => 'comment_data', 'comment' => 'comment_data',
'type' => 'comment_type', 'type' => 'comment_type',
)) ))
@ -276,7 +276,7 @@ abstract class MonitoredObject implements Filterable
'id' => 'downtime_internal_id', 'id' => 'downtime_internal_id',
'objecttype' => 'downtime_objecttype', 'objecttype' => 'downtime_objecttype',
'comment' => 'downtime_comment', 'comment' => 'downtime_comment',
'author' => 'downtime_author', 'author_name' => 'downtime_author_name',
'start' => 'downtime_start', 'start' => 'downtime_start',
'scheduled_start' => 'downtime_scheduled_start', 'scheduled_start' => 'downtime_scheduled_start',
'end' => 'downtime_end', 'end' => 'downtime_end',
@ -556,11 +556,14 @@ abstract class MonitoredObject implements Filterable
*/ */
public static function fromParams(UrlParams $params) public static function fromParams(UrlParams $params)
{ {
if ($params->has('service') && $params->has('host')) { if ($params->has('service_description') && $params->has('host_name')) {
return new Service(MonitoringBackend::instance(), $params->get('host'), $params->get('service')); return new Service(
} elseif ($params->has('host')) { MonitoringBackend::instance(),
return new Host(MonitoringBackend::instance(), $params->get('host')); $params->get('host_name'),
} $params->get('service_description')
return null; );
} elseif ($params->has('host_name')) {
return new Host(MonitoringBackend::instance(), $params->get('host_name'));
}
} }
} }

View File

@ -167,13 +167,13 @@ abstract class MonitoredObjectController extends Controller
if ($object->getType() === $object::TYPE_HOST) { if ($object->getType() === $object::TYPE_HOST) {
$isService = false; $isService = false;
$params = array( $params = array(
'host' => $object->getName() 'host_name' => $object->getName()
); );
} else { } else {
$isService = true; $isService = true;
$params = array( $params = array(
'host' => $object->getHost()->getName(), 'host_name' => $object->getHost()->getName(),
'service' => $object->getName() 'service_description' => $object->getName()
); );
} }
$tabs->add( $tabs->add(