Merge pull request #3220 from Icinga/fix/filter-by-custom-variables
Fix filter by host custom variables
This commit is contained in:
commit
6abb91421a
|
@ -964,6 +964,12 @@ abstract class IdoQuery extends DbQuery
|
|||
$leftcol = 'h.host_object_id';
|
||||
}
|
||||
|
||||
$mapped = $this->getMappedField($leftcol);
|
||||
if ($mapped !== null) {
|
||||
$this->requireColumn($leftcol);
|
||||
$leftcol = $mapped;
|
||||
}
|
||||
|
||||
$joinOn = sprintf(
|
||||
$this->customVarsJoinTemplate,
|
||||
$leftcol,
|
||||
|
|
|
@ -18,6 +18,9 @@ class ServicegroupQuery extends IdoQuery
|
|||
'hostgroups' => array(
|
||||
'hostgroup_name' => 'hgo.name1'
|
||||
),
|
||||
'hosts' => array(
|
||||
'h.host_object_id' => 's.host_object_id'
|
||||
),
|
||||
'instances' => array(
|
||||
'instance_name' => 'i.instance_name'
|
||||
),
|
||||
|
@ -70,6 +73,16 @@ class ServicegroupQuery extends IdoQuery
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Join hosts
|
||||
*
|
||||
* This is required to make filters work which filter by host custom variables.
|
||||
*/
|
||||
protected function joinHosts()
|
||||
{
|
||||
$this->requireVirtualTable('services');
|
||||
}
|
||||
|
||||
/**
|
||||
* Join instances
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue