From b8efe01170e15b228a12e381db474e646ceb1f69 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 10 Apr 2015 12:56:18 +0200 Subject: [PATCH] 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'); + } }