[Pkg-nagios-devel] Bug#896811: stretch-pu: package icinga2/2.6.0-2+deb9u1
Felix Geyer
fgeyer at debian.org
Tue Apr 24 13:59:35 BST 2018
Package: release.debian.org
Severity: normal
Tags: stretch
User: release.debian.org at packages.debian.org
Usertags: pu
Hi,
Icinga2 2.6.0 stores timestamps as local time instead of UTC in the
database when the PostgreSQL IDO backend is used.
The result is that Icinga Web 2 displays all date/times with an offset
(unless system time is UTC of course).
While you could argue that this is only a cosmetic problem I think it's
important for a monitoring system to display the correct time.
This has been fixed upstream in 2.6.1.
Bug report is at https://github.com/Icinga/icinga2/issues/4874
I'd like to upload this fix to stretch, debdiff is attached.
Felix
-------------- next part --------------
diff -Nru icinga2-2.6.0/debian/changelog icinga2-2.6.0/debian/changelog
--- icinga2-2.6.0/debian/changelog 2016-12-19 16:13:45.000000000 +0100
+++ icinga2-2.6.0/debian/changelog 2018-04-23 15:47:44.000000000 +0200
@@ -1,3 +1,9 @@
+icinga2 (2.6.0-2+deb9u1) stretch; urgency=medium
+
+ * Fix timestamps being stored as local time in PostgreSQL.
+
+ -- Felix Geyer <felix.geyer at credativ.de> Mon, 23 Apr 2018 15:47:44 +0200
+
icinga2 (2.6.0-2) unstable; urgency=medium
* [e0f34e4] Add patch 41_ido_mysql57 - for compatibility with MySQL 5.7
diff -Nru icinga2-2.6.0/debian/patches/43_postgres_timezone icinga2-2.6.0/debian/patches/43_postgres_timezone
--- icinga2-2.6.0/debian/patches/43_postgres_timezone 1970-01-01 01:00:00.000000000 +0100
+++ icinga2-2.6.0/debian/patches/43_postgres_timezone 2018-04-18 08:17:02.000000000 +0200
@@ -0,0 +1,23 @@
+From e9db716b26e49a36d733d5e224280fb63943fb9f Mon Sep 17 00:00:00 2001
+From: Michael Friedrich <michael.friedrich at netways.de>
+Date: Wed, 11 Jan 2017 17:34:09 +0100
+Subject: [PATCH] Ensure that PostgreSQL timestamps are UTC
+
+fixes #13617
+---
+ lib/db_ido_pgsql/idopgsqlconnection.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/db_ido_pgsql/idopgsqlconnection.cpp b/lib/db_ido_pgsql/idopgsqlconnection.cpp
+index f398fda50..c16f9f50f 100644
+--- a/lib/db_ido_pgsql/idopgsqlconnection.cpp
++++ b/lib/db_ido_pgsql/idopgsqlconnection.cpp
+@@ -636,7 +636,7 @@ bool IdoPgsqlConnection::FieldToEscapedString(const String& key, const Value& va
+ } else if (DbValue::IsTimestamp(value)) {
+ long ts = rawvalue;
+ std::ostringstream msgbuf;
+- msgbuf << "TO_TIMESTAMP(" << ts << ")";
++ msgbuf << "TO_TIMESTAMP(" << ts << ") AT TIME ZONE 'UTC'";
+ *result = Value(msgbuf.str());
+ } else if (DbValue::IsTimestampNow(value)) {
+ *result = "NOW()";
diff -Nru icinga2-2.6.0/debian/patches/series icinga2-2.6.0/debian/patches/series
--- icinga2-2.6.0/debian/patches/series 2016-12-16 18:28:37.000000000 +0100
+++ icinga2-2.6.0/debian/patches/series 2018-04-18 08:56:34.000000000 +0200
@@ -1,3 +1,4 @@
21_config_changes
41_ido_mysql57
42_mips_boost_bind_workaround
+43_postgres_timezone
More information about the Pkg-nagios-devel
mailing list