Skip to content

Commit

Permalink
Fixes 3 16 0 (#1081)
Browse files Browse the repository at this point in the history
* Update nagstamon.appdata.xml

Release 3.16.2

(cherry picked from commit 78653d5)

* 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 <[email protected]>
Co-authored-by: Henri Wahl <[email protected]>
(cherry picked from commit 5a37b6c)

* 3.17-20241028

* Incorrect display of last_check field (#1075)

Incorrect display of last_check field (#1075)

---------

Co-authored-by: Dregaringo <[email protected]>
Co-authored-by: wigor2206 <[email protected]>
  • Loading branch information
3 people authored Nov 18, 2024
1 parent 2fe0aa1 commit eb1cdaf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Nagstamon/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
18 changes: 14 additions & 4 deletions Nagstamon/Servers/IcingaDBWeb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions build/debian/changelog
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> Mon, Oct 21 2024 08:00:00 +0200
-- Henri Wahl <[email protected]> Sat, Nov 02 2024 08:00:00 +0200

nagstamon (3.16.1) stable; urgency=low
* New upstream
Expand Down

0 comments on commit eb1cdaf

Please sign in to comment.