From b47448218874f3e192dffcc60c9c5456bee52250 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 12 Jan 2017 16:05:29 +0100 Subject: [PATCH] Fix local timestamp for PostgreSQL queries This fixes the "monitoring health" view indicating that Icinga 2 isn't updating the database, even if status_update_time uptodate. refs #2651 Signed-off-by: Eric Lippmann --- .../library/Monitoring/Backend/Ido/Query/IdoQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php index b81adb85d..47bb48a74 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php @@ -656,7 +656,7 @@ abstract class IdoQuery extends DbQuery $column ); if (version_compare($this->getIdoVersion(), '1.14.2', '>=')) { - $column = str_replace('NOW()', 'localtimestamp', $column); + $column = str_replace('NOW()', 'NOW() AT TIME ZONE \'UTC\'', $column); } else { $column = preg_replace( '/UNIX_TIMESTAMP(\((?>[^()]|(?-1))*\))/i',