monitoring: Fix that host_display_name is NULL when the object is a service in the evenhistory overview

refs #7843
This commit is contained in:
Eric Lippmann 2015-01-21 12:51:47 +01:00
parent 2fdeabd398
commit d528ddc641

View File

@ -33,7 +33,7 @@ class EventHistoryQuery extends IdoQuery
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
), ),
'hosts' => array( 'hosts' => array(
'host_display_name' => 'h.display_name' 'host_display_name' => 'CASE WHEN sh.display_name IS NOT NULL THEN sh.display_name ELSE h.display_name END'
), ),
'services' => array( 'services' => array(
'service_display_name' => 's.display_name' 'service_display_name' => 's.display_name'
@ -137,6 +137,11 @@ class EventHistoryQuery extends IdoQuery
's.service_object_id = eho.object_id', 's.service_object_id = eho.object_id',
array() array()
); );
$this->select->joinLeft(
array('sh' => $this->prefix . 'hosts'),
'sh.host_object_id = s.host_object_id',
array()
);
return $this; return $this;
} }
} }