From b449127680d55d6df8cfad4cfb1a7e8b585b2b3c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 8 Apr 2015 14:40:34 +0200 Subject: [PATCH 01/80] Do not adjust the collation when querying host names refs #8613 --- .../library/Monitoring/Backend/Ido/Query/StatusQuery.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php index 0fb799f48..3f7bcf286 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php @@ -35,7 +35,7 @@ class StatusQuery extends IdoQuery protected $columnMap = array( 'hosts' => array( '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_alias' => 'h.alias', 'host_address' => 'h.address', @@ -168,7 +168,8 @@ class StatusQuery extends IdoQuery 'servicegroup_alias' => 'sg.alias' ), '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_description' => 'so.name2 COLLATE latin1_general_ci', 'service_display_name' => 's.display_name', From 98c76a693ea796db8c3c7440f7c7958dfd8a1baa Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 8 Apr 2015 14:41:13 +0200 Subject: [PATCH 02/80] Do not adjust the collation when querying service descriptions refs #8613 --- .../library/Monitoring/Backend/Ido/Query/StatusQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php index 3f7bcf286..e78d5c98e 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php @@ -171,7 +171,7 @@ class StatusQuery extends IdoQuery 'service_host' => 'so.name1 COLLATE latin1_general_ci', 'service_host_name' => 'so.name1', '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_icon_image' => 's.icon_image', 'service_action_url' => 's.action_url', From c476ee68552f4c67df13eb9e8897442d296efdb5 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 8 Apr 2015 14:42:57 +0200 Subject: [PATCH 03/80] Add an additional column for hostgroup names with unchanged collation refs #8613 --- .../library/Monitoring/Backend/Ido/Query/StatusQuery.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php index e78d5c98e..3c6a31793 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php @@ -161,6 +161,7 @@ class StatusQuery extends IdoQuery ), 'hostgroups' => array( 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', + 'hostgroup_name' => 'hgo.name1', 'hostgroup_alias' => 'hg.alias' ), 'servicegroups' => array( From 9557585f6a5b1cfa9ffa23c567164f65fc88bee0 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 8 Apr 2015 14:49:18 +0200 Subject: [PATCH 04/80] Add an additional column for servicegroup names with unchanged collation refs #8613 --- .../library/Monitoring/Backend/Ido/Query/StatusQuery.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php index 3c6a31793..17a12259e 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php @@ -166,6 +166,7 @@ class StatusQuery extends IdoQuery ), 'servicegroups' => array( 'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci', + 'servicegroup_name' => 'sgo.name1', 'servicegroup_alias' => 'sg.alias' ), 'services' => array( From c56c5655bd7bc3054c1a4c65971153443646d02a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 8 Apr 2015 14:51:04 +0200 Subject: [PATCH 05/80] Do not permit querying columns with changed collation and a valid alternative refs #8613 --- modules/monitoring/library/Monitoring/DataView/HostStatus.php | 3 +-- .../monitoring/library/Monitoring/DataView/ServiceStatus.php | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/monitoring/library/Monitoring/DataView/HostStatus.php b/modules/monitoring/library/Monitoring/DataView/HostStatus.php index 020da34c1..74bc39c82 100644 --- a/modules/monitoring/library/Monitoring/DataView/HostStatus.php +++ b/modules/monitoring/library/Monitoring/DataView/HostStatus.php @@ -21,7 +21,6 @@ class HostStatus extends DataView public function getColumns() { return array( - 'host', 'host_name', 'host_display_name', 'host_alias', @@ -114,7 +113,7 @@ class HostStatus extends DataView public function getFilterColumns() { - return array('hostgroup', 'service_problems', 'servicegroup'); + return array('host', 'hostgroup', 'service', 'servicegroup'); } public function isValidFilterTarget($column) diff --git a/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php b/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php index d04191068..ec13abac9 100644 --- a/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php +++ b/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php @@ -72,7 +72,6 @@ class ServiceStatus extends DataView 'host_action_url', 'host_notes_url', 'host_last_comment', - 'host', 'host_display_name', 'host_alias', 'host_ipv4', @@ -87,7 +86,6 @@ class ServiceStatus extends DataView 'host_last_time_down', 'host_last_time_unreachable', 'host_modified_host_attributes', - 'service', 'service_hard_state', 'service_problem', 'service_perfdata', @@ -165,7 +163,7 @@ class ServiceStatus extends DataView public function getFilterColumns() { - return array('hostgroup', 'servicegroup', 'service_problems'); + return array('host', 'hostgroup', 'service', 'service_host', 'servicegroup'); } public function isValidFilterTarget($column) From e94c99e20ef26a1225b4deb7c2bcf22f329f368f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 8 Apr 2015 14:57:08 +0200 Subject: [PATCH 06/80] Use `host' instead of `host_name' when searching for hosts refs #8613 --- library/Icinga/Web/Widget/FilterEditor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/Web/Widget/FilterEditor.php b/library/Icinga/Web/Widget/FilterEditor.php index 2575ce264..76246bf2f 100644 --- a/library/Icinga/Web/Widget/FilterEditor.php +++ b/library/Icinga/Web/Widget/FilterEditor.php @@ -186,7 +186,7 @@ class FilterEditor extends AbstractWidget $searchCol = 'service_description'; break; case 'hosts': - $searchCol = 'host_name'; + $searchCol = 'host'; break; case 'hostgroups': $searchCol = 'hostgroup'; From 55e94073714731d2ed934a72b13ca764e23c7e04 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 8 Apr 2015 14:57:30 +0200 Subject: [PATCH 07/80] Use `service' instead of `service_description' when searching for services refs #8613 --- library/Icinga/Web/Widget/FilterEditor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/Web/Widget/FilterEditor.php b/library/Icinga/Web/Widget/FilterEditor.php index 76246bf2f..ad9b1b5b2 100644 --- a/library/Icinga/Web/Widget/FilterEditor.php +++ b/library/Icinga/Web/Widget/FilterEditor.php @@ -183,7 +183,7 @@ class FilterEditor extends AbstractWidget // TODO: Ask the view for (multiple) search columns switch($request->getActionName()) { case 'services': - $searchCol = 'service_description'; + $searchCol = 'service'; break; case 'hosts': $searchCol = 'host'; From 13596ec70f6186db9bd93a44cd49585c58bab3ff Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 8 Apr 2015 15:21:16 +0200 Subject: [PATCH 08/80] ShowController: Remove obsolete use statements --- modules/monitoring/application/controllers/ShowController.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 4550b20ae..d10fc678f 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -1,7 +1,6 @@ Date: Wed, 8 Apr 2015 16:25:29 +0200 Subject: [PATCH 09/80] Require `host_name' instead of `host' to show or list particular objects `host' implies that it is possible to provide case-less identifiers which is *not* possible. refs #8613 --- doc/accessibility/link-labels.html | 2 +- .../monitoring/application/controllers/HostController.php | 2 +- .../application/controllers/ServiceController.php | 2 +- .../monitoring/application/controllers/ShowController.php | 6 +++--- modules/monitoring/application/views/helpers/Link.php | 4 ++-- .../monitoring/application/views/helpers/PluginOutput.php | 2 +- .../monitoring/application/views/scripts/list/hosts.phtml | 4 ++-- .../application/views/scripts/list/servicegrid.phtml | 6 +++--- .../application/views/scripts/list/services.phtml | 8 ++++---- .../views/scripts/partials/host/servicesummary.phtml | 2 +- .../application/views/scripts/show/history.phtml | 4 ++-- .../library/Monitoring/Object/MonitoredObject.php | 8 ++++---- .../Web/Controller/MonitoredObjectController.php | 4 ++-- 13 files changed, 27 insertions(+), 27 deletions(-) diff --git a/doc/accessibility/link-labels.html b/doc/accessibility/link-labels.html index 439adb85e..a65b909de 100644 --- a/doc/accessibility/link-labels.html +++ b/doc/accessibility/link-labels.html @@ -8,7 +8,7 @@ - localhost diff --git a/modules/monitoring/application/controllers/HostController.php b/modules/monitoring/application/controllers/HostController.php index 11179c1fa..5b336a26b 100644 --- a/modules/monitoring/application/controllers/HostController.php +++ b/modules/monitoring/application/controllers/HostController.php @@ -26,7 +26,7 @@ class Monitoring_HostController extends MonitoredObjectController */ 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); diff --git a/modules/monitoring/application/controllers/ServiceController.php b/modules/monitoring/application/controllers/ServiceController.php index 3dc98c3b8..4f9bdeb1a 100644 --- a/modules/monitoring/application/controllers/ServiceController.php +++ b/modules/monitoring/application/controllers/ServiceController.php @@ -25,7 +25,7 @@ class Monitoring_ServiceController extends MonitoredObjectController */ 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')); $this->applyRestriction('monitoring/services/filter', $service); diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index d10fc678f..475e80b4f 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -188,12 +188,12 @@ class Monitoring_ShowController extends Controller if ($object->getType() === $object::TYPE_HOST) { $isService = false; $params = array( - 'host' => $object->getName() + 'host_name' => $object->getName() ); } else { $isService = true; $params = array( - 'host' => $object->getHost()->getName(), + 'host_name' => $object->getHost()->getName(), 'service' => $object->getName() ); } @@ -207,7 +207,7 @@ class Monitoring_ShowController extends Controller ), 'label' => $this->translate('Host'), 'icon' => 'host', - 'url' => 'monitoring/show/host', + 'url' => 'monitoring/host/show', 'urlParams' => $params, ) ); diff --git a/modules/monitoring/application/views/helpers/Link.php b/modules/monitoring/application/views/helpers/Link.php index 8faf6e5fb..454d37682 100644 --- a/modules/monitoring/application/views/helpers/Link.php +++ b/modules/monitoring/application/views/helpers/Link.php @@ -33,7 +33,7 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract return $this->view->qlink( $linkText, 'monitoring/host/show', - array('host' => $host), + array('host_name' => $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( $serviceLinkText, 'monitoring/service/show', - array('host' => $host, 'service' => $service), + array('host_name' => $host, 'service' => $service), array('title' => sprintf( $this->view->translate('Show detailed information for service %s on host %s'), $service, diff --git a/modules/monitoring/application/views/helpers/PluginOutput.php b/modules/monitoring/application/views/helpers/PluginOutput.php index d494a7810..8778d01b3 100644 --- a/modules/monitoring/application/views/helpers/PluginOutput.php +++ b/modules/monitoring/application/views/helpers/PluginOutput.php @@ -65,7 +65,7 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract parse_str($m[1], $params); if (isset($params['host'])) { $tag->setAttribute('href', $this->view->baseUrl( - '/monitoring/host/show?host=' . urlencode($params['host'] + '/monitoring/host/show?host_name=' . urlencode($params['host'] ))); } } else { diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index f5689c927..bdd88a1e9 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -42,7 +42,7 @@ if ($hosts->count() === 0) { 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(); if (! $host->host_handled && $host->host_state > 0){ @@ -112,7 +112,7 @@ if ($hosts->count() === 0) { ), 'monitoring/show/services', array( - 'host' => $host->host_name, + 'host_name' => $host->host_name, 'service_problem' => 1, 'service_handled' => 0 ), diff --git a/modules/monitoring/application/views/scripts/list/servicegrid.phtml b/modules/monitoring/application/views/scripts/list/servicegrid.phtml index a102c36eb..9a37a52c5 100644 --- a/modules/monitoring/application/views/scripts/list/servicegrid.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegrid.phtml @@ -68,7 +68,7 @@ foreach ($serviceDescriptions as $service_description): ?> qlink( $host_name, '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)) ); ?> @@ -80,9 +80,9 @@ foreach ($serviceDescriptions as $service_description): ?> qlink( '', - 'monitoring/show/service', + 'monitoring/service/show', array( - 'host' => $service->host_name, + 'host_name' => $service->host_name, 'service' => $service->service_description ), array( diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index 3b17e1b63..f3e76e9d0 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -42,14 +42,14 @@ foreach ($services as $service): $serviceLink = $this->href( 'monitoring/service/show', array( - 'host' => $service->host_name, - 'service' => $service->service_description + 'host_name' => $service->host_name, + 'service' => $service->service_description ) ); $hostLink = $this->href( - 'monitoring/show/host', + 'monitoring/host/show', array( - 'host' => $service->host_name, + 'host_name' => $service->host_name, ) ); $serviceStateName = Service::getStateText($service->service_state); diff --git a/modules/monitoring/application/views/scripts/partials/host/servicesummary.phtml b/modules/monitoring/application/views/scripts/partials/host/servicesummary.phtml index c0acdead4..23cc21e97 100644 --- a/modules/monitoring/application/views/scripts/partials/host/servicesummary.phtml +++ b/modules/monitoring/application/views/scripts/partials/host/servicesummary.phtml @@ -3,7 +3,7 @@ use Icinga\Web\Url; 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(); ?>
compact ? ' data-base-target="col1"' : ''; ?>> stats->services_total): ?> diff --git a/modules/monitoring/application/views/scripts/show/history.phtml b/modules/monitoring/application/views/scripts/show/history.phtml index 0542294d6..53425b9d9 100644 --- a/modules/monitoring/application/views/scripts/show/history.phtml +++ b/modules/monitoring/application/views/scripts/show/history.phtml @@ -144,8 +144,8 @@ $output = $this->tickets ? preg_replace_callback( $event->service_display_name, 'monitoring/show/service', array( - 'host' => $event->host_name, - 'service' => $event->service_description + 'host_name' => $event->host_name, + 'service' => $event->service_description ), array('title' => sprintf( $this->translate('Show detailed information for service %s on host %s'), diff --git a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php index 87a0cdaf4..9361843e3 100644 --- a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php +++ b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php @@ -556,10 +556,10 @@ abstract class MonitoredObject implements Filterable */ public static function fromParams(UrlParams $params) { - if ($params->has('service') && $params->has('host')) { - return new Service(MonitoringBackend::instance(), $params->get('host'), $params->get('service')); - } elseif ($params->has('host')) { - return new Host(MonitoringBackend::instance(), $params->get('host')); + if ($params->has('service') && $params->has('host_name')) { + return new Service(MonitoringBackend::instance(), $params->get('host_name'), $params->get('service')); + } elseif ($params->has('host_name')) { + return new Host(MonitoringBackend::instance(), $params->get('host_name')); } return null; } diff --git a/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php b/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php index 04102e9d2..3f71cb2c0 100644 --- a/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php +++ b/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php @@ -167,12 +167,12 @@ abstract class MonitoredObjectController extends Controller if ($object->getType() === $object::TYPE_HOST) { $isService = false; $params = array( - 'host' => $object->getName() + 'host_name' => $object->getName() ); } else { $isService = true; $params = array( - 'host' => $object->getHost()->getName(), + 'host_name' => $object->getHost()->getName(), 'service' => $object->getName() ); } From 09ab6019423e858d222a570c65f247bfcb09e62f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 8 Apr 2015 16:49:52 +0200 Subject: [PATCH 10/80] Require `service_description' instead of `service' to show a particular service `service' implies that it is possible to provide case-less identifiers which is *not* possible. refs #8613 --- .../application/controllers/ServiceController.php | 6 +++++- .../application/controllers/ShowController.php | 6 +++--- modules/monitoring/application/views/helpers/Link.php | 2 +- .../application/views/scripts/list/servicegrid.phtml | 4 ++-- .../application/views/scripts/list/services.phtml | 4 ++-- .../application/views/scripts/show/history.phtml | 6 +++--- .../library/Monitoring/Object/MonitoredObject.php | 9 ++++++--- .../Web/Controller/MonitoredObjectController.php | 4 ++-- 8 files changed, 24 insertions(+), 17 deletions(-) diff --git a/modules/monitoring/application/controllers/ServiceController.php b/modules/monitoring/application/controllers/ServiceController.php index 4f9bdeb1a..86579343f 100644 --- a/modules/monitoring/application/controllers/ServiceController.php +++ b/modules/monitoring/application/controllers/ServiceController.php @@ -25,7 +25,11 @@ class Monitoring_ServiceController extends MonitoredObjectController */ public function init() { - $service = new Service($this->backend, $this->params->get('host_name'), $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); diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 475e80b4f..b5ffc0535 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -193,8 +193,8 @@ class Monitoring_ShowController extends Controller } else { $isService = true; $params = array( - 'host_name' => $object->getHost()->getName(), - 'service' => $object->getName() + 'host_name' => $object->getHost()->getName(), + 'service_description' => $object->getName() ); } $tabs = $this->getTabs(); @@ -222,7 +222,7 @@ class Monitoring_ShowController extends Controller ), 'label' => $this->translate('Service'), 'icon' => 'service', - 'url' => 'monitoring/show/service', + 'url' => 'monitoring/service/show', 'urlParams' => $params, ) ); diff --git a/modules/monitoring/application/views/helpers/Link.php b/modules/monitoring/application/views/helpers/Link.php index 454d37682..7f1324573 100644 --- a/modules/monitoring/application/views/helpers/Link.php +++ b/modules/monitoring/application/views/helpers/Link.php @@ -55,7 +55,7 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract $this->view->qlink( $serviceLinkText, 'monitoring/service/show', - array('host_name' => $host, 'service' => $service), + array('host_name' => $host, 'service_description' => $service), array('title' => sprintf( $this->view->translate('Show detailed information for service %s on host %s'), $service, diff --git a/modules/monitoring/application/views/scripts/list/servicegrid.phtml b/modules/monitoring/application/views/scripts/list/servicegrid.phtml index 9a37a52c5..a2e7502ea 100644 --- a/modules/monitoring/application/views/scripts/list/servicegrid.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegrid.phtml @@ -82,8 +82,8 @@ foreach ($serviceDescriptions as $service_description): ?> '', 'monitoring/service/show', array( - 'host_name' => $service->host_name, - 'service' => $service->service_description + 'host_name' => $service->host_name, + 'service_description' => $service->service_description ), array( 'aria-describedby' => $service->host_name . '_' . $service->service_description . '_desc', diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index f3e76e9d0..3dd0b060d 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -42,8 +42,8 @@ foreach ($services as $service): $serviceLink = $this->href( 'monitoring/service/show', array( - 'host_name' => $service->host_name, - 'service' => $service->service_description + 'host_name' => $service->host_name, + 'service_description' => $service->service_description ) ); $hostLink = $this->href( diff --git a/modules/monitoring/application/views/scripts/show/history.phtml b/modules/monitoring/application/views/scripts/show/history.phtml index 53425b9d9..149eb0ecc 100644 --- a/modules/monitoring/application/views/scripts/show/history.phtml +++ b/modules/monitoring/application/views/scripts/show/history.phtml @@ -142,10 +142,10 @@ $output = $this->tickets ? preg_replace_callback( $this->translate('%s on %s', 'Service running on host'), $hostContext ? $this->qlink( $event->service_display_name, - 'monitoring/show/service', + 'monitoring/service/show', array( - 'host_name' => $event->host_name, - 'service' => $event->service_description + 'host_name' => $event->host_name, + 'service_description' => $event->service_description ), array('title' => sprintf( $this->translate('Show detailed information for service %s on host %s'), diff --git a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php index 9361843e3..621c25c75 100644 --- a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php +++ b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php @@ -556,11 +556,14 @@ abstract class MonitoredObject implements Filterable */ public static function fromParams(UrlParams $params) { - if ($params->has('service') && $params->has('host_name')) { - return new Service(MonitoringBackend::instance(), $params->get('host_name'), $params->get('service')); + if ($params->has('service_description') && $params->has('host_name')) { + return new Service( + MonitoringBackend::instance(), + $params->get('host_name'), + $params->get('service_description') + ); } elseif ($params->has('host_name')) { return new Host(MonitoringBackend::instance(), $params->get('host_name')); } - return null; } } diff --git a/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php b/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php index 3f71cb2c0..de0c3fbfe 100644 --- a/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php +++ b/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php @@ -172,8 +172,8 @@ abstract class MonitoredObjectController extends Controller } else { $isService = true; $params = array( - 'host_name' => $object->getHost()->getName(), - 'service' => $object->getName() + 'host_name' => $object->getHost()->getName(), + 'service_description' => $object->getName() ); } $tabs->add( From b9aee47d1f44893ef953bf9168e21f368b95ed7f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 10:27:41 +0200 Subject: [PATCH 11/80] Adjust command links so that they'll use `host_name' instead of `host' refs #8613 --- .../monitoring/application/views/scripts/list/comments.phtml | 4 ++-- .../monitoring/application/views/scripts/list/downtimes.phtml | 4 ++-- .../views/scripts/show/components/acknowledgement.phtml | 4 ++-- .../views/scripts/show/components/checkstatistics.phtml | 4 ++-- .../application/views/scripts/show/components/command.phtml | 4 ++-- .../application/views/scripts/show/components/comments.phtml | 4 ++-- .../application/views/scripts/show/components/downtime.phtml | 4 ++-- .../views/scripts/show/components/notifications.phtml | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/comments.phtml b/modules/monitoring/application/views/scripts/list/comments.phtml index 6f49bf4a8..4071ce7ff 100644 --- a/modules/monitoring/application/views/scripts/list/comments.phtml +++ b/modules/monitoring/application/views/scripts/list/comments.phtml @@ -81,9 +81,9 @@ $delCommentForm = clone $delCommentForm; $delCommentForm->populate(array('comment_id' => $comment->id, 'redirect' => $this->url)); 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))); } 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, 'service' => $comment->service))); } echo $delCommentForm; ?> diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index 1fbaa713f..0b3b0a9c0 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -120,9 +120,9 @@ use Icinga\Module\Monitoring\Object\Service; $delDowntimeForm = clone $delDowntimeForm; $delDowntimeForm->populate(array('downtime_id' => $downtime->id, 'redirect' => $this->url)); if (! isset($downtime->service)) { - $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))); } 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, 'service' => $downtime->service))); } echo $delDowntimeForm; ?> diff --git a/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml b/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml index e7b79354d..588be561c 100644 --- a/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml +++ b/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml @@ -26,12 +26,12 @@ if ($object->acknowledged): ?> if ($object->getType() === $object::TYPE_HOST) { $ackLink = $this->href( 'monitoring/host/acknowledge-problem', - array('host' => $object->getName()) + array('host_name' => $object->getName()) ); } else { $ackLink = $this->href( 'monitoring/service/acknowledge-problem', - array('host' => $object->getHost()->getName(), 'service' => $object->getName()) + array('host_name' => $object->getHost()->getName(), 'service' => $object->getName()) ); } ?> diff --git a/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml index 2a4e4b033..ef1432565 100644 --- a/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml +++ b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml @@ -31,7 +31,7 @@ if ($object->getType() === $object::TYPE_HOST) { echo $this->qlink( $this->translate('Reschedule'), 'monitoring/service/reschedule-check', - array('host' => $object->getHost()->getName(), 'service' => $object->getName()), + array('host_name' => $object->getHost()->getName(), 'service' => $object->getName()), array( 'icon' => 'reschedule', 'data-base-target' => '_self', @@ -44,7 +44,7 @@ if ($object->getType() === $object::TYPE_HOST) { echo $this->qlink( $this->translate('Reschedule'), 'monitoring/host/reschedule-check', - array('host' => $object->getName()), + array('host_name' => $object->getName()), array( 'icon' => 'reschedule', 'data-base-target' => '_self', diff --git a/modules/monitoring/application/views/scripts/show/components/command.phtml b/modules/monitoring/application/views/scripts/show/components/command.phtml index d7fca7cfa..3068c8e1d 100644 --- a/modules/monitoring/application/views/scripts/show/components/command.phtml +++ b/modules/monitoring/application/views/scripts/show/components/command.phtml @@ -15,7 +15,7 @@ $command = array_shift($parts); echo $this->qlink( $this->translate('Process check result'), 'monitoring/host/process-check-result', - array('host' => $object->getName()), + array('host_name' => $object->getName()), array( 'icon' => 'reply', 'data-base-target' => '_self', @@ -26,7 +26,7 @@ $command = array_shift($parts); echo $this->qlink( $this->translate('Process check result'), 'monitoring/service/process-check-result', - array('host' => $object->getHost()->getName(), 'service' => $object->getName()), + array('host_name' => $object->getHost()->getName(), 'service' => $object->getName()), array( 'icon' => 'reply', 'data-base-target' => '_self', diff --git a/modules/monitoring/application/views/scripts/show/components/comments.phtml b/modules/monitoring/application/views/scripts/show/components/comments.phtml index 5a4d351c0..adeef6200 100644 --- a/modules/monitoring/application/views/scripts/show/components/comments.phtml +++ b/modules/monitoring/application/views/scripts/show/components/comments.phtml @@ -7,7 +7,7 @@ echo $this->qlink( $this->translate('Add comment'), 'monitoring/host/add-comment', - array('host' => $object->getName()), + array('host_name' => $object->getName()), array( 'icon' => 'comment', 'data-base-target' => '_self', @@ -18,7 +18,7 @@ echo $this->qlink( $this->translate('Add comment'), 'monitoring/service/add-comment', - array('host' => $object->getHost()->getName(), 'service' => $object->getName()), + array('host_name' => $object->getHost()->getName(), 'service' => $object->getName()), array( 'icon' => 'comment', 'data-base-target' => '_self', diff --git a/modules/monitoring/application/views/scripts/show/components/downtime.phtml b/modules/monitoring/application/views/scripts/show/components/downtime.phtml index 3804a400b..9d5d53c16 100644 --- a/modules/monitoring/application/views/scripts/show/components/downtime.phtml +++ b/modules/monitoring/application/views/scripts/show/components/downtime.phtml @@ -7,7 +7,7 @@ echo $this->qlink( $this->translate('Schedule downtime'), 'monitoring/host/schedule-downtime', - array('host' => $object->getName()), + array('host_name' => $object->getName()), array( 'icon' => 'plug', 'data-base-target' => '_self', @@ -20,7 +20,7 @@ echo $this->qlink( $this->translate('Schedule downtime'), 'monitoring/service/schedule-downtime', - array('host' => $object->getHost()->getName(), 'service' => $object->getName()), + array('host_name' => $object->getHost()->getName(), 'service' => $object->getName()), array( 'icon' => 'plug', 'data-base-target' => '_self', diff --git a/modules/monitoring/application/views/scripts/show/components/notifications.phtml b/modules/monitoring/application/views/scripts/show/components/notifications.phtml index af57eb934..fa4314620 100644 --- a/modules/monitoring/application/views/scripts/show/components/notifications.phtml +++ b/modules/monitoring/application/views/scripts/show/components/notifications.phtml @@ -5,12 +5,12 @@ if ($object->getType() === $object::TYPE_HOST) { $ackLink = $this->href( 'monitoring/host/send-custom-notification', - array('host' => $object->getName()) + array('host_name' => $object->getName()) ); } else { $ackLink = $this->href( 'monitoring/service/send-custom-notification', - array('host' => $object->getHost()->getName(), 'service' => $object->getName()) + array('host_name' => $object->getHost()->getName(), 'service' => $object->getName()) ); } ?> From cee189a5fc2b94173eda5587ab5a5ce4125a06d0 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 10:28:34 +0200 Subject: [PATCH 12/80] Adjust command links so that they'll use `service_description' ...instead of `service' refs #8613 --- .../monitoring/application/views/scripts/list/comments.phtml | 5 ++++- .../application/views/scripts/list/downtimes.phtml | 5 ++++- .../views/scripts/show/components/acknowledgement.phtml | 2 +- .../views/scripts/show/components/checkstatistics.phtml | 2 +- .../application/views/scripts/show/components/command.phtml | 2 +- .../application/views/scripts/show/components/comments.phtml | 2 +- .../application/views/scripts/show/components/downtime.phtml | 2 +- .../views/scripts/show/components/notifications.phtml | 2 +- 8 files changed, 14 insertions(+), 8 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/comments.phtml b/modules/monitoring/application/views/scripts/list/comments.phtml index 4071ce7ff..12668eefd 100644 --- a/modules/monitoring/application/views/scripts/list/comments.phtml +++ b/modules/monitoring/application/views/scripts/list/comments.phtml @@ -83,7 +83,10 @@ if ($comment->objecttype === 'host') { $delCommentForm->setAction($this->url('monitoring/host/delete-comment', array('host_name' => $comment->host))); } else { - $delCommentForm->setAction($this->url('monitoring/service/delete-comment', array('host_name' => $comment->host, 'service' => $comment->service))); + $delCommentForm->setAction($this->url('monitoring/service/delete-comment', array( + 'host_name' => $comment->host, + 'service_description' => $comment->service + ))); } echo $delCommentForm; ?> diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index 0b3b0a9c0..00d9c7f90 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -122,7 +122,10 @@ use Icinga\Module\Monitoring\Object\Service; if (! isset($downtime->service)) { $delDowntimeForm->setAction($this->url('monitoring/host/delete-downtime', array('host_name' => $downtime->host))); } else { - $delDowntimeForm->setAction($this->url('monitoring/service/delete-downtime', array('host_name' => $downtime->host, 'service' => $downtime->service))); + $delDowntimeForm->setAction($this->url('monitoring/service/delete-downtime', array( + 'host_name' => $downtime->host, + 'service_description' => $downtime->service + ))); } echo $delDowntimeForm; ?> diff --git a/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml b/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml index 588be561c..b91807d4f 100644 --- a/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml +++ b/modules/monitoring/application/views/scripts/show/components/acknowledgement.phtml @@ -31,7 +31,7 @@ if ($object->acknowledged): ?> } else { $ackLink = $this->href( 'monitoring/service/acknowledge-problem', - array('host_name' => $object->getHost()->getName(), 'service' => $object->getName()) + array('host_name' => $object->getHost()->getName(), 'service_description' => $object->getName()) ); } ?> diff --git a/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml index ef1432565..8fbdb9059 100644 --- a/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml +++ b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml @@ -31,7 +31,7 @@ if ($object->getType() === $object::TYPE_HOST) { echo $this->qlink( $this->translate('Reschedule'), 'monitoring/service/reschedule-check', - array('host_name' => $object->getHost()->getName(), 'service' => $object->getName()), + array('host_name' => $object->getHost()->getName(), 'service_description' => $object->getName()), array( 'icon' => 'reschedule', 'data-base-target' => '_self', diff --git a/modules/monitoring/application/views/scripts/show/components/command.phtml b/modules/monitoring/application/views/scripts/show/components/command.phtml index 3068c8e1d..0b028ba71 100644 --- a/modules/monitoring/application/views/scripts/show/components/command.phtml +++ b/modules/monitoring/application/views/scripts/show/components/command.phtml @@ -26,7 +26,7 @@ $command = array_shift($parts); echo $this->qlink( $this->translate('Process check result'), 'monitoring/service/process-check-result', - array('host_name' => $object->getHost()->getName(), 'service' => $object->getName()), + array('host_name' => $object->getHost()->getName(), 'service_description' => $object->getName()), array( 'icon' => 'reply', 'data-base-target' => '_self', diff --git a/modules/monitoring/application/views/scripts/show/components/comments.phtml b/modules/monitoring/application/views/scripts/show/components/comments.phtml index adeef6200..61ae96517 100644 --- a/modules/monitoring/application/views/scripts/show/components/comments.phtml +++ b/modules/monitoring/application/views/scripts/show/components/comments.phtml @@ -18,7 +18,7 @@ echo $this->qlink( $this->translate('Add comment'), 'monitoring/service/add-comment', - array('host_name' => $object->getHost()->getName(), 'service' => $object->getName()), + array('host_name' => $object->getHost()->getName(), 'service_description' => $object->getName()), array( 'icon' => 'comment', 'data-base-target' => '_self', diff --git a/modules/monitoring/application/views/scripts/show/components/downtime.phtml b/modules/monitoring/application/views/scripts/show/components/downtime.phtml index 9d5d53c16..23c20e21f 100644 --- a/modules/monitoring/application/views/scripts/show/components/downtime.phtml +++ b/modules/monitoring/application/views/scripts/show/components/downtime.phtml @@ -20,7 +20,7 @@ echo $this->qlink( $this->translate('Schedule downtime'), 'monitoring/service/schedule-downtime', - array('host_name' => $object->getHost()->getName(), 'service' => $object->getName()), + array('host_name' => $object->getHost()->getName(), 'service_description' => $object->getName()), array( 'icon' => 'plug', 'data-base-target' => '_self', diff --git a/modules/monitoring/application/views/scripts/show/components/notifications.phtml b/modules/monitoring/application/views/scripts/show/components/notifications.phtml index fa4314620..dfed6d483 100644 --- a/modules/monitoring/application/views/scripts/show/components/notifications.phtml +++ b/modules/monitoring/application/views/scripts/show/components/notifications.phtml @@ -10,7 +10,7 @@ } else { $ackLink = $this->href( 'monitoring/service/send-custom-notification', - array('host_name' => $object->getHost()->getName(), 'service' => $object->getName()) + array('host_name' => $object->getHost()->getName(), 'service_description' => $object->getName()) ); } ?> From 7d984665d672f3c8be11eb23a7fc66088b2bc233 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 11:12:09 +0200 Subject: [PATCH 13/80] Use `host_name' to decide whether to show a service's host or not `host' might match multiple hosts even if no * is being part of the filter. refs #8613 --- .../monitoring/application/controllers/ListController.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 41e27ec45..8a9dc5fa4 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -170,10 +170,8 @@ class Monitoring_ListController extends Controller $this->addTitleTab('services', $this->translate('Services'), $this->translate('List services')); $this->view->showHost = true; - if ($host = $this->_getParam('host')) { - if (strpos($host, '*') === false) { - $this->view->showHost = false; - } + if (strpos($this->params->get('host_name', '*'), '*') === false) { + $this->view->showHost = false; } $this->setAutorefreshInterval(10); From f7550f55c173ff9e6e770fce135e6f7035faaf4a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 11:41:56 +0200 Subject: [PATCH 14/80] Permit to filter hosts and services by hostgroup_name and servicegroup_name refs #8613 --- .../library/Monitoring/DataView/HostStatus.php | 2 +- .../library/Monitoring/DataView/ServiceStatus.php | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/DataView/HostStatus.php b/modules/monitoring/library/Monitoring/DataView/HostStatus.php index 74bc39c82..23df6d94a 100644 --- a/modules/monitoring/library/Monitoring/DataView/HostStatus.php +++ b/modules/monitoring/library/Monitoring/DataView/HostStatus.php @@ -113,7 +113,7 @@ class HostStatus extends DataView public function getFilterColumns() { - return array('host', 'hostgroup', 'service', 'servicegroup'); + return array('host', 'hostgroup', 'hostgroup_name', 'service', 'servicegroup', 'servicegroup_name'); } public function isValidFilterTarget($column) diff --git a/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php b/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php index ec13abac9..b4f1038da 100644 --- a/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php +++ b/modules/monitoring/library/Monitoring/DataView/ServiceStatus.php @@ -163,7 +163,15 @@ class ServiceStatus extends DataView public function getFilterColumns() { - return array('host', 'hostgroup', 'service', 'service_host', 'servicegroup'); + return array( + 'host', + 'hostgroup', + 'hostgroup_name', + 'service', + 'service_host', + 'servicegroup', + 'servicegroup_name' + ); } public function isValidFilterTarget($column) From e5eca97169857e7286919629dde2db151a279c86 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 11:43:21 +0200 Subject: [PATCH 15/80] Use `hostgroup_name' instead of `hostgroup' to filter hosts and services refs #8613 --- .../views/scripts/list/hostgroups.phtml | 30 +++++++++---------- .../scripts/show/components/hostgroups.phtml | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/hostgroups.phtml b/modules/monitoring/application/views/scripts/list/hostgroups.phtml index c702197b2..94086f446 100644 --- a/modules/monitoring/application/views/scripts/list/hostgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/hostgroups.phtml @@ -28,7 +28,7 @@ - + services_critical_last_state_change_unhandled): ?> translate('CRITICAL'); ?> @@ -82,7 +82,7 @@ qlink( $h->hostgroup_alias, 'monitoring/list/hosts', - array('hostgroup' => $h->hostgroup), + array('hostgroup_name' => $h->hostgroup), array('title' => sprintf($this->translate('List all hosts in the group "%s"'), $h->hostgroup_alias)) ); ?> @@ -90,7 +90,7 @@ qlink( $h->services_total, 'monitoring/list/services', - array('hostgroup' => $h->hostgroup), + array('hostgroup_name' => $h->hostgroup), array('title' => sprintf( $this->translate('List all services of all hosts in host group "%s"'), $h->hostgroup_alias @@ -104,9 +104,9 @@ $h->services_ok, 'monitoring/list/services', array( - 'service_state' => 0, - 'hostgroup' => $h->hostgroup, - 'sort' => 'service_severity' + 'service_state' => 0, + 'hostgroup_name' => $h->hostgroup, + 'sort' => 'service_severity' ), array( 'title' => sprintf( @@ -132,7 +132,7 @@ 'service_acknowledged' => 0, 'service_in_downtime' => 0, 'host_problem' => 0, - 'hostgroup' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup, 'sort' => 'service_severity' ), array( @@ -156,7 +156,7 @@ array( 'service_state' => 2, 'service_handled' => 1, - 'hostgroup' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup, 'sort' => 'service_severity' ), array( @@ -186,7 +186,7 @@ 'service_acknowledged' => 0, 'service_in_downtime' => 0, 'host_problem' => 0, - 'hostgroup' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup, 'sort' => 'service_severity' ), array( @@ -210,7 +210,7 @@ array( 'service_state' => 3, 'service_handled' => 1, - 'hostgroup' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup, 'sort' => 'service_severity' ), array( @@ -240,7 +240,7 @@ 'service_acknowledged' => 0, 'service_in_downtime' => 0, 'host_problem' => 0, - 'hostgroup' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup, 'sort' => 'service_severity' ), array( @@ -264,7 +264,7 @@ array( 'service_state' => 1, 'service_handled' => 1, - 'hostgroup' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup, 'sort' => 'service_severity' ), array( @@ -290,9 +290,9 @@ $h->services_pending, 'monitoring/list/services', array( - 'service_state' => 99, - 'hostgroup' => $h->hostgroup, - 'sort' => 'service_severity' + 'service_state' => 99, + 'hostgroup_name' => $h->hostgroup, + 'sort' => 'service_severity' ), array( 'title' => sprintf( diff --git a/modules/monitoring/application/views/scripts/show/components/hostgroups.phtml b/modules/monitoring/application/views/scripts/show/components/hostgroups.phtml index eed1ea328..f4b20147d 100644 --- a/modules/monitoring/application/views/scripts/show/components/hostgroups.phtml +++ b/modules/monitoring/application/views/scripts/show/components/hostgroups.phtml @@ -7,7 +7,7 @@ foreach ($object->hostgroups as $name => $alias) { $list[] = $this->qlink( $alias, 'monitoring/list/hosts', - array('hostgroup' => $name), + array('hostgroup_name' => $name), array('title' => sprintf($this->translate('List all hosts in the group "%s"'), $alias)) ); } From 1e6f292910712e87ded97202c5f55fffe554abdf Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 11:43:51 +0200 Subject: [PATCH 16/80] Use `servicegroup_name' instead of `servicegroup' to filter services refs #8613 --- .../views/scripts/list/servicegroups.phtml | 28 +++++++++---------- .../show/components/servicegroups.phtml | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/servicegroups.phtml b/modules/monitoring/application/views/scripts/list/servicegroups.phtml index 0e958a3f7..cc6b76e6a 100644 --- a/modules/monitoring/application/views/scripts/list/servicegroups.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegroups.phtml @@ -28,7 +28,7 @@ - + services_critical_last_state_change_unhandled): ?> translate('CRITICAL'); ?> @@ -82,7 +82,7 @@ qlink( $s->servicegroup_alias, 'monitoring/list/services', - array('servicegroup' => $s->servicegroup), + array('servicegroup_name' => $s->servicegroup), array('title' => sprintf($this->translate('List all services in the group "%s"'), $s->servicegroup_alias)) ); ?> @@ -96,9 +96,9 @@ $s->services_ok, 'monitoring/list/services', array( - 'service_state' => 0, - 'servicegroup' => $s->servicegroup, - 'sort' => 'service_severity' + 'service_state' => 0, + 'servicegroup_name' => $s->servicegroup, + 'sort' => 'service_severity' ), array( 'title' => sprintf( @@ -124,7 +124,7 @@ 'service_acknowledged' => 0, 'service_in_downtime' => 0, 'host_problem' => 0, - 'servicegroup' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup, 'sort' => 'service_severity' ), array( @@ -148,7 +148,7 @@ array( 'service_state' => 2, 'service_handled' => 1, - 'servicegroup' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup, 'sort' => 'service_severity' ), array( @@ -178,7 +178,7 @@ 'service_acknowledged' => 0, 'service_in_downtime' => 0, 'host_problem' => 0, - 'servicegroup' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup, 'sort' => 'service_severity' ), array( @@ -202,7 +202,7 @@ array( 'service_state' => 3, 'service_handled' => 1, - 'servicegroup' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup, 'sort' => 'service_severity' ), array( @@ -232,7 +232,7 @@ 'service_acknowledged' => 0, 'service_in_downtime' => 0, 'host_problem' => 0, - 'servicegroup' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup, 'sort' => 'service_severity' ), array( @@ -256,7 +256,7 @@ array( 'service_state' => 1, 'service_handled' => 1, - 'servicegroup' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup, 'sort' => 'service_severity' ), array( @@ -282,9 +282,9 @@ $s->services_pending, 'monitoring/list/services', array( - 'service_state' => 99, - 'servicegroup' => $s->servicegroup, - 'sort' => 'service_severity' + 'service_state' => 99, + 'servicegroup_name' => $s->servicegroup, + 'sort' => 'service_severity' ), array( 'title' => sprintf( diff --git a/modules/monitoring/application/views/scripts/show/components/servicegroups.phtml b/modules/monitoring/application/views/scripts/show/components/servicegroups.phtml index 093e03286..93697ce89 100644 --- a/modules/monitoring/application/views/scripts/show/components/servicegroups.phtml +++ b/modules/monitoring/application/views/scripts/show/components/servicegroups.phtml @@ -7,7 +7,7 @@ foreach ($object->servicegroups as $name => $alias) { $list[] = $this->qlink( $alias, 'monitoring/list/services', - array('servicegroup' => $name), + array('servicegroup_name' => $name), array('title' => sprintf($this->translate('List all services in the group "%s"'), $alias)) ); } From cb95f53dba97f3874a4d2ed886f370d0a3d27c45 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 12:49:06 +0200 Subject: [PATCH 17/80] CommentQuery: Fetch and display object names with their initial collation i.e. `host_name' instead of `comment_host' alias `host' and `service_description' instead of `comment_service' alias `service'. refs #8613 --- .../application/controllers/ListController.php | 4 ++-- .../views/scripts/list/comments.phtml | 17 +++++++++++------ .../Backend/Ido/Query/CommentQuery.php | 8 +++----- .../library/Monitoring/DataView/Comment.php | 4 ++-- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 8a9dc5fa4..cf5821cdc 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -474,8 +474,8 @@ class Monitoring_ListController extends Controller 'type' => 'comment_type', 'persistent' => 'comment_is_persistent', 'expiration' => 'comment_expiration', - 'host' => 'comment_host', - 'service' => 'comment_service', + 'host_name', + 'service_description', 'host_display_name', 'service_display_name' )); diff --git a/modules/monitoring/application/views/scripts/list/comments.phtml b/modules/monitoring/application/views/scripts/list/comments.phtml index 12668eefd..cdbe28244 100644 --- a/modules/monitoring/application/views/scripts/list/comments.phtml +++ b/modules/monitoring/application/views/scripts/list/comments.phtml @@ -52,11 +52,14 @@ objecttype === 'service'): ?> icon('service', $this->translate('Service')); ?> 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 + ); ?> icon('host', $this->translate('Host')); ?> - link()->host($comment->host, $comment->host_display_name) ?> + link()->host($comment->host_name, $comment->host_display_name); ?>
icon('comment', $this->translate('Comment')); ?> author) @@ -81,11 +84,13 @@ $delCommentForm = clone $delCommentForm; $delCommentForm->populate(array('comment_id' => $comment->id, 'redirect' => $this->url)); if ($comment->objecttype === 'host') { - $delCommentForm->setAction($this->url('monitoring/host/delete-comment', array('host_name' => $comment->host))); + $delCommentForm->setAction( + $this->url('monitoring/host/delete-comment', array('host_name' => $comment->host_name)) + ); } else { $delCommentForm->setAction($this->url('monitoring/service/delete-comment', array( - 'host_name' => $comment->host, - 'service_description' => $comment->service + 'host_name' => $comment->host_name, + 'service_description' => $comment->service_description ))); } echo $delCommentForm; diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php index 1348371d3..91800ef78 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php @@ -17,13 +17,11 @@ class CommentQuery extends IdoQuery '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_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", - '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', + 'service' => 'so.name2 COLLATE latin1_general_ci', + 'service_description' => 'so.name2', 'service_host_name' => 'so.name1' ), 'hosts' => array( diff --git a/modules/monitoring/library/Monitoring/DataView/Comment.php b/modules/monitoring/library/Monitoring/DataView/Comment.php index 5172690bb..c74deeb89 100644 --- a/modules/monitoring/library/Monitoring/DataView/Comment.php +++ b/modules/monitoring/library/Monitoring/DataView/Comment.php @@ -22,10 +22,10 @@ class Comment extends DataView 'comment_type', 'comment_is_persistent', 'comment_expiration', - 'comment_host', - 'comment_service', 'host', 'service', + 'host_name', + 'service_description', 'host_display_name', 'service_display_name' ); From 480f5516d60fc750a846dd4487a218d60082f059 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 12:53:28 +0200 Subject: [PATCH 18/80] DataView\Comment: Do not permit querying `host' and `service' refs #8613 --- .../monitoring/library/Monitoring/DataView/Comment.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/DataView/Comment.php b/modules/monitoring/library/Monitoring/DataView/Comment.php index c74deeb89..f7f3703b8 100644 --- a/modules/monitoring/library/Monitoring/DataView/Comment.php +++ b/modules/monitoring/library/Monitoring/DataView/Comment.php @@ -22,8 +22,6 @@ class Comment extends DataView 'comment_type', 'comment_is_persistent', 'comment_expiration', - 'host', - 'service', 'host_name', 'service_description', 'host_display_name', @@ -56,4 +54,12 @@ class Comment extends DataView ) ); } + + /** + * {@inheritdoc} + */ + public function getFilterColumns() + { + return array('host', 'service'); + } } From 002b82083584b06753be0f73fda73fb33c40bdcf Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 12:55:57 +0200 Subject: [PATCH 19/80] CommentQuery: Provide `service_host' additionally to `service_host_name' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/CommentQuery.php | 1 + modules/monitoring/library/Monitoring/DataView/Comment.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php index 91800ef78..882a31ff6 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php @@ -22,6 +22,7 @@ class CommentQuery extends IdoQuery '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' ), 'hosts' => array( diff --git a/modules/monitoring/library/Monitoring/DataView/Comment.php b/modules/monitoring/library/Monitoring/DataView/Comment.php index f7f3703b8..8d4e46f90 100644 --- a/modules/monitoring/library/Monitoring/DataView/Comment.php +++ b/modules/monitoring/library/Monitoring/DataView/Comment.php @@ -60,6 +60,6 @@ class Comment extends DataView */ public function getFilterColumns() { - return array('host', 'service'); + return array('host', 'service', 'service_host'); } } From 8ed1c8eeb60342a25d21bfa6eabec1988bdc54dc Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 12:56:31 +0200 Subject: [PATCH 20/80] DataView\Comment: Add `service_host_name' as allowed query column refs #8613 --- modules/monitoring/library/Monitoring/DataView/Comment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/DataView/Comment.php b/modules/monitoring/library/Monitoring/DataView/Comment.php index 8d4e46f90..57f7b85bd 100644 --- a/modules/monitoring/library/Monitoring/DataView/Comment.php +++ b/modules/monitoring/library/Monitoring/DataView/Comment.php @@ -25,7 +25,8 @@ class Comment extends DataView 'host_name', 'service_description', 'host_display_name', - 'service_display_name' + 'service_display_name', + 'service_host_name' ); } From 21c76010d44f7a24ffabdebef62b3dccab6a355d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 13:06:38 +0200 Subject: [PATCH 21/80] CommentQuery: Add `comment_author_name' as additional query column refs #8613 --- .../library/Monitoring/Backend/Ido/Query/CommentQuery.php | 1 + modules/monitoring/library/Monitoring/DataView/Comment.php | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php index 882a31ff6..eff3bc1e7 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php @@ -13,6 +13,7 @@ class CommentQuery extends IdoQuery 'comment_internal_id' => 'cm.internal_comment_id', 'comment_data' => 'cm.comment_data', 'comment_author' => 'cm.author_name COLLATE latin1_general_ci', + 'comment_author_name' => 'cm.author_name', '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_is_persistent' => 'cm.is_persistent', diff --git a/modules/monitoring/library/Monitoring/DataView/Comment.php b/modules/monitoring/library/Monitoring/DataView/Comment.php index 57f7b85bd..c0e5370ff 100644 --- a/modules/monitoring/library/Monitoring/DataView/Comment.php +++ b/modules/monitoring/library/Monitoring/DataView/Comment.php @@ -18,6 +18,7 @@ class Comment extends DataView 'comment_internal_id', 'comment_data', 'comment_author', + 'comment_author_name', 'comment_timestamp', 'comment_type', 'comment_is_persistent', From 5372dfb7f1b8a273377ae8ea2a726db29ae21db0 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 13:07:50 +0200 Subject: [PATCH 22/80] Fetch a comment's author using `comment_author_name' refs #8613 --- modules/monitoring/application/controllers/ListController.php | 2 +- .../monitoring/library/Monitoring/Object/MonitoredObject.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index cf5821cdc..71325e05a 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -469,7 +469,7 @@ class Monitoring_ListController extends Controller 'id' => 'comment_internal_id', 'objecttype' => 'comment_objecttype', 'comment' => 'comment_data', - 'author' => 'comment_author', + 'author' => 'comment_author_name', 'timestamp' => 'comment_timestamp', 'type' => 'comment_type', 'persistent' => 'comment_is_persistent', diff --git a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php index 621c25c75..c33e1be2d 100644 --- a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php +++ b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php @@ -248,7 +248,7 @@ abstract class MonitoredObject implements Filterable $comments = $this->backend->select()->from('comment', array( 'id' => 'comment_internal_id', 'timestamp' => 'comment_timestamp', - 'author' => 'comment_author', + 'author' => 'comment_author_name', 'comment' => 'comment_data', 'type' => 'comment_type', )) From bc6a086ff8850184cba7abf32b79f01356dc01e8 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 13:08:49 +0200 Subject: [PATCH 23/80] DataView\Comment: Do not permit `comment_author' to be queried refs #8163 --- modules/monitoring/library/Monitoring/DataView/Comment.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/DataView/Comment.php b/modules/monitoring/library/Monitoring/DataView/Comment.php index c0e5370ff..1fadd8b62 100644 --- a/modules/monitoring/library/Monitoring/DataView/Comment.php +++ b/modules/monitoring/library/Monitoring/DataView/Comment.php @@ -17,7 +17,6 @@ class Comment extends DataView 'comment_objecttype', 'comment_internal_id', 'comment_data', - 'comment_author', 'comment_author_name', 'comment_timestamp', 'comment_type', @@ -62,6 +61,6 @@ class Comment extends DataView */ public function getFilterColumns() { - return array('host', 'service', 'service_host'); + return array('comment_author', 'host', 'service', 'service_host'); } } From 84a2727523128f1c53b90121ca260add4cf164c6 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 14:17:27 +0200 Subject: [PATCH 24/80] Eventhistory: Fetch object names using their columns with initial collation refs #8613 --- .../monitoring/application/controllers/ListController.php | 4 +--- .../application/views/scripts/list/eventhistory.phtml | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 71325e05a..cd0a734ef 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -623,9 +623,7 @@ class Monitoring_ListController extends Controller 'attempt', 'max_attempts', 'output', - 'type', - 'host', - 'service' + 'type' )); $this->filterQuery($query); diff --git a/modules/monitoring/application/views/scripts/list/eventhistory.phtml b/modules/monitoring/application/views/scripts/list/eventhistory.phtml index 0b6b9bcec..3e2ad32c8 100644 --- a/modules/monitoring/application/views/scripts/list/eventhistory.phtml +++ b/modules/monitoring/application/views/scripts/list/eventhistory.phtml @@ -34,7 +34,7 @@ use Icinga\Module\Monitoring\Object\Service; $icon = 'help'; $title = $event->type; $stateName = 'invalid'; - $isService = isset($event->service); + $isService = isset($event->service_description); switch ($event->type) { case 'notify': $icon = 'bell'; @@ -99,10 +99,10 @@ use Icinga\Module\Monitoring\Object\Service; 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 ) ?> - link()->host($event->host, $event->host_display_name) ?> + link()->host($event->host_name, $event->host_display_name) ?>
From 2c38ccda5c238e6c3ecef2c1bf817beb82e42229 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 14:19:31 +0200 Subject: [PATCH 25/80] EventHistoryQuery: Drop column `service_host_name' refs #8613 --- .../application/controllers/AlertsummaryController.php | 5 ++--- .../Monitoring/Backend/Ido/Query/EventHistoryQuery.php | 3 +-- .../monitoring/library/Monitoring/DataView/EventHistory.php | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/monitoring/application/controllers/AlertsummaryController.php b/modules/monitoring/application/controllers/AlertsummaryController.php index 54150dac2..22c7035d9 100644 --- a/modules/monitoring/application/controllers/AlertsummaryController.php +++ b/modules/monitoring/application/controllers/AlertsummaryController.php @@ -263,7 +263,7 @@ class Monitoring_AlertsummaryController extends Controller $interval = $this->getInterval(); $query = $this->backend->select()->from( - 'EventHistory', + 'eventHistory', array( 'host_name', 'service_description', @@ -275,8 +275,7 @@ class Monitoring_AlertsummaryController extends Controller 'output', 'type', 'host', - 'service', - 'service_host_name' + 'service' ) ); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php index 370fad9af..1b87779ce 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php @@ -40,8 +40,7 @@ class EventHistoryQuery extends IdoQuery 'attempt' => 'eh.attempt', 'max_attempts' => 'eh.max_attempts', 'output' => 'eh.output', // we do not want long_output - 'type' => 'eh.type', - 'service_host_name' => 'eho.name1 COLLATE latin1_general_ci' + 'type' => 'eh.type' ), 'hostgroups' => array( 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', diff --git a/modules/monitoring/library/Monitoring/DataView/EventHistory.php b/modules/monitoring/library/Monitoring/DataView/EventHistory.php index 8fcc4f35a..32eadd4ba 100644 --- a/modules/monitoring/library/Monitoring/DataView/EventHistory.php +++ b/modules/monitoring/library/Monitoring/DataView/EventHistory.php @@ -30,8 +30,7 @@ class EventHistory extends DataView 'output', 'type', 'host', - 'service', - 'service_host_name' + 'service' ); } From 044a15d113396af890ab4f9d6e551c0ad21afe12 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 14:29:26 +0200 Subject: [PATCH 26/80] Alertsummary: Do not fetch more columns than necessary.. --- .../controllers/AlertsummaryController.php | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/modules/monitoring/application/controllers/AlertsummaryController.php b/modules/monitoring/application/controllers/AlertsummaryController.php index 22c7035d9..e6b99c8a4 100644 --- a/modules/monitoring/application/controllers/AlertsummaryController.php +++ b/modules/monitoring/application/controllers/AlertsummaryController.php @@ -210,12 +210,7 @@ class Monitoring_AlertsummaryController extends Controller $query = $this->backend->select()->from( 'notification', array( - 'host', - 'service', - 'notification_output', - 'notification_contact', - 'notification_start_time', - 'notification_state' + 'notification_start_time' ) ); @@ -265,17 +260,7 @@ class Monitoring_AlertsummaryController extends Controller $query = $this->backend->select()->from( 'eventHistory', array( - 'host_name', - 'service_description', - 'object_type', - 'timestamp', - 'state', - 'attempt', - 'max_attempts', - 'output', - 'type', - 'host', - 'service' + 'timestamp' ) ); From ae10e01ed6dccd94104b423f7a98fd7fac904e84 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 14:39:47 +0200 Subject: [PATCH 27/80] EventHistoryQuery: Remove COLLATE from the column `host_name' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php index 1b87779ce..9c645aedd 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php @@ -32,8 +32,8 @@ class EventHistoryQuery extends IdoQuery 'cnt_downtime_end' => "SUM(CASE eh.type WHEN 'dt_end' THEN 1 ELSE 0 END)", 'host' => 'eho.name1 COLLATE latin1_general_ci', 'service' => 'eho.name2 COLLATE latin1_general_ci', - 'host_name' => 'eho.name1 COLLATE latin1_general_ci', 'service_description' => 'eho.name2 COLLATE latin1_general_ci', + 'host_name' => 'eho.name1', 'object_type' => 'eh.object_type', 'timestamp' => 'eh.timestamp', 'state' => 'eh.state', From b7e1c2d51811d564010826c4b4766a55d984fc6e Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 14:40:12 +0200 Subject: [PATCH 28/80] EventHistoryQuery: Remove COLLATE from the column `service_description' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php index 9c645aedd..d6dd52c45 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php @@ -32,8 +32,8 @@ class EventHistoryQuery extends IdoQuery 'cnt_downtime_end' => "SUM(CASE eh.type WHEN 'dt_end' THEN 1 ELSE 0 END)", 'host' => 'eho.name1 COLLATE latin1_general_ci', 'service' => 'eho.name2 COLLATE latin1_general_ci', - 'service_description' => 'eho.name2 COLLATE latin1_general_ci', 'host_name' => 'eho.name1', + 'service_description' => 'eho.name2', 'object_type' => 'eh.object_type', 'timestamp' => 'eh.timestamp', 'state' => 'eh.state', From ec67c28629e15528b674c47035e6562a019d38c0 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 14:41:10 +0200 Subject: [PATCH 29/80] DataView\EventHistory: Do not permit `host' and `service' to be queried refs #8613 --- .../library/Monitoring/DataView/EventHistory.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/monitoring/library/Monitoring/DataView/EventHistory.php b/modules/monitoring/library/Monitoring/DataView/EventHistory.php index 32eadd4ba..2d56f4c5c 100644 --- a/modules/monitoring/library/Monitoring/DataView/EventHistory.php +++ b/modules/monitoring/library/Monitoring/DataView/EventHistory.php @@ -28,9 +28,7 @@ class EventHistory extends DataView 'attempt', 'max_attempts', 'output', - 'type', - 'host', - 'service' + 'type' ); } @@ -46,8 +44,6 @@ class EventHistory extends DataView public function getFilterColumns() { - return array( - 'hostgroups' - ); + return array('host', 'service', 'hostgroup'); } } From 9e79419eb1ae222eb2ab54bdf84bd9f67307381e Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 14:44:10 +0200 Subject: [PATCH 30/80] EventHistoryQuery: Provide `hostgroup_name' as alternative to `hostgroup' This can't be queried though until #7274 has been resolved. refs #8613 --- .../library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php | 1 + modules/monitoring/library/Monitoring/DataView/EventHistory.php | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php index d6dd52c45..0c77e82a6 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventHistoryQuery.php @@ -44,6 +44,7 @@ class EventHistoryQuery extends IdoQuery ), 'hostgroups' => array( 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', + 'hostgroup_name' => 'hgo.name1' ), 'hosts' => array( 'host_display_name' => 'CASE WHEN sh.display_name IS NOT NULL THEN sh.display_name ELSE h.display_name END' diff --git a/modules/monitoring/library/Monitoring/DataView/EventHistory.php b/modules/monitoring/library/Monitoring/DataView/EventHistory.php index 2d56f4c5c..c19a4a376 100644 --- a/modules/monitoring/library/Monitoring/DataView/EventHistory.php +++ b/modules/monitoring/library/Monitoring/DataView/EventHistory.php @@ -22,6 +22,7 @@ class EventHistory extends DataView 'host_display_name', 'service_description', 'service_display_name', + 'hostgroup_name', 'object_type', 'timestamp', 'state', From 51bf5cfbc8bac617371401eaf4cc75120e72255f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 15:13:59 +0200 Subject: [PATCH 31/80] *historyQuery: Drop redundant query columns refs #8613 --- .../Ido/Query/CommentdeletionhistoryQuery.php | 32 +++++++++---------- .../Backend/Ido/Query/CommenthistoryQuery.php | 32 +++++++++---------- .../Ido/Query/DowntimeendhistoryQuery.php | 32 +++++++++---------- .../Ido/Query/DowntimestarthistoryQuery.php | 32 +++++++++---------- .../Ido/Query/NotificationhistoryQuery.php | 32 +++++++++---------- .../Backend/Ido/Query/StatehistoryQuery.php | 8 ++--- 6 files changed, 79 insertions(+), 89 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php index ec8fbd147..86ca8c8c2 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php @@ -7,24 +7,22 @@ class CommentdeletionhistoryQuery extends IdoQuery { protected $columnMap = array( 'commenthistory' => array( - 'state_time' => 'h.deletion_time', - 'timestamp' => 'UNIX_TIMESTAMP(h.deletion_time)', - 'raw_timestamp' => 'h.deletion_time', - 'object_id' => 'h.object_id', - 'type' => "(CASE h.entry_type WHEN 1 THEN 'comment_deleted' WHEN 2 THEN 'dt_comment_deleted' WHEN 3 THEN 'flapping_deleted' WHEN 4 THEN 'ack_deleted' END)", - 'state' => '(NULL)', - 'state_type' => '(NULL)', - 'output' => "('[' || h.author_name || '] ' || h.comment_data)", - 'attempt' => '(NULL)', - 'max_attempts' => '(NULL)', + 'state_time' => 'h.deletion_time', + 'timestamp' => 'UNIX_TIMESTAMP(h.deletion_time)', + 'raw_timestamp' => 'h.deletion_time', + 'object_id' => 'h.object_id', + 'type' => "(CASE h.entry_type WHEN 1 THEN 'comment_deleted' WHEN 2 THEN 'dt_comment_deleted' WHEN 3 THEN 'flapping_deleted' WHEN 4 THEN 'ack_deleted' END)", + 'state' => '(NULL)', + 'state_type' => '(NULL)', + 'output' => "('[' || h.author_name || '] ' || h.comment_data)", + 'attempt' => '(NULL)', + 'max_attempts' => '(NULL)', - 'host' => 'o.name1 COLLATE latin1_general_ci', - 'service' => 'o.name2 COLLATE latin1_general_ci', - 'host_name' => 'o.name1 COLLATE latin1_general_ci', - 'service_description' => 'o.name2 COLLATE latin1_general_ci', - '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" + 'host' => 'o.name1 COLLATE latin1_general_ci', + 'service' => 'o.name2 COLLATE latin1_general_ci', + '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" ) ); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommenthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommenthistoryQuery.php index 460d4be88..fd6f8a72c 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommenthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommenthistoryQuery.php @@ -7,24 +7,22 @@ class CommenthistoryQuery extends IdoQuery { protected $columnMap = array( 'commenthistory' => array( - 'state_time' => 'h.comment_time', - 'timestamp' => 'UNIX_TIMESTAMP(h.comment_time)', - 'raw_timestamp' => 'h.comment_time', - 'object_id' => 'h.object_id', - 'type' => "(CASE h.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'dt_comment' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END)", - 'state' => '(NULL)', - 'state_type' => '(NULL)', - 'output' => "('[' || h.author_name || '] ' || h.comment_data)", - 'attempt' => '(NULL)', - 'max_attempts' => '(NULL)', + 'state_time' => 'h.comment_time', + 'timestamp' => 'UNIX_TIMESTAMP(h.comment_time)', + 'raw_timestamp' => 'h.comment_time', + 'object_id' => 'h.object_id', + 'type' => "(CASE h.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'dt_comment' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END)", + 'state' => '(NULL)', + 'state_type' => '(NULL)', + 'output' => "('[' || h.author_name || '] ' || h.comment_data)", + 'attempt' => '(NULL)', + 'max_attempts' => '(NULL)', - 'host' => 'o.name1 COLLATE latin1_general_ci', - 'service' => 'o.name2 COLLATE latin1_general_ci', - 'host_name' => 'o.name1 COLLATE latin1_general_ci', - 'service_description' => 'o.name2 COLLATE latin1_general_ci', - '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" + 'host' => 'o.name1 COLLATE latin1_general_ci', + 'service' => 'o.name2 COLLATE latin1_general_ci', + '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" ) ); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php index 12f1f94e9..1b7d31ccd 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php @@ -7,24 +7,22 @@ class DowntimeendhistoryQuery extends IdoQuery { protected $columnMap = array( 'downtimehistory' => array( - 'state_time' => 'h.actual_end_time', - 'timestamp' => 'UNIX_TIMESTAMP(h.actual_end_time)', - 'raw_timestamp' => 'h.actual_end_time', - 'object_id' => 'h.object_id', - 'type' => "('dt_end')", - 'state' => '(NULL)', - 'state_type' => '(NULL)', - 'output' => "('[' || h.author_name || '] ' || h.comment_data)", - 'attempt' => '(NULL)', - 'max_attempts' => '(NULL)', + 'state_time' => 'h.actual_end_time', + 'timestamp' => 'UNIX_TIMESTAMP(h.actual_end_time)', + 'raw_timestamp' => 'h.actual_end_time', + 'object_id' => 'h.object_id', + 'type' => "('dt_end')", + 'state' => '(NULL)', + 'state_type' => '(NULL)', + 'output' => "('[' || h.author_name || '] ' || h.comment_data)", + 'attempt' => '(NULL)', + 'max_attempts' => '(NULL)', - 'host' => 'o.name1 COLLATE latin1_general_ci', - 'service' => 'o.name2 COLLATE latin1_general_ci', - 'host_name' => 'o.name1 COLLATE latin1_general_ci', - 'service_description' => 'o.name2 COLLATE latin1_general_ci', - '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" + 'host' => 'o.name1 COLLATE latin1_general_ci', + 'service' => 'o.name2 COLLATE latin1_general_ci', + '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" ) ); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php index 99b1257ab..a86d47dce 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php @@ -7,24 +7,22 @@ class DowntimestarthistoryQuery extends IdoQuery { protected $columnMap = array( 'downtimehistory' => array( - 'state_time' => 'h.actual_start_time', - 'timestamp' => 'UNIX_TIMESTAMP(h.actual_start_time)', - 'raw_timestamp' => 'h.actual_start_time', - 'object_id' => 'h.object_id', - 'type' => "('dt_start')", - 'state' => '(NULL)', - 'state_type' => '(NULL)', - 'output' => "('[' || h.author_name || '] ' || h.comment_data)", - 'attempt' => '(NULL)', - 'max_attempts' => '(NULL)', + 'state_time' => 'h.actual_start_time', + 'timestamp' => 'UNIX_TIMESTAMP(h.actual_start_time)', + 'raw_timestamp' => 'h.actual_start_time', + 'object_id' => 'h.object_id', + 'type' => "('dt_start')", + 'state' => '(NULL)', + 'state_type' => '(NULL)', + 'output' => "('[' || h.author_name || '] ' || h.comment_data)", + 'attempt' => '(NULL)', + 'max_attempts' => '(NULL)', - 'host' => 'o.name1 COLLATE latin1_general_ci', - 'service' => 'o.name2 COLLATE latin1_general_ci', - 'host_name' => 'o.name1 COLLATE latin1_general_ci', - 'service_description' => 'o.name2 COLLATE latin1_general_ci', - '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" + 'host' => 'o.name1 COLLATE latin1_general_ci', + 'service' => 'o.name2 COLLATE latin1_general_ci', + '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" ) ); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php index 37a7f48b5..09e4184f7 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php @@ -7,24 +7,22 @@ class NotificationhistoryQuery extends IdoQuery { protected $columnMap = array( 'history' => array( - 'timestamp' => 'UNIX_TIMESTAMP(n.start_time)', - 'raw_timestamp' => 'n.start_time', - 'state_time' => 'n.start_time', - 'object_id' => 'n.object_id', - 'type' => "('notify')", - 'state' => 'n.state', - 'state_type' => '(NULL)', - 'output' => null, - 'attempt' => '(NULL)', - 'max_attempts' => '(NULL)', + 'state_time' => 'n.start_time', + 'timestamp' => 'UNIX_TIMESTAMP(n.start_time)', + 'raw_timestamp' => 'n.start_time', + 'object_id' => 'n.object_id', + 'type' => "('notify')", + 'state' => 'n.state', + 'state_type' => '(NULL)', + 'output' => null, + 'attempt' => '(NULL)', + 'max_attempts' => '(NULL)', - 'host' => 'o.name1 COLLATE latin1_general_ci', - 'service' => 'o.name2 COLLATE latin1_general_ci', - 'host_name' => 'o.name1 COLLATE latin1_general_ci', - 'service_description' => 'o.name2 COLLATE latin1_general_ci', - '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" + 'host' => 'o.name1 COLLATE latin1_general_ci', + 'service' => 'o.name2 COLLATE latin1_general_ci', + '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" ) ); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatehistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatehistoryQuery.php index 5456c0b2b..f17c366bd 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatehistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatehistoryQuery.php @@ -12,9 +12,9 @@ class StatehistoryQuery extends IdoQuery protected $columnMap = array( 'statehistory' => array( - 'raw_timestamp' => 'sh.state_time', - 'timestamp' => 'UNIX_TIMESTAMP(sh.state_time)', 'state_time' => 'sh.state_time', + 'timestamp' => 'UNIX_TIMESTAMP(sh.state_time)', + 'raw_timestamp' => 'sh.state_time', 'object_id' => 'sho.object_id', 'type' => "(CASE WHEN sh.state_type = 1 THEN 'hard_state' ELSE 'soft_state' END)", 'state' => 'sh.state', @@ -22,11 +22,11 @@ class StatehistoryQuery extends IdoQuery 'output' => 'sh.output', 'attempt' => 'sh.current_check_attempt', 'max_attempts' => 'sh.max_check_attempts', + 'host' => 'sho.name1 COLLATE latin1_general_ci', - 'host_name' => 'sho.name1 COLLATE latin1_general_ci', 'service' => 'sho.name2 COLLATE latin1_general_ci', + 'host_name' => 'sho.name1 COLLATE latin1_general_ci', 'service_description' => 'sho.name2 COLLATE latin1_general_ci', - 'service_host_name' => 'sho.name1 COLLATE latin1_general_ci', 'object_type' => "CASE WHEN sho.objecttype_id = 1 THEN 'host' ELSE 'service' END" ) ); From ea874f84021f7926b4501eca13d017a1bfd3f8a5 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 15:29:01 +0200 Subject: [PATCH 32/80] *historyQuery: Remove COLLATE from `host_name' and `service_description' refs #8613 --- .../Backend/Ido/Query/CommentdeletionhistoryQuery.php | 4 ++-- .../Monitoring/Backend/Ido/Query/CommenthistoryQuery.php | 4 ++-- .../Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php | 4 ++-- .../Backend/Ido/Query/DowntimestarthistoryQuery.php | 4 ++-- .../Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php | 4 ++-- .../Monitoring/Backend/Ido/Query/StatehistoryQuery.php | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php index 86ca8c8c2..9346ce09a 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php @@ -20,8 +20,8 @@ class CommentdeletionhistoryQuery extends IdoQuery 'host' => 'o.name1 COLLATE latin1_general_ci', 'service' => 'o.name2 COLLATE latin1_general_ci', - 'host_name' => 'o.name1 COLLATE latin1_general_ci', - 'service_description' => 'o.name2 COLLATE latin1_general_ci', + 'host_name' => 'o.name1', + 'service_description' => 'o.name2', 'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END" ) ); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommenthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommenthistoryQuery.php index fd6f8a72c..6b2f821e9 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommenthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CommenthistoryQuery.php @@ -20,8 +20,8 @@ class CommenthistoryQuery extends IdoQuery 'host' => 'o.name1 COLLATE latin1_general_ci', 'service' => 'o.name2 COLLATE latin1_general_ci', - 'host_name' => 'o.name1 COLLATE latin1_general_ci', - 'service_description' => 'o.name2 COLLATE latin1_general_ci', + 'host_name' => 'o.name1', + 'service_description' => 'o.name2', 'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END" ) ); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php index 1b7d31ccd..42d23ce05 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php @@ -20,8 +20,8 @@ class DowntimeendhistoryQuery extends IdoQuery 'host' => 'o.name1 COLLATE latin1_general_ci', 'service' => 'o.name2 COLLATE latin1_general_ci', - 'host_name' => 'o.name1 COLLATE latin1_general_ci', - 'service_description' => 'o.name2 COLLATE latin1_general_ci', + 'host_name' => 'o.name1', + 'service_description' => 'o.name2', 'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END" ) ); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php index a86d47dce..6f23fe174 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php @@ -20,8 +20,8 @@ class DowntimestarthistoryQuery extends IdoQuery 'host' => 'o.name1 COLLATE latin1_general_ci', 'service' => 'o.name2 COLLATE latin1_general_ci', - 'host_name' => 'o.name1 COLLATE latin1_general_ci', - 'service_description' => 'o.name2 COLLATE latin1_general_ci', + 'host_name' => 'o.name1', + 'service_description' => 'o.name2', 'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END" ) ); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php index 09e4184f7..8bbdc0751 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationhistoryQuery.php @@ -20,8 +20,8 @@ class NotificationhistoryQuery extends IdoQuery 'host' => 'o.name1 COLLATE latin1_general_ci', 'service' => 'o.name2 COLLATE latin1_general_ci', - 'host_name' => 'o.name1 COLLATE latin1_general_ci', - 'service_description' => 'o.name2 COLLATE latin1_general_ci', + 'host_name' => 'o.name1', + 'service_description' => 'o.name2', 'object_type' => "CASE WHEN o.objecttype_id = 1 THEN 'host' ELSE 'service' END" ) ); diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatehistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatehistoryQuery.php index f17c366bd..ff3c1055a 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatehistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatehistoryQuery.php @@ -25,8 +25,8 @@ class StatehistoryQuery extends IdoQuery 'host' => 'sho.name1 COLLATE latin1_general_ci', 'service' => 'sho.name2 COLLATE latin1_general_ci', - 'host_name' => 'sho.name1 COLLATE latin1_general_ci', - 'service_description' => 'sho.name2 COLLATE latin1_general_ci', + 'host_name' => 'sho.name1', + 'service_description' => 'sho.name2', 'object_type' => "CASE WHEN sho.objecttype_id = 1 THEN 'host' ELSE 'service' END" ) ); From 3d096158519786c2fda0736fb5ab5a6efb057e8c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 9 Apr 2015 15:30:21 +0200 Subject: [PATCH 33/80] Fix that the user isn't being notified that no events were found empty() seems not work if subqueries are involved. --- .../application/views/scripts/list/eventhistory.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/views/scripts/list/eventhistory.phtml b/modules/monitoring/application/views/scripts/list/eventhistory.phtml index 3e2ad32c8..b76b5a796 100644 --- a/modules/monitoring/application/views/scripts/list/eventhistory.phtml +++ b/modules/monitoring/application/views/scripts/list/eventhistory.phtml @@ -22,7 +22,7 @@ use Icinga\Module\Monitoring\Object\Service;
filterEditor ?> - + translate('No history events matching the filter') ?>
From 3c47ba11eb4b8cdda80f55a83a36b263432e5d27 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 09:39:39 +0200 Subject: [PATCH 34/80] monitoring/show/contact: Require `contact_name' instead of `contact' refs #8613 --- modules/monitoring/application/controllers/ShowController.php | 4 ++-- .../application/views/scripts/list/contactgroups.phtml | 2 +- .../monitoring/application/views/scripts/list/contacts.phtml | 2 +- .../application/views/scripts/list/notifications.phtml | 2 +- .../application/views/scripts/show/components/contacts.phtml | 2 +- .../monitoring/application/views/scripts/show/history.phtml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index b5ffc0535..f41811297 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -112,11 +112,11 @@ class Monitoring_ShowController extends Controller public function contactAction() { - $contactName = $this->getParam('contact'); + $contactName = $this->getParam('contact_name'); if (! $contactName) { throw new Zend_Controller_Action_Exception( - $this->translate('The parameter `contact\' is required'), + $this->translate('The parameter `contact_name\' is required'), 404 ); } diff --git a/modules/monitoring/application/views/scripts/list/contactgroups.phtml b/modules/monitoring/application/views/scripts/list/contactgroups.phtml index a44b388b7..09083a387 100644 --- a/modules/monitoring/application/views/scripts/list/contactgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/contactgroups.phtml @@ -24,7 +24,7 @@ foreach ($groupData as $groupName => $groupInfo): ?> qlink( $c->contact_alias, 'monitoring/show/contact', - array('contact' => $c->contact_name), + array('contact_name' => $c->contact_name), array('title' => sprintf( $this->translate('Show detailed information about %s'), $c->contact_alias diff --git a/modules/monitoring/application/views/scripts/list/contacts.phtml b/modules/monitoring/application/views/scripts/list/contacts.phtml index 8fba674c0..80405f7c6 100644 --- a/modules/monitoring/application/views/scripts/list/contacts.phtml +++ b/modules/monitoring/application/views/scripts/list/contacts.phtml @@ -18,7 +18,7 @@ qlink( $contact->contact_name, '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 diff --git a/modules/monitoring/application/views/scripts/list/notifications.phtml b/modules/monitoring/application/views/scripts/list/notifications.phtml index 9cc5f724b..cd2c46538 100644 --- a/modules/monitoring/application/views/scripts/list/notifications.phtml +++ b/modules/monitoring/application/views/scripts/list/notifications.phtml @@ -63,7 +63,7 @@ use Icinga\Module\Monitoring\Object\Service; $this->qlink( $notification->notification_contact, 'monitoring/show/contact', - array('contact' => $notification->notification_contact) + array('contact_name' => $notification->notification_contact) ) ) ?> diff --git a/modules/monitoring/application/views/scripts/show/components/contacts.phtml b/modules/monitoring/application/views/scripts/show/components/contacts.phtml index c00714e9c..6767a252e 100644 --- a/modules/monitoring/application/views/scripts/show/components/contacts.phtml +++ b/modules/monitoring/application/views/scripts/show/components/contacts.phtml @@ -7,7 +7,7 @@ if (! empty($object->contacts)) { $list[] = $this->qlink( $contact->contact_alias, '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)) ); } diff --git a/modules/monitoring/application/views/scripts/show/history.phtml b/modules/monitoring/application/views/scripts/show/history.phtml index 149eb0ecc..b148888e1 100644 --- a/modules/monitoring/application/views/scripts/show/history.phtml +++ b/modules/monitoring/application/views/scripts/show/history.phtml @@ -32,7 +32,7 @@ function contactsLink($match, $view) { $links[] = $view->qlink( $contact, 'monitoring/show/contact', - array('contact' => $contact), + array('contact_name' => $contact), array('title' => sprintf($view->translate('Show detailed information about %s'), $contact)) ); } From f00adc2138158dd2c5c75b881aff5fc34cae7d70 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 09:45:23 +0200 Subject: [PATCH 35/80] ContactQuery: Provide ci query columns for aliases and email addresses refs #8613 --- .../application/controllers/ListController.php | 16 ++++++++-------- .../application/controllers/ShowController.php | 6 +++--- .../views/scripts/list/contacts.phtml | 10 +++++----- .../views/scripts/show/components/contacts.phtml | 4 ++-- .../application/views/scripts/show/contact.phtml | 10 +++++----- .../Backend/Ido/Query/ContactQuery.php | 6 ++++-- .../library/Monitoring/DataView/Contact.php | 6 +++--- .../Monitoring/Object/MonitoredObject.php | 14 +++++++------- 8 files changed, 37 insertions(+), 35 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index cd0a734ef..123ec053b 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -350,8 +350,8 @@ class Monitoring_ListController extends Controller $query = $this->backend->select()->from('contact', array( 'contact_name', 'contact_id', - 'contact_alias', - 'contact_email', + 'contact_alias_name', + 'contact_email_address', 'contact_pager', 'contact_notify_service_timeperiod', 'contact_notify_service_recovery', @@ -365,18 +365,18 @@ class Monitoring_ListController extends Controller 'contact_notify_host_down', 'contact_notify_host_unreachable', 'contact_notify_host_flapping', - 'contact_notify_host_downtime', + 'contact_notify_host_downtime' )); $this->filterQuery($query); $this->view->contacts = $query->paginate(); $this->setupSortControl(array( - 'contact_name' => $this->translate('Name'), - 'contact_alias' => $this->translate('Alias'), - 'contact_email' => $this->translate('Email'), - 'contact_pager' => $this->translate('Pager Address / Number'), + 'contact_name' => $this->translate('Name'), + 'contact_alias_name' => $this->translate('Alias'), + 'contact_email_address' => $this->translate('Email'), + 'contact_pager' => $this->translate('Pager Address / Number'), 'contact_notify_service_timeperiod' => $this->translate('Service Notification Timeperiod'), - 'contact_notify_host_timeperiod' => $this->translate('Host Notification Timeperiod') + 'contact_notify_host_timeperiod' => $this->translate('Host Notification Timeperiod') )); } diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index f41811297..1a8504d73 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -124,8 +124,8 @@ class Monitoring_ShowController extends Controller $query = $this->backend->select()->from('contact', array( 'contact_name', 'contact_id', - 'contact_alias', - 'contact_email', + 'contact_alias_name', + 'contact_email_address', 'contact_pager', 'contact_object_id', 'contact_notify_service_timeperiod', @@ -140,7 +140,7 @@ class Monitoring_ShowController extends Controller 'contact_notify_host_down', 'contact_notify_host_unreachable', 'contact_notify_host_flapping', - 'contact_notify_host_downtime', + 'contact_notify_host_downtime' )); $query->where('contact_name', $contactName); diff --git a/modules/monitoring/application/views/scripts/list/contacts.phtml b/modules/monitoring/application/views/scripts/list/contacts.phtml index 80405f7c6..b321d8e85 100644 --- a/modules/monitoring/application/views/scripts/list/contacts.phtml +++ b/modules/monitoring/application/views/scripts/list/contacts.phtml @@ -14,19 +14,19 @@ } foreach ($contacts as $contact): ?>
- img('/static/gravatar', array('email' => $contact->contact_email)); ?> + img('/static/gravatar', array('email' => $contact->contact_email_address)); ?> qlink( $contact->contact_name, 'monitoring/show/contact', array('contact_name' => $contact->contact_name), array('title' => sprintf( $this->translate('Show detailed information about %s'), - $contact->contact_alias + $contact->contact_alias_name )) - ); ?> (contact_alias; ?>) + ); ?> (contact_alias_name; ?>) contact_pager): ?> diff --git a/modules/monitoring/application/views/scripts/show/components/contacts.phtml b/modules/monitoring/application/views/scripts/show/components/contacts.phtml index 6767a252e..a70c23105 100644 --- a/modules/monitoring/application/views/scripts/show/components/contacts.phtml +++ b/modules/monitoring/application/views/scripts/show/components/contacts.phtml @@ -5,10 +5,10 @@ if (! empty($object->contacts)) { $list = array(); foreach ($object->contacts as $contact) { $list[] = $this->qlink( - $contact->contact_alias, + $contact->contact_alias_name, 'monitoring/show/contact', 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_name)) ); } diff --git a/modules/monitoring/application/views/scripts/show/contact.phtml b/modules/monitoring/application/views/scripts/show/contact.phtml index c4142707a..0b07edd89 100644 --- a/modules/monitoring/application/views/scripts/show/contact.phtml +++ b/modules/monitoring/application/views/scripts/show/contact.phtml @@ -3,7 +3,7 @@ tabs ?>

translate('Contact details') ?>

@@ -15,14 +15,14 @@ - escape($contact->contact_alias) ?> (contact_name ?>) + escape($contact->contact_alias_name) ?> (contact_name ?>) -contact_email): ?> +contact_email_address): ?> translate('Email') ?> - - escape($contact->contact_email); ?> + + escape($contact->contact_email_address); ?> diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php index 1b5e744d4..f56bca2b6 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php @@ -9,8 +9,10 @@ class ContactQuery extends IdoQuery 'contacts' => array( 'contact_id' => 'c.contact_id', 'contact_name' => 'co.name1 COLLATE latin1_general_ci', - 'contact_alias' => 'c.alias COLLATE latin1_general_ci', - 'contact_email' => 'c.email_address COLLATE latin1_general_ci', + 'alias' => 'c.alias COLLATE latin1_general_ci', + 'contact_alias_name' => 'c.alias', + 'email' => 'c.email_address COLLATE latin1_general_ci', + 'contact_email_address' => 'c.email_address', 'contact_pager' => 'c.pager_address', 'contact_object_id' => 'c.contact_object_id', 'contact_has_host_notfications' => 'c.host_notifications_enabled', diff --git a/modules/monitoring/library/Monitoring/DataView/Contact.php b/modules/monitoring/library/Monitoring/DataView/Contact.php index 793765fed..34bd67b43 100644 --- a/modules/monitoring/library/Monitoring/DataView/Contact.php +++ b/modules/monitoring/library/Monitoring/DataView/Contact.php @@ -19,8 +19,8 @@ class Contact extends DataView return array( 'contact', 'contact_name', - 'contact_alias', - 'contact_email', + 'contact_alias_name', + 'contact_email_address', 'contact_pager', 'contact_notify_hosts', 'contact_notify_services', @@ -57,7 +57,7 @@ class Contact extends DataView public function getSortRules() { return array( - 'contact_alias' => array( + 'contact_alias_name' => array( 'order' => self::SORT_DESC ) ); diff --git a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php index c33e1be2d..173fd88fa 100644 --- a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php +++ b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php @@ -185,10 +185,10 @@ abstract class MonitoredObject implements Filterable $this->contacts = array(); foreach (preg_split('~,~', $this->properties->host_contacts) as $contact) { $this->contacts[] = (object) array( - 'contact_name' => $contact, - 'contact_alias' => $contact, - 'contact_email' => null, - 'contact_pager' => null, + 'contact_name' => $contact, + 'contact_alias_name' => $contact, + 'contact_email_address' => null, + 'contact_pager' => null ); } } @@ -385,9 +385,9 @@ abstract class MonitoredObject implements Filterable $contacts = $this->backend->select()->from('contact', array( 'contact_name', - 'contact_alias', - 'contact_email', - 'contact_pager', + 'contact_alias_name', + 'contact_email_address', + 'contact_pager' )); if ($this->type === self::TYPE_SERVICE) { $contacts From 52dcecfd0877d2593659f2be59efaa7e2e4b63ee Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 09:46:41 +0200 Subject: [PATCH 36/80] ContactQuery: Change query column `contact_name' to be case sensitive ...and provide `contact' as case-insensitive alternative. refs #8613 --- .../library/Monitoring/Backend/Ido/Query/ContactQuery.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php index f56bca2b6..3d867f0d9 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php @@ -8,7 +8,8 @@ class ContactQuery extends IdoQuery protected $columnMap = array( 'contacts' => array( 'contact_id' => 'c.contact_id', - 'contact_name' => 'co.name1 COLLATE latin1_general_ci', + 'contact' => 'co.name1 COLLATE latin1_general_ci', + 'contact_name' => 'co.name1', 'alias' => 'c.alias COLLATE latin1_general_ci', 'contact_alias_name' => 'c.alias', 'email' => 'c.email_address COLLATE latin1_general_ci', From 0ec1a18844bc3cf5c1ec2cece2e8fb5c0e10cec3 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 09:48:22 +0200 Subject: [PATCH 37/80] ContactQuery: Fix query column `service' not referencing a service's name refs #8613 --- .../library/Monitoring/Backend/Ido/Query/ContactQuery.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php index 3d867f0d9..e4bdc88ea 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php @@ -37,10 +37,10 @@ class ContactQuery extends IdoQuery ), 'hosts' => array( 'host' => 'ho.name1 COLLATE latin1_general_ci', - 'host_name' => 'ho.name1', + 'host_name' => 'ho.name1' ), 'services' => array( - 'service' => 'so.name1 COLLATE latin1_general_ci', + 'service' => 'so.name2 COLLATE latin1_general_ci', 'service_description' => 'so.name2', 'service_host_name' => 'so.name1', ) From 6d03b2fe8f06d1629e4636a0c35c6a1aa10448f5 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 09:49:47 +0200 Subject: [PATCH 38/80] DataView\Contact: Add missing filter columns refs #8613 --- .../library/Monitoring/DataView/Contact.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/monitoring/library/Monitoring/DataView/Contact.php b/modules/monitoring/library/Monitoring/DataView/Contact.php index 34bd67b43..b70dcebc7 100644 --- a/modules/monitoring/library/Monitoring/DataView/Contact.php +++ b/modules/monitoring/library/Monitoring/DataView/Contact.php @@ -8,7 +8,6 @@ namespace Icinga\Module\Monitoring\DataView; */ class Contact extends DataView { - /** * Retrieve columns provided by this view * @@ -17,7 +16,6 @@ class Contact extends DataView public function getColumns() { return array( - 'contact', 'contact_name', 'contact_alias_name', 'contact_email_address', @@ -43,9 +41,7 @@ class Contact extends DataView 'host_name', 'service_object_id', 'service_host_name', - 'service_description', - 'service', - 'host', + 'service_description' ); } @@ -62,4 +58,9 @@ class Contact extends DataView ) ); } + + public function getFilterColumns() + { + return array('contact', 'alias', 'email', 'host', 'service'); + } } From 3d7e418032a80603738e08ea21d9eeaf02ccc4ae Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 09:50:26 +0200 Subject: [PATCH 39/80] ContactQuery: Provide case insensitive filter column `service_host' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/ContactQuery.php | 3 ++- modules/monitoring/library/Monitoring/DataView/Contact.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php index e4bdc88ea..ce00b6151 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php @@ -42,7 +42,8 @@ class ContactQuery extends IdoQuery 'services' => array( 'service' => 'so.name2 COLLATE latin1_general_ci', 'service_description' => 'so.name2', - 'service_host_name' => 'so.name1', + 'service_host' => 'so.name1 COLLATE latin1_general_ci', + 'service_host_name' => 'so.name1' ) ); diff --git a/modules/monitoring/library/Monitoring/DataView/Contact.php b/modules/monitoring/library/Monitoring/DataView/Contact.php index b70dcebc7..3a364b968 100644 --- a/modules/monitoring/library/Monitoring/DataView/Contact.php +++ b/modules/monitoring/library/Monitoring/DataView/Contact.php @@ -61,6 +61,6 @@ class Contact extends DataView public function getFilterColumns() { - return array('contact', 'alias', 'email', 'host', 'service'); + return array('contact', 'alias', 'email', 'host', 'service', 'service_host'); } } From 8477859dc156a004b1a0c78f5e61324aeaef372a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 09:51:08 +0200 Subject: [PATCH 40/80] Fix that the user isn't being notified that no events were found for an object --- modules/monitoring/application/views/scripts/show/history.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/views/scripts/show/history.phtml b/modules/monitoring/application/views/scripts/show/history.phtml index b148888e1..d82f454f6 100644 --- a/modules/monitoring/application/views/scripts/show/history.phtml +++ b/modules/monitoring/application/views/scripts/show/history.phtml @@ -20,7 +20,7 @@ $hostContext = $object->getType() === 'host';
- + translate('No history available for this object'); ?>
From 1dc16a1ab61dda30ed3110210ff481daef254c44 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 12:12:50 +0200 Subject: [PATCH 41/80] ContactgroupQuery: Remove COLLATE from query column `contactgroup_name' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php index cf1586626..c6744f440 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php @@ -8,7 +8,7 @@ class ContactgroupQuery extends IdoQuery protected $columnMap = array( 'contactgroups' => array( 'contactgroup' => 'cgo.name1 COLLATE latin1_general_ci', - 'contactgroup_name' => 'cgo.name1 COLLATE latin1_general_ci', + 'contactgroup_name' => 'cgo.name1', 'contactgroup_alias' => 'cg.alias', ), 'contacts' => array( From 6536878d5dd8a5a874a5df2916f7674b19be5976 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 12:13:23 +0200 Subject: [PATCH 42/80] ContactgroupQuery: Remove COLLATE from query column `contact_name' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php index c6744f440..48df99e4e 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php @@ -13,7 +13,7 @@ class ContactgroupQuery extends IdoQuery ), 'contacts' => array( 'contact' => 'co.name1 COLLATE latin1_general_ci', - 'contact_name' => 'co.name1 COLLATE latin1_general_ci', + 'contact_name' => 'co.name1', 'contact_alias' => 'c.alias', 'contact_email' => 'c.email_address', 'contact_pager' => 'c.pager_address', From 71c013178e068ea166c95accbb8d223a3834ff11 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 12:14:11 +0200 Subject: [PATCH 43/80] ContactgroupQuery: Make query column `contactgroup_alias' case-insensitive refs #8613 --- .../library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php index 48df99e4e..6e7e38f0f 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php @@ -9,7 +9,7 @@ class ContactgroupQuery extends IdoQuery 'contactgroups' => array( 'contactgroup' => 'cgo.name1 COLLATE latin1_general_ci', 'contactgroup_name' => 'cgo.name1', - 'contactgroup_alias' => 'cg.alias', + 'contactgroup_alias' => 'cg.alias COLLATE latin1_general_ci' ), 'contacts' => array( 'contact' => 'co.name1 COLLATE latin1_general_ci', From 5ec4919aa60a5473188923779808e5509e2c0caf Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 12:14:47 +0200 Subject: [PATCH 44/80] Do not filter for `contactgroup' in case the concrete group name is known refs #8613 --- .../application/views/scripts/show/components/contacts.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/views/scripts/show/components/contacts.phtml b/modules/monitoring/application/views/scripts/show/components/contacts.phtml index a70c23105..bad1d9cd3 100644 --- a/modules/monitoring/application/views/scripts/show/components/contacts.phtml +++ b/modules/monitoring/application/views/scripts/show/components/contacts.phtml @@ -27,7 +27,7 @@ if (! empty($object->contactgroups)) { $list[] = $this->qlink( $contactgroup->contactgroup_alias, '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)) ); } From a51b93ebfba2fb461529c7c449affcbc5534177e Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 12:17:52 +0200 Subject: [PATCH 45/80] DataView\Contactgroup: Do not permit querying case-insensitive columns refs #8163 --- .../library/Monitoring/DataView/Contactgroup.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/monitoring/library/Monitoring/DataView/Contactgroup.php b/modules/monitoring/library/Monitoring/DataView/Contactgroup.php index b55b6914a..cb5772e76 100644 --- a/modules/monitoring/library/Monitoring/DataView/Contactgroup.php +++ b/modules/monitoring/library/Monitoring/DataView/Contactgroup.php @@ -17,13 +17,9 @@ class Contactgroup extends DataView public function getColumns() { return array( - 'contact', 'contact_name', - 'contactgroup', 'contactgroup_name', 'contactgroup_alias', - 'host', - 'service' ); } @@ -43,4 +39,9 @@ class Contactgroup extends DataView ) ); } + + public function getFilterColumns() + { + return array('contactgroup', 'contact', 'host', 'service'); + } } From 31a05a3ec04e4efdd68d84f7f3697300f6ef4c3c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 12:19:19 +0200 Subject: [PATCH 46/80] DataView\Contactgroup: Add missing query columns --- .../Monitoring/DataView/Contactgroup.php | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/DataView/Contactgroup.php b/modules/monitoring/library/Monitoring/DataView/Contactgroup.php index cb5772e76..287b835f2 100644 --- a/modules/monitoring/library/Monitoring/DataView/Contactgroup.php +++ b/modules/monitoring/library/Monitoring/DataView/Contactgroup.php @@ -8,7 +8,6 @@ namespace Icinga\Module\Monitoring\DataView; */ class Contactgroup extends DataView { - /** * Retrieve columns provided by this view * @@ -17,9 +16,29 @@ class Contactgroup extends DataView public function getColumns() { return array( - 'contact_name', 'contactgroup_name', 'contactgroup_alias', + 'contact_name', + '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' ); } From 03c8de5d7b773aa3c78271946501f0a64e6155fb Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 12:20:28 +0200 Subject: [PATCH 47/80] ContactgroupQuery: Provide case-insensitive filter column `service_host' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php | 1 + modules/monitoring/library/Monitoring/DataView/Contactgroup.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php index 6e7e38f0f..8a29e1954 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php @@ -39,6 +39,7 @@ class ContactgroupQuery extends IdoQuery 'services' => array( 'service' => 'so.name2 COLLATE latin1_general_ci', 'service_description' => 'so.name2', + 'service_host' => 'so.name1 COLLATE latin1_general_ci', 'service_host_name' => 'so.name1' ) ); diff --git a/modules/monitoring/library/Monitoring/DataView/Contactgroup.php b/modules/monitoring/library/Monitoring/DataView/Contactgroup.php index 287b835f2..0c432c2dc 100644 --- a/modules/monitoring/library/Monitoring/DataView/Contactgroup.php +++ b/modules/monitoring/library/Monitoring/DataView/Contactgroup.php @@ -61,6 +61,6 @@ class Contactgroup extends DataView public function getFilterColumns() { - return array('contactgroup', 'contact', 'host', 'service'); + return array('contactgroup', 'contact', 'host', 'service', 'service_host'); } } From 0fe59aa519f4f51f5c89b8a6297ea90039ebcb5f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 12:23:35 +0200 Subject: [PATCH 48/80] Revert "ContactQuery: Provide ci query columns for aliases and email addresses" This reverts commit f00adc2138158dd2c5c75b881aff5fc34cae7d70. Conflicts: modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php --- .../application/controllers/ListController.php | 16 ++++++++-------- .../application/controllers/ShowController.php | 6 +++--- .../views/scripts/list/contacts.phtml | 10 +++++----- .../views/scripts/show/components/contacts.phtml | 4 ++-- .../application/views/scripts/show/contact.phtml | 10 +++++----- .../Backend/Ido/Query/ContactQuery.php | 6 ++---- .../library/Monitoring/DataView/Contact.php | 6 +++--- .../Monitoring/Object/MonitoredObject.php | 14 +++++++------- 8 files changed, 35 insertions(+), 37 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 123ec053b..cd0a734ef 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -350,8 +350,8 @@ class Monitoring_ListController extends Controller $query = $this->backend->select()->from('contact', array( 'contact_name', 'contact_id', - 'contact_alias_name', - 'contact_email_address', + 'contact_alias', + 'contact_email', 'contact_pager', 'contact_notify_service_timeperiod', 'contact_notify_service_recovery', @@ -365,18 +365,18 @@ class Monitoring_ListController extends Controller 'contact_notify_host_down', 'contact_notify_host_unreachable', 'contact_notify_host_flapping', - 'contact_notify_host_downtime' + 'contact_notify_host_downtime', )); $this->filterQuery($query); $this->view->contacts = $query->paginate(); $this->setupSortControl(array( - 'contact_name' => $this->translate('Name'), - 'contact_alias_name' => $this->translate('Alias'), - 'contact_email_address' => $this->translate('Email'), - 'contact_pager' => $this->translate('Pager Address / Number'), + 'contact_name' => $this->translate('Name'), + 'contact_alias' => $this->translate('Alias'), + 'contact_email' => $this->translate('Email'), + 'contact_pager' => $this->translate('Pager Address / Number'), 'contact_notify_service_timeperiod' => $this->translate('Service Notification Timeperiod'), - 'contact_notify_host_timeperiod' => $this->translate('Host Notification Timeperiod') + 'contact_notify_host_timeperiod' => $this->translate('Host Notification Timeperiod') )); } diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 1a8504d73..f41811297 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -124,8 +124,8 @@ class Monitoring_ShowController extends Controller $query = $this->backend->select()->from('contact', array( 'contact_name', 'contact_id', - 'contact_alias_name', - 'contact_email_address', + 'contact_alias', + 'contact_email', 'contact_pager', 'contact_object_id', 'contact_notify_service_timeperiod', @@ -140,7 +140,7 @@ class Monitoring_ShowController extends Controller 'contact_notify_host_down', 'contact_notify_host_unreachable', 'contact_notify_host_flapping', - 'contact_notify_host_downtime' + 'contact_notify_host_downtime', )); $query->where('contact_name', $contactName); diff --git a/modules/monitoring/application/views/scripts/list/contacts.phtml b/modules/monitoring/application/views/scripts/list/contacts.phtml index b321d8e85..80405f7c6 100644 --- a/modules/monitoring/application/views/scripts/list/contacts.phtml +++ b/modules/monitoring/application/views/scripts/list/contacts.phtml @@ -14,19 +14,19 @@ } foreach ($contacts as $contact): ?>
- img('/static/gravatar', array('email' => $contact->contact_email_address)); ?> + img('/static/gravatar', array('email' => $contact->contact_email)); ?> qlink( $contact->contact_name, 'monitoring/show/contact', array('contact_name' => $contact->contact_name), array('title' => sprintf( $this->translate('Show detailed information about %s'), - $contact->contact_alias_name + $contact->contact_alias )) - ); ?> (contact_alias_name; ?>) + ); ?> (contact_alias; ?>) contact_pager): ?> diff --git a/modules/monitoring/application/views/scripts/show/components/contacts.phtml b/modules/monitoring/application/views/scripts/show/components/contacts.phtml index bad1d9cd3..f445e10d1 100644 --- a/modules/monitoring/application/views/scripts/show/components/contacts.phtml +++ b/modules/monitoring/application/views/scripts/show/components/contacts.phtml @@ -5,10 +5,10 @@ if (! empty($object->contacts)) { $list = array(); foreach ($object->contacts as $contact) { $list[] = $this->qlink( - $contact->contact_alias_name, + $contact->contact_alias, 'monitoring/show/contact', array('contact_name' => $contact->contact_name), - array('title' => sprintf($this->translate('Show detailed information about %s'), $contact->contact_alias_name)) + array('title' => sprintf($this->translate('Show detailed information about %s'), $contact->contact_alias)) ); } diff --git a/modules/monitoring/application/views/scripts/show/contact.phtml b/modules/monitoring/application/views/scripts/show/contact.phtml index 0b07edd89..c4142707a 100644 --- a/modules/monitoring/application/views/scripts/show/contact.phtml +++ b/modules/monitoring/application/views/scripts/show/contact.phtml @@ -3,7 +3,7 @@ tabs ?>

translate('Contact details') ?>

@@ -15,14 +15,14 @@ - escape($contact->contact_alias_name) ?> (contact_name ?>) + escape($contact->contact_alias) ?> (contact_name ?>) -contact_email_address): ?> +contact_email): ?> translate('Email') ?> - - escape($contact->contact_email_address); ?> + + escape($contact->contact_email); ?> diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php index ce00b6151..3d23b8947 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php @@ -10,10 +10,8 @@ class ContactQuery extends IdoQuery 'contact_id' => 'c.contact_id', 'contact' => 'co.name1 COLLATE latin1_general_ci', 'contact_name' => 'co.name1', - 'alias' => 'c.alias COLLATE latin1_general_ci', - 'contact_alias_name' => 'c.alias', - 'email' => 'c.email_address COLLATE latin1_general_ci', - 'contact_email_address' => 'c.email_address', + 'contact_alias' => 'c.alias COLLATE latin1_general_ci', + 'contact_email' => 'c.email_address COLLATE latin1_general_ci', 'contact_pager' => 'c.pager_address', 'contact_object_id' => 'c.contact_object_id', 'contact_has_host_notfications' => 'c.host_notifications_enabled', diff --git a/modules/monitoring/library/Monitoring/DataView/Contact.php b/modules/monitoring/library/Monitoring/DataView/Contact.php index 3a364b968..fdc32e8be 100644 --- a/modules/monitoring/library/Monitoring/DataView/Contact.php +++ b/modules/monitoring/library/Monitoring/DataView/Contact.php @@ -17,8 +17,8 @@ class Contact extends DataView { return array( 'contact_name', - 'contact_alias_name', - 'contact_email_address', + 'contact_alias', + 'contact_email', 'contact_pager', 'contact_notify_hosts', 'contact_notify_services', @@ -53,7 +53,7 @@ class Contact extends DataView public function getSortRules() { return array( - 'contact_alias_name' => array( + 'contact_alias' => array( 'order' => self::SORT_DESC ) ); diff --git a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php index 173fd88fa..c33e1be2d 100644 --- a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php +++ b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php @@ -185,10 +185,10 @@ abstract class MonitoredObject implements Filterable $this->contacts = array(); foreach (preg_split('~,~', $this->properties->host_contacts) as $contact) { $this->contacts[] = (object) array( - 'contact_name' => $contact, - 'contact_alias_name' => $contact, - 'contact_email_address' => null, - 'contact_pager' => null + 'contact_name' => $contact, + 'contact_alias' => $contact, + 'contact_email' => null, + 'contact_pager' => null, ); } } @@ -385,9 +385,9 @@ abstract class MonitoredObject implements Filterable $contacts = $this->backend->select()->from('contact', array( 'contact_name', - 'contact_alias_name', - 'contact_email_address', - 'contact_pager' + 'contact_alias', + 'contact_email', + 'contact_pager', )); if ($this->type === self::TYPE_SERVICE) { $contacts From 638eda7773dd3f5ac23fd9fc0f4e436c2a68a4ad Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 12:27:24 +0200 Subject: [PATCH 49/80] ContactgroupQuery: Make query column `contact_alias' case-insensitive refs #8613 --- .../library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php index 8a29e1954..c87afaa9c 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php @@ -14,7 +14,7 @@ class ContactgroupQuery extends IdoQuery 'contacts' => array( 'contact' => '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_pager' => 'c.pager_address', 'contact_has_host_notfications' => 'c.host_notifications_enabled', From 0628efb4cdd0e1e4ff7549da1a245b8484908399 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 12:27:44 +0200 Subject: [PATCH 50/80] ContactgroupQuery: Make query column `contact_email' case-insensitive refs #8613 --- .../library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php index c87afaa9c..152e964f8 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php @@ -15,7 +15,7 @@ class ContactgroupQuery extends IdoQuery 'contact' => 'co.name1 COLLATE latin1_general_ci', 'contact_name' => 'co.name1', '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_has_host_notfications' => 'c.host_notifications_enabled', 'contact_has_service_notfications' => 'c.service_notifications_enabled', From b8efe01170e15b228a12e381db474e646ceb1f69 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 12:56:18 +0200 Subject: [PATCH 51/80] CustomvarQuery: Remove COLLATE from query columns ...and provide case-insensitive filter columns alternatively. refs #8613 --- .../Monitoring/Backend/Ido/Query/CustomvarQuery.php | 12 ++++++------ .../library/Monitoring/DataView/Customvar.php | 11 ++++++++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CustomvarQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CustomvarQuery.php index d40a7133d..3bf54756a 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/CustomvarQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/CustomvarQuery.php @@ -13,14 +13,14 @@ class CustomvarQuery extends IdoQuery ), 'objects' => array( 'host' => 'cvo.name1 COLLATE latin1_general_ci', - 'host_name' => 'cvo.name1 COLLATE latin1_general_ci', - 'service_host_name' => 'cvo.name1 COLLATE latin1_general_ci', - 'service' => 'cvo.name2 COLLATE latin1_general_ci', - 'service_description' => 'cvo.name2 COLLATE latin1_general_ci', - 'contact_name' => 'cvo.name1 COLLATE latin1_general_ci', + 'host_name' => 'cvo.name1', + 'service' => 'cvo.name2 COLLATE latin1_general_ci', + 'service_description' => 'cvo.name2', + '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_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" ), ); diff --git a/modules/monitoring/library/Monitoring/DataView/Customvar.php b/modules/monitoring/library/Monitoring/DataView/Customvar.php index 0517542c7..d62ff3f51 100644 --- a/modules/monitoring/library/Monitoring/DataView/Customvar.php +++ b/modules/monitoring/library/Monitoring/DataView/Customvar.php @@ -19,7 +19,11 @@ class Customvar extends DataView 'varname', 'varvalue', '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'); + } } From fda261bf2268d0e7d7afa5682ad37359cfd48e1b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 14:19:38 +0200 Subject: [PATCH 52/80] Use case-sensitive query columns when filtering downtimes by object refs #8613 --- .../controllers/HostsController.php | 2 +- .../controllers/ListController.php | 4 ++-- .../controllers/ServicesController.php | 4 ++-- .../views/scripts/list/downtimes.phtml | 22 +++++++++---------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/monitoring/application/controllers/HostsController.php b/modules/monitoring/application/controllers/HostsController.php index 8d0fc1f73..27d26e51b 100644 --- a/modules/monitoring/application/controllers/HostsController.php +++ b/modules/monitoring/application/controllers/HostsController.php @@ -123,7 +123,7 @@ class Monitoring_HostsController extends Controller } if ((bool) $host->in_downtime === true) { $objectsInDowntime[] = $host; - $downtimeFilterExpressions[] = Filter::where('downtime_host', $host->getName()); + $downtimeFilterExpressions[] = Filter::where('host_name', $host->getName()); } ++$hostStates[$host::getStateText($host->state)]; } diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index cd0a734ef..ed4f337b0 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -280,10 +280,10 @@ class Monitoring_ListController extends Controller 'is_fixed' => 'downtime_is_fixed', 'is_in_effect' => 'downtime_is_in_effect', 'entry_time' => 'downtime_entry_time', - 'host' => 'host_name', - 'service' => 'service_description', 'host_state' => 'downtime_host_state', 'service_state' => 'downtime_service_state', + 'host_name', + 'service_description', 'host_display_name', 'service_display_name' )); diff --git a/modules/monitoring/application/controllers/ServicesController.php b/modules/monitoring/application/controllers/ServicesController.php index efe89f4c1..b82d6f00e 100644 --- a/modules/monitoring/application/controllers/ServicesController.php +++ b/modules/monitoring/application/controllers/ServicesController.php @@ -158,8 +158,8 @@ class Monitoring_ServicesController extends Controller if ((bool) $service->in_downtime === true) { $objectsInDowntime[] = $service; $downtimeFilterExpressions[] = Filter::matchAll( - Filter::where('downtime_host', $service->getHost()->getName()), - Filter::where('downtime_service', $service->getName()) + Filter::where('host_name', $service->getHost()->getName()), + Filter::where('service_description', $service->getName()) ); } ++$serviceStates[$service::getStateText($service->state)]; diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index 00d9c7f90..3e15beef4 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -30,7 +30,7 @@ use Icinga\Module\Monitoring\Object\Service; service)) { + if (isset($downtime->service_description)) { $isService = true; $stateName = Service::getStateText($downtime->service_state); } else { @@ -57,11 +57,11 @@ use Icinga\Module\Monitoring\Object\Service; icon('service', $this->translate('Service')); ?> 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 ) ?> icon('host', $this->translate('Host')); ?> - link()->host($downtime->host, $downtime->host_display_name) ?> + link()->host($downtime->host_name, $downtime->host_display_name) ?>
icon('comment', $this->translate('Comment')); ?> [escape($downtime->author) ?>] escape($downtime->comment) ?> @@ -70,7 +70,7 @@ use Icinga\Module\Monitoring\Object\Service; is_flexible): ?> is_in_effect): ?> 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 host downtime was started on %s at %s and lasts for %s until %s at %s.'), date('d.m.y', $downtime->start), @@ -81,7 +81,7 @@ use Icinga\Module\Monitoring\Object\Service; ); ?> 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 host downtime has been scheduled to start between %s - %s and to last for %s.'), date('d.m.y H:i', $downtime->scheduled_start), @@ -92,7 +92,7 @@ use Icinga\Module\Monitoring\Object\Service; is_in_effect): ?> service) + $isService ? $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.'), date('d.m.y', $downtime->start), @@ -102,7 +102,7 @@ use Icinga\Module\Monitoring\Object\Service; ); ?> 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 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), @@ -119,12 +119,12 @@ use Icinga\Module\Monitoring\Object\Service; populate(array('downtime_id' => $downtime->id, 'redirect' => $this->url)); - if (! isset($downtime->service)) { - $delDowntimeForm->setAction($this->url('monitoring/host/delete-downtime', array('host_name' => $downtime->host))); + if (! $isService) { + $delDowntimeForm->setAction($this->url('monitoring/host/delete-downtime', array('host_name' => $downtime->host_name))); } else { $delDowntimeForm->setAction($this->url('monitoring/service/delete-downtime', array( - 'host_name' => $downtime->host, - 'service_description' => $downtime->service + 'host_name' => $downtime->host_name, + 'service_description' => $downtime->service_description ))); } echo $delDowntimeForm; From 1c32d8ebe569d4b00fa11dd5aec3eb5c393b212f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 14:23:05 +0200 Subject: [PATCH 53/80] DowntimeQuery: Add _name suffix to the query column `downtime_author' ...to indicate that it's a case-sensitive column. refs #8613 --- modules/monitoring/application/controllers/ListController.php | 2 +- .../monitoring/application/views/scripts/list/downtimes.phtml | 2 +- .../application/views/scripts/show/components/downtime.phtml | 2 +- .../library/Monitoring/Backend/Ido/Query/DowntimeQuery.php | 2 +- modules/monitoring/library/Monitoring/DataView/Downtime.php | 2 +- .../monitoring/library/Monitoring/Object/MonitoredObject.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index ed4f337b0..f0eb7e5fa 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -270,7 +270,7 @@ class Monitoring_ListController extends Controller 'id' => 'downtime_internal_id', 'objecttype' => 'downtime_objecttype', 'comment' => 'downtime_comment', - 'author' => 'downtime_author', + 'author_name' => 'downtime_author_name', 'start' => 'downtime_start', 'scheduled_start' => 'downtime_scheduled_start', 'scheduled_end' => 'downtime_scheduled_end', diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index 3e15beef4..2387e9487 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -64,7 +64,7 @@ use Icinga\Module\Monitoring\Object\Service; link()->host($downtime->host_name, $downtime->host_display_name) ?>
- icon('comment', $this->translate('Comment')); ?> [escape($downtime->author) ?>] escape($downtime->comment) ?> + icon('comment', $this->translate('Comment')); ?> [escape($downtime->author_name) ?>] escape($downtime->comment) ?>
is_flexible): ?> diff --git a/modules/monitoring/application/views/scripts/show/components/downtime.phtml b/modules/monitoring/application/views/scripts/show/components/downtime.phtml index 23c20e21f..b30043bda 100644 --- a/modules/monitoring/application/views/scripts/show/components/downtime.phtml +++ b/modules/monitoring/application/views/scripts/show/components/downtime.phtml @@ -58,7 +58,7 @@ foreach ($object->downtimes as $downtime) { ?> - escape($downtime->author); ?> + escape($downtime->author_name); ?> array( - 'downtime_author' => 'sd.author_name', + 'downtime_author_name' => 'sd.author_name', 'author' => 'sd.author_name', 'downtime_comment' => 'sd.comment_data', 'downtime_entry_time' => 'UNIX_TIMESTAMP(sd.entry_time)', diff --git a/modules/monitoring/library/Monitoring/DataView/Downtime.php b/modules/monitoring/library/Monitoring/DataView/Downtime.php index 07123dd4f..0b2b02491 100644 --- a/modules/monitoring/library/Monitoring/DataView/Downtime.php +++ b/modules/monitoring/library/Monitoring/DataView/Downtime.php @@ -14,7 +14,7 @@ class Downtime extends DataView { return array( 'downtime_objecttype', - 'downtime_author', + 'downtime_author_name', 'author', 'downtime_comment', 'downtime_entry_time', diff --git a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php index c33e1be2d..a653ea6ed 100644 --- a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php +++ b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php @@ -276,7 +276,7 @@ abstract class MonitoredObject implements Filterable 'id' => 'downtime_internal_id', 'objecttype' => 'downtime_objecttype', 'comment' => 'downtime_comment', - 'author' => 'downtime_author', + 'author_name' => 'downtime_author_name', 'start' => 'downtime_start', 'scheduled_start' => 'downtime_scheduled_start', 'end' => 'downtime_end', From 0f0727491ed67650621dad7050708367918c207a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 14:24:53 +0200 Subject: [PATCH 54/80] DowntimeQuery: Make query column `author' case-insensitive refs #8613 --- .../library/Monitoring/Backend/Ido/Query/DowntimeQuery.php | 2 +- modules/monitoring/library/Monitoring/DataView/Downtime.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php index a98b8e2c4..3f0d0293a 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php @@ -14,7 +14,7 @@ class DowntimeQuery extends IdoQuery protected $columnMap = array( 'downtime' => array( 'downtime_author_name' => 'sd.author_name', - 'author' => 'sd.author_name', + 'author' => 'sd.author_name COLLATE latin1_general_ci', 'downtime_comment' => 'sd.comment_data', 'downtime_entry_time' => 'UNIX_TIMESTAMP(sd.entry_time)', 'downtime_is_fixed' => 'sd.is_fixed', diff --git a/modules/monitoring/library/Monitoring/DataView/Downtime.php b/modules/monitoring/library/Monitoring/DataView/Downtime.php index 0b2b02491..04cf872db 100644 --- a/modules/monitoring/library/Monitoring/DataView/Downtime.php +++ b/modules/monitoring/library/Monitoring/DataView/Downtime.php @@ -15,7 +15,6 @@ class Downtime extends DataView return array( 'downtime_objecttype', 'downtime_author_name', - 'author', 'downtime_comment', 'downtime_entry_time', 'downtime_is_fixed', @@ -69,4 +68,9 @@ class Downtime extends DataView ) ); } + + public function getFilterColumns() + { + return array('author', 'host', 'service'); + } } From 5ccf6a7efa6f530c3424d4d98ce6daa69d2ab79f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 14:25:26 +0200 Subject: [PATCH 55/80] DowntimeQuery: Remove redundant query columns refs #8613 --- .../library/Monitoring/Backend/Ido/Query/DowntimeQuery.php | 4 +--- modules/monitoring/library/Monitoring/DataView/Downtime.php | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php index 3f0d0293a..47db6af94 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php @@ -28,11 +28,9 @@ class DowntimeQuery extends IdoQuery 'downtime_is_in_effect' => 'sd.is_in_effect', 'downtime_internal_id' => 'sd.internal_downtime_id', '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_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', // #7278, #7279 + 'service' => 'so.name2 COLLATE latin1_general_ci', 'service_description' => 'so.name2', 'service_host_name' => 'so.name1' ), diff --git a/modules/monitoring/library/Monitoring/DataView/Downtime.php b/modules/monitoring/library/Monitoring/DataView/Downtime.php index 04cf872db..e2eaf7aee 100644 --- a/modules/monitoring/library/Monitoring/DataView/Downtime.php +++ b/modules/monitoring/library/Monitoring/DataView/Downtime.php @@ -27,8 +27,6 @@ class Downtime extends DataView 'downtime_is_in_effect', 'downtime_triggered_by_id', 'downtime_internal_id', - 'downtime_host', - 'downtime_service', 'downtime_host_state', 'downtime_service_state', 'host_display_name', From 92634a19216d4887bd27a99a0e7ee93c3883821f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 14:25:53 +0200 Subject: [PATCH 56/80] DowntimeQuery: Provide case-insensitive filter column `service_host' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/DowntimeQuery.php | 1 + modules/monitoring/library/Monitoring/DataView/Downtime.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php index 47db6af94..a3e66cbaf 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php @@ -32,6 +32,7 @@ class DowntimeQuery extends IdoQuery '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' ), 'hosts' => array( diff --git a/modules/monitoring/library/Monitoring/DataView/Downtime.php b/modules/monitoring/library/Monitoring/DataView/Downtime.php index e2eaf7aee..4eaab1860 100644 --- a/modules/monitoring/library/Monitoring/DataView/Downtime.php +++ b/modules/monitoring/library/Monitoring/DataView/Downtime.php @@ -69,6 +69,6 @@ class Downtime extends DataView public function getFilterColumns() { - return array('author', 'host', 'service'); + return array('author', 'host', 'service', 'service_host'); } } From 1f4b3aa8ea66ac51275d050c19f0801da033d2d7 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 15:04:59 +0200 Subject: [PATCH 57/80] Fix host and service multiselection refs #8613 --- modules/monitoring/application/views/scripts/list/hosts.phtml | 2 +- .../monitoring/application/views/scripts/list/services.phtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index bdd88a1e9..a7511fcd8 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -36,7 +36,7 @@ if ($hosts->count() === 0) { data-base-target="_next" class="action multiselect" data-icinga-multiselect-url="href('monitoring/hosts/show') ?>" - data-icinga-multiselect-data="host" + data-icinga-multiselect-data="host_name" > compact): ?> " - data-icinga-multiselect-data="service,host"> + data-icinga-multiselect-data="service_description,host_name"> Date: Fri, 10 Apr 2015 15:19:55 +0200 Subject: [PATCH 58/80] HostgroupQuery: Remove COLLATE from query column `hostgroup_name' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/HostgroupQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php index 71e1bbc19..f0ab54b73 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php @@ -8,7 +8,7 @@ class HostgroupQuery extends IdoQuery protected $columnMap = array( 'hostgroups' => array( 'hostgroups' => 'hgo.name1 COLLATE latin1_general_ci', - 'hostgroup_name' => 'hgo.name1 COLLATE latin1_general_ci', + 'hostgroup_name' => 'hgo.name1', 'hostgroup_alias' => 'hg.alias', 'id' => 'hg.hostgroup_id', ), From 69e520a514a5cd8add1c0cc8ee7701b0823120a4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 15:20:19 +0200 Subject: [PATCH 59/80] HostgroupQuery: Remove COLLATE from query column `host_name' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/HostgroupQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php index f0ab54b73..219479745 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php @@ -14,7 +14,7 @@ class HostgroupQuery extends IdoQuery ), 'hosts' => array( 'host' => 'ho.name1 COLLATE latin1_general_ci', - 'host_name' => 'ho.name1 COLLATE latin1_general_ci' + 'host_name' => 'ho.name1' ) ); From f61370f55a134f3e37faa2b9f1ffc4b81f6c21bf Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 15:21:18 +0200 Subject: [PATCH 60/80] DataView\Hostgroup: Add missing query columns refs #8613 --- .../Backend/Ido/Query/HostgroupQuery.php | 2 +- .../library/Monitoring/DataView/Hostgroup.php | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php index 219479745..d41a9e00b 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostgroupQuery.php @@ -10,7 +10,7 @@ class HostgroupQuery extends IdoQuery 'hostgroups' => 'hgo.name1 COLLATE latin1_general_ci', 'hostgroup_name' => 'hgo.name1', 'hostgroup_alias' => 'hg.alias', - 'id' => 'hg.hostgroup_id', + 'hostgroup_id' => 'hg.hostgroup_id' ), 'hosts' => array( 'host' => 'ho.name1 COLLATE latin1_general_ci', diff --git a/modules/monitoring/library/Monitoring/DataView/Hostgroup.php b/modules/monitoring/library/Monitoring/DataView/Hostgroup.php index 84beb4bf0..c139d8977 100644 --- a/modules/monitoring/library/Monitoring/DataView/Hostgroup.php +++ b/modules/monitoring/library/Monitoring/DataView/Hostgroup.php @@ -1,7 +1,6 @@ array( 'order' => self::SORT_ASC + ), + 'hostgroup_alias' => array( + 'order' => self::SORT_ASC ) ); } + + public function getFilterColumns() + { + return array('hostgroup', 'host'); + } } From 26f0b46516f63d3a977c21e11958cf8e0917b640 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 15:31:09 +0200 Subject: [PATCH 61/80] ServicegroupQuery: Remove COLLATE from query column `host_name' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php index 490cc152f..9ec98a5a9 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php @@ -12,7 +12,7 @@ class ServicegroupQuery extends IdoQuery ), 'services' => array( '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_host_name' => 'so.name1 COLLATE latin1_general_ci', 'service_description' => 'so.name2 COLLATE latin1_general_ci' From a17c2eddb7fd7df51ce631e0534e9de6cb29d48b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 15:31:51 +0200 Subject: [PATCH 62/80] ServicegroupQuery: Remove COLLATE from query column `service_host_name' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php index 9ec98a5a9..48052aa33 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php @@ -14,7 +14,7 @@ class ServicegroupQuery extends IdoQuery 'host' => 'so.name1 COLLATE latin1_general_ci', 'host_name' => 'so.name1', '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' ) ); From 055cd6142164dbe85f9ba5f32e6bd1a56255a19b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 15:32:47 +0200 Subject: [PATCH 63/80] ServicegroupQuery: Remove COLLATE from query column `service_desription' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php index 48052aa33..76b9b1921 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php @@ -15,7 +15,7 @@ class ServicegroupQuery extends IdoQuery 'host_name' => 'so.name1', 'service' => 'so.name2 COLLATE latin1_general_ci', 'service_host_name' => 'so.name1', - 'service_description' => 'so.name2 COLLATE latin1_general_ci' + 'service_description' => 'so.name2' ) ); From fdd6a4d59ba6770bc9a824d347566800c66d8a57 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 15:34:28 +0200 Subject: [PATCH 64/80] ServicegroupQuery: Remove COLLATE from query column `servicegroup_name' ...and add a case-insensitive alternative called `servicegroup'. refs #8613 --- .../Monitoring/Backend/Ido/Query/ServicegroupQuery.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php index 76b9b1921..c9ab100c6 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php @@ -7,8 +7,9 @@ class ServicegroupQuery extends IdoQuery { protected $columnMap = array( 'servicegroups' => array( - 'servicegroup_name' => 'sgo.name1 COLLATE latin1_general_ci', - 'servicegroup_alias' => 'sg.alias', + 'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci', + 'servicegroup_name' => 'sgo.name1', + 'servicegroup_alias' => 'sg.alias' ), 'services' => array( 'host' => 'so.name1 COLLATE latin1_general_ci', From 4bc3afaca41b9b26437b4cd2a33d5e4252abb8b9 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 15:34:55 +0200 Subject: [PATCH 65/80] ServicegroupQuery: Make query column `servicegroup_alias' case-insensitive refs #8613 --- .../library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php index c9ab100c6..125c07005 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicegroupQuery.php @@ -9,7 +9,7 @@ class ServicegroupQuery extends IdoQuery 'servicegroups' => array( 'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci', 'servicegroup_name' => 'sgo.name1', - 'servicegroup_alias' => 'sg.alias' + 'servicegroup_alias' => 'sg.alias COLLATE latin1_general_ci' ), 'services' => array( 'host' => 'so.name1 COLLATE latin1_general_ci', From 629becf2cc4f360abab5232538be45207f64fcd5 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 15:35:24 +0200 Subject: [PATCH 66/80] DataView\Servicegroup: Add missing query and filter columns refs #8613 --- .../Monitoring/DataView/Servicegroup.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/monitoring/library/Monitoring/DataView/Servicegroup.php b/modules/monitoring/library/Monitoring/DataView/Servicegroup.php index 411b550fc..82feabd88 100644 --- a/modules/monitoring/library/Monitoring/DataView/Servicegroup.php +++ b/modules/monitoring/library/Monitoring/DataView/Servicegroup.php @@ -1,10 +1,8 @@ array( 'order' => self::SORT_ASC + ), + 'servicegroup_alias' => array( + 'order' => self::SORT_ASC ) ); } + + public function getFilterColumns() + { + return array('servicegroup', 'host', 'service'); + } } From 904e91bfa95dbc05dbea7f67a87a6f270e340ff3 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 15:54:18 +0200 Subject: [PATCH 67/80] EventgridQuery: Remove COLLATE from query column `host_name' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/EventgridQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php index c7764d516..115cd7d37 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php @@ -25,7 +25,7 @@ class EventgridQuery extends IdoQuery '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', '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', 'timestamp' => 'UNIX_TIMESTAMP(sh.state_time)' ), From 8b2c0191c43faa0f46682058abdd67ecf3d1dc5a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 15:54:55 +0200 Subject: [PATCH 68/80] EventgridQuery: Remove COLLATE from query column `service_description' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/EventgridQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php index 115cd7d37..b3eeb5335 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php @@ -26,7 +26,7 @@ class EventgridQuery extends IdoQuery 'host' => 'sho.name1 COLLATE latin1_general_ci', 'service' => 'sho.name2 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)' ), From 42e93ffb63d46ef7151b29c6e33c44fc95ec8a19 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 15:58:55 +0200 Subject: [PATCH 69/80] DataView\Eventgrid: Add missing query and filter columns refs #8613 --- .../library/Monitoring/DataView/Eventgrid.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/DataView/Eventgrid.php b/modules/monitoring/library/Monitoring/DataView/Eventgrid.php index 022c98d9c..88ff94908 100644 --- a/modules/monitoring/library/Monitoring/DataView/Eventgrid.php +++ b/modules/monitoring/library/Monitoring/DataView/Eventgrid.php @@ -15,6 +15,7 @@ class Eventgrid extends DataView return array( 'day', 'cnt_events', + 'objecttype_id', 'cnt_up', 'cnt_down_hard', 'cnt_down', @@ -22,12 +23,16 @@ class Eventgrid extends DataView 'cnt_unreachable', 'cnt_unknown_hard', 'cnt_unknown', - 'cnt_unknown_hard', 'cnt_critical', 'cnt_critical_hard', 'cnt_warning', 'cnt_warning_hard', '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'); + } } From ea16d45aa3d357ec1afb29f3c2e322afab73f7a0 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 16:01:09 +0200 Subject: [PATCH 70/80] EventgridQuery: Make filter column `hostgroup' case-insensitive ...and add a case-sensitive query column. refs #8613 --- .../library/Monitoring/Backend/Ido/Query/EventgridQuery.php | 3 ++- modules/monitoring/library/Monitoring/DataView/Eventgrid.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php index b3eeb5335..766dced21 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php @@ -35,7 +35,8 @@ class EventgridQuery extends IdoQuery ), 'hostgroups' => array( - 'hostgroup' => 'hgo.name1' + 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', + 'hostgroup_name' => 'hgo.name1' ) ); diff --git a/modules/monitoring/library/Monitoring/DataView/Eventgrid.php b/modules/monitoring/library/Monitoring/DataView/Eventgrid.php index 88ff94908..c7ea5b9ac 100644 --- a/modules/monitoring/library/Monitoring/DataView/Eventgrid.php +++ b/modules/monitoring/library/Monitoring/DataView/Eventgrid.php @@ -47,6 +47,6 @@ class Eventgrid extends DataView public function getFilterColumns() { - return array('host', 'service'); + return array('host', 'service', 'hostgroup'); } } From e7c1e552a52c21451ad98a3e7dc556a6ad9f5fb4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 16:01:22 +0200 Subject: [PATCH 71/80] EventgridQuery: Make filter column `servicegroup' case-insensitive ...and add a case-sensitive query column. refs #8613 --- .../library/Monitoring/Backend/Ido/Query/EventgridQuery.php | 3 ++- modules/monitoring/library/Monitoring/DataView/Eventgrid.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php index 766dced21..2dac92e3d 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventgridQuery.php @@ -31,7 +31,8 @@ class EventgridQuery extends IdoQuery ), 'servicegroups' => array( - 'servicegroup' => 'sgo.name1' + 'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci', + 'servicegroup_name' => 'sgo.name1' ), 'hostgroups' => array( diff --git a/modules/monitoring/library/Monitoring/DataView/Eventgrid.php b/modules/monitoring/library/Monitoring/DataView/Eventgrid.php index c7ea5b9ac..b7c7e0b3a 100644 --- a/modules/monitoring/library/Monitoring/DataView/Eventgrid.php +++ b/modules/monitoring/library/Monitoring/DataView/Eventgrid.php @@ -47,6 +47,6 @@ class Eventgrid extends DataView public function getFilterColumns() { - return array('host', 'service', 'hostgroup'); + return array('host', 'service', 'hostgroup', 'servicegroup'); } } From c59d5ac7d51e3d3c601a4b281d5ffa537856bd1b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 16:28:33 +0200 Subject: [PATCH 72/80] Hostgroups: Use query column `hostgroup_name' instead of `hostgroup' refs #8613 --- .../controllers/ListController.php | 2 +- .../views/scripts/list/hostgroups.phtml | 22 +++++++++---------- .../Backend/Ido/Query/GroupsummaryQuery.php | 6 ++--- .../Backend/Ido/Query/HoststatusQuery.php | 2 +- .../Monitoring/DataView/Groupsummary.php | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index f0eb7e5fa..82f3febb4 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -559,7 +559,7 @@ class Monitoring_ListController extends Controller $this->addTitleTab('hostgroups', $this->translate('Host Groups'), $this->translate('List host groups')); $this->setAutorefreshInterval(12); $query = $this->backend->select()->from('groupsummary', array( - 'hostgroup', + 'hostgroup_name', 'hostgroup_alias', 'hosts_up', 'hosts_unreachable_handled', diff --git a/modules/monitoring/application/views/scripts/list/hostgroups.phtml b/modules/monitoring/application/views/scripts/list/hostgroups.phtml index 94086f446..1e3eb29ac 100644 --- a/modules/monitoring/application/views/scripts/list/hostgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/hostgroups.phtml @@ -28,7 +28,7 @@ - + services_critical_last_state_change_unhandled): ?> @@ -90,7 +90,7 @@ qlink( $h->services_total, 'monitoring/list/services', - array('hostgroup_name' => $h->hostgroup), + array('hostgroup_name' => $h->hostgroup_name), array('title' => sprintf( $this->translate('List all services of all hosts in host group "%s"'), $h->hostgroup_alias @@ -105,7 +105,7 @@ 'monitoring/list/services', array( 'service_state' => 0, - 'hostgroup_name' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup_name, 'sort' => 'service_severity' ), array( @@ -132,7 +132,7 @@ 'service_acknowledged' => 0, 'service_in_downtime' => 0, 'host_problem' => 0, - 'hostgroup_name' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup_name, 'sort' => 'service_severity' ), array( @@ -156,7 +156,7 @@ array( 'service_state' => 2, 'service_handled' => 1, - 'hostgroup_name' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup_name, 'sort' => 'service_severity' ), array( @@ -186,7 +186,7 @@ 'service_acknowledged' => 0, 'service_in_downtime' => 0, 'host_problem' => 0, - 'hostgroup_name' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup_name, 'sort' => 'service_severity' ), array( @@ -210,7 +210,7 @@ array( 'service_state' => 3, 'service_handled' => 1, - 'hostgroup_name' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup_name, 'sort' => 'service_severity' ), array( @@ -240,7 +240,7 @@ 'service_acknowledged' => 0, 'service_in_downtime' => 0, 'host_problem' => 0, - 'hostgroup_name' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup_name, 'sort' => 'service_severity' ), array( @@ -264,7 +264,7 @@ array( 'service_state' => 1, 'service_handled' => 1, - 'hostgroup_name' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup_name, 'sort' => 'service_severity' ), array( @@ -291,7 +291,7 @@ 'monitoring/list/services', array( 'service_state' => 99, - 'hostgroup_name' => $h->hostgroup, + 'hostgroup_name' => $h->hostgroup_name, 'sort' => 'service_severity' ), array( diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php index 867da7e78..84023b971 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php @@ -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_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)', - 'hostgroup' => 'hostgroup', + 'hostgroup_name' => 'hostgroup_name', 'hostgroup_alias' => 'hostgroup_alias' ), 'servicestatussummary' => array( @@ -61,9 +61,9 @@ class GroupSummaryQuery extends IdoQuery $columns[] = 'servicegroup_alias'; $groupColumns = array('servicegroup', 'servicegroup_alias'); } else { - $columns[] = 'hostgroup'; + $columns[] = 'hostgroup_name'; $columns[] = 'hostgroup_alias'; - $groupColumns = array('hostgroup', 'hostgroup_alias'); + $groupColumns = array('hostgroup_name', 'hostgroup_alias'); } $hosts = $this->createSubQuery( 'Hoststatus', diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php index d9b4f2892..d280c7a80 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php @@ -83,7 +83,7 @@ class HoststatusQuery extends IdoQuery END' ), 'hostgroups' => array( - 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', + 'hostgroup_name' => 'hgo.name1', 'hostgroup_alias' => 'hg.alias' ), 'servicegroups' => array( diff --git a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php index bd74aebf2..f4b0cfac8 100644 --- a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php +++ b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php @@ -15,7 +15,7 @@ class Groupsummary extends DataView return array( 'servicegroup', 'servicegroup_alias', - 'hostgroup', + 'hostgroup_name', 'hostgroup_alias', 'hosts_up', 'hosts_unreachable', From c10617d409187fd6d7e6a73985bed2158decd558 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 16:28:57 +0200 Subject: [PATCH 73/80] Servicegroups: Use query column `servicegroup_name' instead of `servicegroup' refs #8613 --- .../controllers/ListController.php | 2 +- .../views/scripts/list/servicegroups.phtml | 20 +++++++++---------- .../Backend/Ido/Query/GroupsummaryQuery.php | 10 +++++----- .../Backend/Ido/Query/HoststatusQuery.php | 2 +- .../Monitoring/DataView/Groupsummary.php | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 82f3febb4..2802714aa 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -509,7 +509,7 @@ class Monitoring_ListController extends Controller ); $this->setAutorefreshInterval(12); $query = $this->backend->select()->from('groupsummary', array( - 'servicegroup', + 'servicegroup_name', 'servicegroup_alias', 'hosts_up', 'hosts_unreachable_handled', diff --git a/modules/monitoring/application/views/scripts/list/servicegroups.phtml b/modules/monitoring/application/views/scripts/list/servicegroups.phtml index cc6b76e6a..9ef23a95a 100644 --- a/modules/monitoring/application/views/scripts/list/servicegroups.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegroups.phtml @@ -28,7 +28,7 @@ - + services_critical_last_state_change_unhandled): ?> @@ -97,7 +97,7 @@ 'monitoring/list/services', array( 'service_state' => 0, - 'servicegroup_name' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup_name, 'sort' => 'service_severity' ), array( @@ -124,7 +124,7 @@ 'service_acknowledged' => 0, 'service_in_downtime' => 0, 'host_problem' => 0, - 'servicegroup_name' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup_name, 'sort' => 'service_severity' ), array( @@ -148,7 +148,7 @@ array( 'service_state' => 2, 'service_handled' => 1, - 'servicegroup_name' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup_name, 'sort' => 'service_severity' ), array( @@ -178,7 +178,7 @@ 'service_acknowledged' => 0, 'service_in_downtime' => 0, 'host_problem' => 0, - 'servicegroup_name' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup_name, 'sort' => 'service_severity' ), array( @@ -202,7 +202,7 @@ array( 'service_state' => 3, 'service_handled' => 1, - 'servicegroup_name' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup_name, 'sort' => 'service_severity' ), array( @@ -232,7 +232,7 @@ 'service_acknowledged' => 0, 'service_in_downtime' => 0, 'host_problem' => 0, - 'servicegroup_name' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup_name, 'sort' => 'service_severity' ), array( @@ -256,7 +256,7 @@ array( 'service_state' => 1, 'service_handled' => 1, - 'servicegroup_name' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup_name, 'sort' => 'service_severity' ), array( @@ -283,7 +283,7 @@ 'monitoring/list/services', array( 'service_state' => 99, - 'servicegroup_name' => $s->servicegroup, + 'servicegroup_name' => $s->servicegroup_name, 'sort' => 'service_severity' ), array( diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php index 84023b971..5852c329c 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php @@ -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_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)', - 'servicegroup' => 'servicegroup', + 'servicegroup_name' => 'servicegroup_name', 'servicegroup_alias' => 'servicegroup_alias' ) ); @@ -56,10 +56,10 @@ class GroupSummaryQuery extends IdoQuery 'host_state' ); - if (in_array('servicegroup', $this->desiredColumns)) { - $columns[] = 'servicegroup'; + if (in_array('servicegroup_name', $this->desiredColumns)) { + $columns[] = 'servicegroup_name'; $columns[] = 'servicegroup_alias'; - $groupColumns = array('servicegroup', 'servicegroup_alias'); + $groupColumns = array('servicegroup_name', 'servicegroup_alias'); } else { $columns[] = 'hostgroup_name'; $columns[] = 'hostgroup_alias'; @@ -75,7 +75,7 @@ class GroupSummaryQuery extends IdoQuery 'severity' => 'host_severity' ) ); - if (in_array('servicegroup', $this->desiredColumns)) { + if (in_array('servicegroup_name', $this->desiredColumns)) { $hosts->group(array( 'sgo.name1', 'ho.object_id', diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php index d280c7a80..5428d881e 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HoststatusQuery.php @@ -87,7 +87,7 @@ class HoststatusQuery extends IdoQuery 'hostgroup_alias' => 'hg.alias' ), 'servicegroups' => array( - 'servicegroup' => 'sgo.name1 COLLATE latin1_general_ci', + 'servicegroup_name' => 'sgo.name1', 'servicegroup_alias' => 'sg.alias' ), 'contactgroups' => array( diff --git a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php index f4b0cfac8..e60e53151 100644 --- a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php +++ b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php @@ -13,7 +13,7 @@ class Groupsummary extends DataView public function getColumns() { return array( - 'servicegroup', + 'servicegroup_name', 'servicegroup_alias', 'hostgroup_name', 'hostgroup_alias', From 24e06e5bc0ac2942702b3bc089dd3030f72e5412 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 13 Apr 2015 15:15:42 +0200 Subject: [PATCH 74/80] Alertsummary: Remove another bunch of redundant query columns --- .../controllers/AlertsummaryController.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/modules/monitoring/application/controllers/AlertsummaryController.php b/modules/monitoring/application/controllers/AlertsummaryController.php index e6b99c8a4..0f6b6cdb8 100644 --- a/modules/monitoring/application/controllers/AlertsummaryController.php +++ b/modules/monitoring/application/controllers/AlertsummaryController.php @@ -85,12 +85,7 @@ class Monitoring_AlertsummaryController extends Controller $query = $this->backend->select()->from( 'notification', array( - 'host', - 'service', - 'notification_output', - 'notification_contact', - 'notification_start_time', - 'notification_state' + 'notification_start_time' ) ); @@ -138,12 +133,7 @@ class Monitoring_AlertsummaryController extends Controller $query = $this->backend->select()->from( 'notification', array( - 'host', - 'service', - 'notification_output', - 'notification_contact', - 'notification_start_time', - 'notification_state' + 'notification_start_time' ) ); @@ -322,11 +312,7 @@ class Monitoring_AlertsummaryController extends Controller $query = $this->backend->select()->from( 'notification', array( - 'host', - 'service', 'notification_object_id', - 'notification_output', - 'notification_contact', 'notification_start_time', 'notification_state', 'acknowledgement_entry_time' From 96954ea9a170db6b8a92f7113b8975a14c8e2524 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 13 Apr 2015 15:24:15 +0200 Subject: [PATCH 75/80] NotificationQuery: Use query column `host_name' instead of `host' refs #8613 --- .../application/controllers/AlertsummaryController.php | 4 ++-- modules/monitoring/application/controllers/ListController.php | 2 +- modules/monitoring/application/controllers/ShowController.php | 2 +- .../application/views/scripts/list/notifications.phtml | 4 ++-- .../Monitoring/Backend/Ido/Query/NotificationQuery.php | 2 +- .../monitoring/library/Monitoring/DataView/Notification.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/monitoring/application/controllers/AlertsummaryController.php b/modules/monitoring/application/controllers/AlertsummaryController.php index 0f6b6cdb8..d6e95b601 100644 --- a/modules/monitoring/application/controllers/AlertsummaryController.php +++ b/modules/monitoring/application/controllers/AlertsummaryController.php @@ -59,7 +59,7 @@ class Monitoring_AlertsummaryController extends Controller $query = $this->backend->select()->from( 'notification', array( - 'host', + 'host_name', 'host_display_name', 'service', 'service_display_name', @@ -477,7 +477,7 @@ class Monitoring_AlertsummaryController extends Controller $query = $this->backend->select()->from( 'notification', array( - 'host', + 'host_name', 'host_display_name', 'service', 'service_display_name', diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 2802714aa..64cec8a2c 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -325,7 +325,7 @@ class Monitoring_ListController extends Controller ); $this->setAutorefreshInterval(15); $query = $this->backend->select()->from('notification', array( - 'host', + 'host_name', 'service', 'notification_output', 'notification_contact', diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index f41811297..680ed719d 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -156,7 +156,7 @@ class Monitoring_ShowController extends Controller $this->view->commands = $commands->paginate(); $notifications = $this->backend->select()->from('notification', array( - 'host', + 'host_name', 'service', 'notification_output', 'notification_contact', diff --git a/modules/monitoring/application/views/scripts/list/notifications.phtml b/modules/monitoring/application/views/scripts/list/notifications.phtml index cd2c46538..b5d5adde1 100644 --- a/modules/monitoring/application/views/scripts/list/notifications.phtml +++ b/modules/monitoring/application/views/scripts/list/notifications.phtml @@ -46,12 +46,12 @@ use Icinga\Module\Monitoring\Object\Service; link()->service( $notification->service, $notification->service_display_name, - $notification->host, + $notification->host_name, $notification->host_display_name ) ?> icon('host', $this->translate('Host')); ?> - link()->host($notification->host, $notification->host_display_name) ?> + link()->host($notification->host_name, $notification->host_display_name) ?>
escape($this->ellipsis($notification->notification_output, 10000)) ?> diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php index 4eebc640f..d974cd1eb 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php @@ -13,7 +13,7 @@ class NotificationQuery extends IdoQuery 'notification_object_id' => 'n.object_id' ), 'objects' => array( - 'host' => 'o.name1', + 'host_name' => 'o.name1', 'service' => 'o.name2' ), 'contact' => array( diff --git a/modules/monitoring/library/Monitoring/DataView/Notification.php b/modules/monitoring/library/Monitoring/DataView/Notification.php index b4632b57c..f716d0066 100644 --- a/modules/monitoring/library/Monitoring/DataView/Notification.php +++ b/modules/monitoring/library/Monitoring/DataView/Notification.php @@ -13,7 +13,7 @@ class Notification extends DataView public function getColumns() { return array( - 'host', + 'host_name', 'service', 'notification_state', 'notification_start_time', From 15399d77ceea9feab481289930f3afe95fa43b8c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 13 Apr 2015 15:25:10 +0200 Subject: [PATCH 76/80] NotificationQuery: Use query column `service_description' instead of `service' refs #8613 --- .../application/controllers/AlertsummaryController.php | 4 ++-- modules/monitoring/application/controllers/ListController.php | 2 +- modules/monitoring/application/controllers/ShowController.php | 2 +- .../application/views/scripts/list/notifications.phtml | 4 ++-- .../Monitoring/Backend/Ido/Query/NotificationQuery.php | 2 +- .../monitoring/library/Monitoring/DataView/Notification.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/monitoring/application/controllers/AlertsummaryController.php b/modules/monitoring/application/controllers/AlertsummaryController.php index d6e95b601..22329cd7a 100644 --- a/modules/monitoring/application/controllers/AlertsummaryController.php +++ b/modules/monitoring/application/controllers/AlertsummaryController.php @@ -61,7 +61,7 @@ class Monitoring_AlertsummaryController extends Controller array( 'host_name', 'host_display_name', - 'service', + 'service_description', 'service_display_name', 'notification_output', 'notification_contact', @@ -479,7 +479,7 @@ class Monitoring_AlertsummaryController extends Controller array( 'host_name', 'host_display_name', - 'service', + 'service_description', 'service_display_name', 'notification_output', 'notification_contact', diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 64cec8a2c..ef0ee4db2 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -326,7 +326,7 @@ class Monitoring_ListController extends Controller $this->setAutorefreshInterval(15); $query = $this->backend->select()->from('notification', array( 'host_name', - 'service', + 'service_description', 'notification_output', 'notification_contact', 'notification_start_time', diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index 680ed719d..f89b70d07 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -157,7 +157,7 @@ class Monitoring_ShowController extends Controller $notifications = $this->backend->select()->from('notification', array( 'host_name', - 'service', + 'service_description', 'notification_output', 'notification_contact', 'notification_start_time', diff --git a/modules/monitoring/application/views/scripts/list/notifications.phtml b/modules/monitoring/application/views/scripts/list/notifications.phtml index b5d5adde1..b9fd7e309 100644 --- a/modules/monitoring/application/views/scripts/list/notifications.phtml +++ b/modules/monitoring/application/views/scripts/list/notifications.phtml @@ -24,7 +24,7 @@ use Icinga\Module\Monitoring\Object\Service;
translate('CRITICAL'); ?> @@ -82,7 +82,7 @@ qlink( $h->hostgroup_alias, 'monitoring/list/hosts', - array('hostgroup_name' => $h->hostgroup), + array('hostgroup_name' => $h->hostgroup_name), array('title' => sprintf($this->translate('List all hosts in the group "%s"'), $h->hostgroup_alias)) ); ?>
translate('CRITICAL'); ?> @@ -82,7 +82,7 @@ qlink( $s->servicegroup_alias, 'monitoring/list/services', - array('servicegroup_name' => $s->servicegroup), + array('servicegroup_name' => $s->servicegroup_name), array('title' => sprintf($this->translate('List all services in the group "%s"'), $s->servicegroup_alias)) ); ?>
service)) { + if (isset($notification->service_description)) { $isService = true; $stateName = Service::getStateText($notification->notification_state); } else { @@ -44,7 +44,7 @@ use Icinga\Module\Monitoring\Object\Service; icon('service', $this->translate('Service')); ?> link()->service( - $notification->service, + $notification->service_description, $notification->service_display_name, $notification->host_name, $notification->host_display_name diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php index d974cd1eb..41526f612 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php @@ -14,7 +14,7 @@ class NotificationQuery extends IdoQuery ), 'objects' => array( 'host_name' => 'o.name1', - 'service' => 'o.name2' + 'service_description' => 'o.name2' ), 'contact' => array( 'notification_contact' => 'c_o.name1', diff --git a/modules/monitoring/library/Monitoring/DataView/Notification.php b/modules/monitoring/library/Monitoring/DataView/Notification.php index f716d0066..0eb761ae3 100644 --- a/modules/monitoring/library/Monitoring/DataView/Notification.php +++ b/modules/monitoring/library/Monitoring/DataView/Notification.php @@ -14,7 +14,7 @@ class Notification extends DataView { return array( 'host_name', - 'service', + 'service_description', 'notification_state', 'notification_start_time', 'notification_contact', From 644a386bf8ef0041497bb12dcbf72089ed55125d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 13 Apr 2015 15:26:06 +0200 Subject: [PATCH 77/80] NotificationQuery: Use query column `notification_contact_name' ...instead of `notification_contact'. refs #8613 --- .../application/controllers/AlertsummaryController.php | 4 ++-- modules/monitoring/application/controllers/ListController.php | 2 +- modules/monitoring/application/controllers/ShowController.php | 2 +- .../application/views/scripts/list/notifications.phtml | 4 ++-- .../Monitoring/Backend/Ido/Query/NotificationQuery.php | 2 +- .../monitoring/library/Monitoring/DataView/Notification.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/monitoring/application/controllers/AlertsummaryController.php b/modules/monitoring/application/controllers/AlertsummaryController.php index 22329cd7a..0d3917e90 100644 --- a/modules/monitoring/application/controllers/AlertsummaryController.php +++ b/modules/monitoring/application/controllers/AlertsummaryController.php @@ -64,7 +64,7 @@ class Monitoring_AlertsummaryController extends Controller 'service_description', 'service_display_name', 'notification_output', - 'notification_contact', + 'notification_contact_name', 'notification_start_time', 'notification_state' ) @@ -482,7 +482,7 @@ class Monitoring_AlertsummaryController extends Controller 'service_description', 'service_display_name', 'notification_output', - 'notification_contact', + 'notification_contact_name', 'notification_start_time', 'notification_state' ) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index ef0ee4db2..b06291c67 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -328,7 +328,7 @@ class Monitoring_ListController extends Controller 'host_name', 'service_description', 'notification_output', - 'notification_contact', + 'notification_contact_name', 'notification_start_time', 'notification_state', 'host_display_name', diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index f89b70d07..0d7df501a 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -159,7 +159,7 @@ class Monitoring_ShowController extends Controller 'host_name', 'service_description', 'notification_output', - 'notification_contact', + 'notification_contact_name', 'notification_start_time', 'notification_state', 'host_display_name', diff --git a/modules/monitoring/application/views/scripts/list/notifications.phtml b/modules/monitoring/application/views/scripts/list/notifications.phtml index b9fd7e309..9a3b424b4 100644 --- a/modules/monitoring/application/views/scripts/list/notifications.phtml +++ b/modules/monitoring/application/views/scripts/list/notifications.phtml @@ -61,9 +61,9 @@ use Icinga\Module\Monitoring\Object\Service; translate('Sent to %s'), $this->qlink( - $notification->notification_contact, + $notification->notification_contact_name, 'monitoring/show/contact', - array('contact_name' => $notification->notification_contact) + array('contact_name' => $notification->notification_contact_name) ) ) ?> diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php index 41526f612..3496ca9e2 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php @@ -17,7 +17,7 @@ class NotificationQuery extends IdoQuery 'service_description' => 'o.name2' ), 'contact' => array( - 'notification_contact' => 'c_o.name1', + 'notification_contact_name' => 'c_o.name1', 'contact_object_id' => 'c_o.object_id' ), 'command' => array( diff --git a/modules/monitoring/library/Monitoring/DataView/Notification.php b/modules/monitoring/library/Monitoring/DataView/Notification.php index 0eb761ae3..757334063 100644 --- a/modules/monitoring/library/Monitoring/DataView/Notification.php +++ b/modules/monitoring/library/Monitoring/DataView/Notification.php @@ -17,7 +17,7 @@ class Notification extends DataView 'service_description', 'notification_state', 'notification_start_time', - 'notification_contact', + 'notification_contact_name', 'notification_output', 'notification_command', 'host_display_name', From 3653ec810a71bbfbef3468ca7e80a4208e46c935 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 13 Apr 2015 15:32:52 +0200 Subject: [PATCH 78/80] NotificationQuery: Provide case-insensitive filter column `host' refs #8613 --- .../Monitoring/Backend/Ido/Query/NotificationQuery.php | 1 + .../monitoring/library/Monitoring/DataView/Notification.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php index 3496ca9e2..b60e98a62 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php @@ -13,6 +13,7 @@ class NotificationQuery extends IdoQuery 'notification_object_id' => 'n.object_id' ), 'objects' => array( + 'host' => 'o.name1 COLLATE latin1_general_ci', 'host_name' => 'o.name1', 'service_description' => 'o.name2' ), diff --git a/modules/monitoring/library/Monitoring/DataView/Notification.php b/modules/monitoring/library/Monitoring/DataView/Notification.php index 757334063..3da39877f 100644 --- a/modules/monitoring/library/Monitoring/DataView/Notification.php +++ b/modules/monitoring/library/Monitoring/DataView/Notification.php @@ -34,4 +34,9 @@ class Notification extends DataView ) ); } + + public function getFilterColumns() + { + return array('host'); + } } From 29f05bf87813c7097643d9037a6085c6432900cb Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 13 Apr 2015 15:33:19 +0200 Subject: [PATCH 79/80] NotificationQuery: Provide case-insensitive filter column `service' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/NotificationQuery.php | 1 + modules/monitoring/library/Monitoring/DataView/Notification.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php index b60e98a62..db267fbc9 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php @@ -15,6 +15,7 @@ class NotificationQuery extends IdoQuery 'objects' => array( 'host' => 'o.name1 COLLATE latin1_general_ci', 'host_name' => 'o.name1', + 'service' => 'o.name2 COLLATE latin1_general_ci', 'service_description' => 'o.name2' ), 'contact' => array( diff --git a/modules/monitoring/library/Monitoring/DataView/Notification.php b/modules/monitoring/library/Monitoring/DataView/Notification.php index 3da39877f..f84eaddf0 100644 --- a/modules/monitoring/library/Monitoring/DataView/Notification.php +++ b/modules/monitoring/library/Monitoring/DataView/Notification.php @@ -37,6 +37,6 @@ class Notification extends DataView public function getFilterColumns() { - return array('host'); + return array('host', 'service'); } } From 9cc546930515eff34b2628e840a3365739ce4dd2 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 13 Apr 2015 15:33:33 +0200 Subject: [PATCH 80/80] NotificationQuery: Provide case-insensitive filter column `contact' refs #8613 --- .../library/Monitoring/Backend/Ido/Query/NotificationQuery.php | 1 + modules/monitoring/library/Monitoring/DataView/Notification.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php index db267fbc9..0133dc637 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/NotificationQuery.php @@ -19,6 +19,7 @@ class NotificationQuery extends IdoQuery 'service_description' => 'o.name2' ), 'contact' => array( + 'contact' => 'c_o.name1 COLLATE latin1_general_ci', 'notification_contact_name' => 'c_o.name1', 'contact_object_id' => 'c_o.object_id' ), diff --git a/modules/monitoring/library/Monitoring/DataView/Notification.php b/modules/monitoring/library/Monitoring/DataView/Notification.php index f84eaddf0..48d8fd058 100644 --- a/modules/monitoring/library/Monitoring/DataView/Notification.php +++ b/modules/monitoring/library/Monitoring/DataView/Notification.php @@ -37,6 +37,6 @@ class Notification extends DataView public function getFilterColumns() { - return array('host', 'service'); + return array('host', 'service', 'contact'); } }