From eb1cdaf39f845049c96787ece0cf741298627faa Mon Sep 17 00:00:00 2001 From: Henri Wahl <2835065+HenriWahl@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:47:35 +0100 Subject: [PATCH] Fixes 3 16 0 (#1081) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update nagstamon.appdata.xml Release 3.16.2 (cherry picked from commit 78653d53447f14e19fc11471f358ae7ee76bf8a1) * Fix incorrect definition of “quote” for host link (#1074) * fix: resolve double URL encoding issue on macOS * fix: resolve double URL encoding issue on macOS --------- Co-authored-by: Andrii Ivanov Co-authored-by: Henri Wahl <2835065+HenriWahl@users.noreply.github.com> (cherry picked from commit 5a37b6c0e23f71012565de0d8ec4db3d710620df) * 3.17-20241028 * Incorrect display of last_check field (#1075) Incorrect display of last_check field (#1075) --------- Co-authored-by: Dregaringo <46315689+Dregaringo@users.noreply.github.com> Co-authored-by: wigor2206 --- Nagstamon/Config.py | 2 +- Nagstamon/Servers/IcingaDBWeb.py | 18 ++++++++++++++---- build/debian/changelog | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Nagstamon/Config.py b/Nagstamon/Config.py index 0aaa0c7c..33db9047 100644 --- a/Nagstamon/Config.py +++ b/Nagstamon/Config.py @@ -131,7 +131,7 @@ class AppInfo(object): contains app information previously located in GUI.py """ NAME = 'Nagstamon' - VERSION = '3.16.2' + VERSION = '3.17-20241102' WEBSITE = 'https://nagstamon.de' COPYRIGHT = '©2008-2024 Henri Wahl et al.' COMMENTS = 'Nagios status monitor for your desktop' diff --git a/Nagstamon/Servers/IcingaDBWeb.py b/Nagstamon/Servers/IcingaDBWeb.py index 8340d7c4..fc1691eb 100644 --- a/Nagstamon/Servers/IcingaDBWeb.py +++ b/Nagstamon/Servers/IcingaDBWeb.py @@ -210,9 +210,14 @@ def _get_status(self): self.new_hosts[host_name].status = self.STATES_MAPPING['hosts'][int(h['state']['soft_state'])] if h['state']['last_update'].replace(".", "").isnumeric(): # new version of icingadb doesnt return unix timestamp - self.new_hosts[host_name].last_check = datetime.datetime.fromtimestamp(int(float(h['state']['last_update']))) + #self.new_hosts[host_name].last_check = datetime.datetime.fromtimestamp(int(float(h['state']['last_update']))) + utc_time = datetime.datetime.fromtimestamp(int(float(h['state']['last_update'])), tz=timezone.utc) else: - self.new_hosts[host_name].last_check = datetime.datetime.fromisoformat(h['state']['last_update']) + #self.new_hosts[host_name].last_check = datetime.datetime.fromisoformat(h['state']['last_update']) + utc_time = datetime.datetime.fromisoformat(h['state']['last_update']) + + local_time = utc_time.astimezone() + self.new_hosts[host_name].last_check = local_time.strftime("%Y-%m-%d %H:%M:%S") # format without microseconds and tz self.new_hosts[host_name].attempt = "{}/{}".format(h['state']['check_attempt'],h['max_check_attempts']) self.new_hosts[host_name].status_information = BeautifulSoup(str(h['state']['output']).replace('\n', ' ').strip(), 'html.parser').text @@ -313,9 +318,14 @@ def _get_status(self): self.new_hosts[host_name].services[service_name].status = self.STATES_MAPPING['services'][int(s['state']['soft_state'])] if s['state']['last_update'].replace(".", "").isnumeric(): # new version of icingadb doesnt return unix timestamp - self.new_hosts[host_name].services[service_name].last_check = datetime.datetime.fromtimestamp(int(float(s['state']['last_update']))) + #self.new_hosts[host_name].services[service_name].last_check = datetime.datetime.fromtimestamp(int(float(s['state']['last_update']))) + utc_time = datetime.datetime.fromtimestamp(int(float(s['state']['last_update'])), tz=timezone.utc) else: - self.new_hosts[host_name].services[service_name].last_check = datetime.datetime.fromisoformat(s['state']['last_update']) + #self.new_hosts[host_name].services[service_name].last_check = datetime.datetime.fromisoformat(s['state']['last_update']) + utc_time = datetime.datetime.fromisoformat(s['state']['last_update']) + + local_time = utc_time.astimezone() + self.new_hosts[host_name].services[service_name].last_check = local_time.strftime("%Y-%m-%d %H:%M:%S") # format without microseconds and tz self.new_hosts[host_name].services[service_name].attempt = "{}/{}".format(s['state']['check_attempt'],s['max_check_attempts']) self.new_hosts[host_name].services[service_name].status_information = BeautifulSoup(str(s['state']['output']).replace('\n', ' ').strip(), 'html.parser').text diff --git a/build/debian/changelog b/build/debian/changelog index ba53a1b0..7a926632 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,9 +1,9 @@ -nagstamon (3.16.2) unstable; urgency=low +nagstamon (3.17-20241102) unstable; urgency=low * New upstream - fix sound problem - fix IncingaDBWeb - -- Henri Wahl Mon, Oct 21 2024 08:00:00 +0200 + -- Henri Wahl Sat, Nov 02 2024 08:00:00 +0200 nagstamon (3.16.1) stable; urgency=low * New upstream