Don't call UNIX_TIMESTAMP when sorting by service_last_state_change

Else possible indices can't be used.
This commit is contained in:
Eric Lippmann 2017-07-27 15:03:12 +02:00 committed by Eric Lippmann
parent 9b529bcd15
commit 3a1afb3511
2 changed files with 5 additions and 0 deletions

View File

@ -192,6 +192,7 @@ class ServicestatusQuery extends IdoQuery
'service_last_hard_state_change' => 'UNIX_TIMESTAMP(ss.last_hard_state_change)',
'service_last_notification' => 'UNIX_TIMESTAMP(ss.last_notification)',
'service_last_state_change' => 'UNIX_TIMESTAMP(ss.last_state_change)',
'service_last_state_change_ts' => 'ss.last_state_change',
'service_last_time_critical' => 'ss.last_time_critical',
'service_last_time_ok' => 'ss.last_time_ok',
'service_last_time_unknown' => 'ss.last_time_unknown',

View File

@ -73,6 +73,7 @@ class ServiceStatus extends DataView
'service_last_hard_state_change',
'service_last_notification',
'service_last_state_change',
'service_last_state_change_ts',
'service_last_time_critical',
'service_last_time_ok',
'service_last_time_unknown',
@ -122,6 +123,9 @@ class ServiceStatus extends DataView
'order' => self::SORT_DESC
),
'service_last_state_change' => array(
'columns' => array(
'service_last_state_change_ts'
),
'order' => self::SORT_DESC
),
'host_severity' => array(