Skip to content

Commit c919567

Browse files
kaszubaArtur Kaszuba
andauthored
Fix for Icinga2API acknowledged services and hosts (#1178)
Co-authored-by: Artur Kaszuba <artur@netmix.pl>
1 parent 3d46d8f commit c919567

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Nagstamon/servers/Icinga2API.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def _get_status(self):
107107
self.new_hosts[host_name].passiveonly = not(host['attrs']['enable_active_checks'])
108108
self.new_hosts[host_name].notifications_disabled = not(host['attrs']['enable_notifications'])
109109
self.new_hosts[host_name].flapping = host['attrs']['flapping']
110-
self.new_hosts[host_name].acknowledged = host['attrs']['acknowledgement']
110+
self.new_hosts[host_name].acknowledged = bool(host['attrs']['acknowledgement'])
111111
self.new_hosts[host_name].scheduled_downtime = bool(host['attrs']['downtime_depth'])
112112
self.new_hosts[host_name].status_type = {0: "soft", 1: "hard"}[host['attrs']['state_type']]
113113
del host_name
@@ -148,7 +148,7 @@ def _get_status(self):
148148
new_service.passiveonly = not(service['attrs']['enable_active_checks'])
149149
new_service.notifications_disabled = not(service['attrs']['enable_notifications'])
150150
new_service.flapping = service['attrs']['flapping']
151-
new_service.acknowledged = service['attrs']['acknowledgement']
151+
new_service.acknowledged = bool(service['attrs']['acknowledgement'])
152152
new_service.scheduled_downtime = bool(service['attrs']['downtime_depth'])
153153
new_service.status_type = {0: "soft", 1: "hard"}[service['attrs']['state_type']]
154154
self._insert_service_to_hosts(new_service)

0 commit comments

Comments
 (0)