Skip to content

Commit

Permalink
CustomvarQuery: Remove COLLATE from query columns
Browse files Browse the repository at this point in the history
...and provide case-insensitive filter columns alternatively.

refs #8613
  • Loading branch information
Johannes Meyer committed Apr 10, 2015
1 parent 0628efb commit b8efe01
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Expand Up @@ -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"
),
);

Expand Down
11 changes: 10 additions & 1 deletion modules/monitoring/library/Monitoring/DataView/Customvar.php
Expand Up @@ -19,7 +19,11 @@ public function getColumns()
'varname',
'varvalue',
'is_json',
'object_type'
'host_name',
'service_description',
'contact_name',
'object_type',
'object_type_id'
);
}

Expand All @@ -37,4 +41,9 @@ public function getSortRules()
)
);
}

public function getFilterColumns()
{
return array('host', 'service', 'contact');
}
}

0 comments on commit b8efe01

Please sign in to comment.