Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 3 16 0 #1081

Merged
merged 5 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading