MonitoredObject: Only select history entries for the respective object
And fix that the default sort order is not applied. fixes #9963
This commit is contained in:
parent
7812f6ddcc
commit
65806fafbf
|
@ -496,7 +496,8 @@ abstract class DataView implements QueryInterface, SortRules, FilterColumns, Ite
|
|||
*/
|
||||
public function peekAhead($state = true)
|
||||
{
|
||||
return $this->query->peekAhead($state);
|
||||
$this->query->peekAhead($state);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -450,21 +450,29 @@ abstract class MonitoredObject implements Filterable
|
|||
*/
|
||||
public function fetchEventhistory()
|
||||
{
|
||||
$eventHistory = $this->backend->select()->from('eventhistory', array(
|
||||
'object_type',
|
||||
'host_name',
|
||||
'host_display_name',
|
||||
'service_description',
|
||||
'service_display_name',
|
||||
'timestamp',
|
||||
'state',
|
||||
'output',
|
||||
'type'
|
||||
))
|
||||
$eventHistory = $this->backend
|
||||
->select()
|
||||
->from(
|
||||
'eventhistory',
|
||||
array(
|
||||
'object_type',
|
||||
'host_name',
|
||||
'host_display_name',
|
||||
'service_description',
|
||||
'service_display_name',
|
||||
'timestamp',
|
||||
'state',
|
||||
'output',
|
||||
'type'
|
||||
)
|
||||
)
|
||||
->where('object_type', $this->type)
|
||||
->where('host_name', $this->host_name);
|
||||
|
||||
if ($this->type === self::TYPE_SERVICE) {
|
||||
$eventHistory->where('service_description', $this->service_description);
|
||||
}
|
||||
|
||||
$this->eventhistory = $eventHistory->applyFilter($this->getFilter());
|
||||
return $this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue