From db9888b1f1380355c68d759b59844e17b0241043 Mon Sep 17 00:00:00 2001 From: Gianluca Piccolo Date: Wed, 5 Apr 2023 10:37:34 +0200 Subject: [PATCH] Fixes #5020 --- .../Backend/Ido/Query/HostdowntimeendhistoryQuery.php | 4 +++- .../Backend/Ido/Query/HostdowntimestarthistoryQuery.php | 4 +++- .../Backend/Ido/Query/ServicedowntimeendhistoryQuery.php | 4 +++- .../Backend/Ido/Query/ServicedowntimestarthistoryQuery.php | 3 +++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeendhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeendhistoryQuery.php index 77d91e5ef9..808b3f2cd8 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeendhistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimeendhistoryQuery.php @@ -29,7 +29,9 @@ protected function requireFilterColumns(Filter $filter) protected function joinBaseTables() { parent::joinBaseTables(true); - $this->select->where("hdh.actual_end_time > '1970-01-02 00:00:00'"); + $this->select->where( + "hdh.actual_end_time > '1970-01-02 00:00:00' AND hdh.was_started = 1 AND hdh.was_cancelled = 0" + ); $this->columnMap['downtimehistory']['type'] = "('dt_end')"; $this->columnMap['downtimehistory']['timestamp'] = str_replace( 'actual_start_time', diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php index 54ac6a11c6..a6f97e703d 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php @@ -102,7 +102,9 @@ protected function joinBaseTables() "hdh.actual_start_time > '1970-01-02 00:00:00'" ); } - + $this->select->where( + "hdh.was_started = 1 AND hdh.was_cancelled = 0" + ); $this->joinedVirtualTables['downtimehistory'] = true; } diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimeendhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimeendhistoryQuery.php index 2d592c85f8..6243829444 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimeendhistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimeendhistoryQuery.php @@ -29,7 +29,9 @@ protected function requireFilterColumns(Filter $filter) protected function joinBaseTables() { parent::joinBaseTables(true); - $this->select->where("sdh.actual_end_time > '1970-01-02 00:00:00'"); + $this->select->where( + "sdh.actual_end_time > '1970-01-02 00:00:00' AND sdh.was_started = 1 AND sdh.was_cancelled = 0" + ); $this->columnMap['downtimehistory']['type'] = "('dt_end')"; $this->columnMap['downtimehistory']['timestamp'] = str_replace( 'actual_start_time', diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php index f22e265cba..b8805fe8d4 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php @@ -103,6 +103,9 @@ protected function joinBaseTables() "sdh.actual_start_time > '1970-01-02 00:00:00'" ); } + $this->select->where( + "sdh.was_started = 1 AND sdh.was_cancelled = 0" + ); $this->joinedVirtualTables['downtimehistory'] = true; }