Skip to content

Commit

Permalink
Centreon, 24.04, Fix ack on host
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitPoulet committed Apr 18, 2024
1 parent 5d994ea commit 51b8b9a
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions Nagstamon/Servers/Centreon/CentreonAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@ def init_config(self):
self.restapi_version = "v22.04"
elif self.centreon_version_major == 23 and self.centreon_version_minor == 4:
self.restapi_version = "v23.04"
else:
elif self.centreon_version_major == 23 and self.centreon_version_minor == 10:
self.restapi_version = "v23.10"
elif self.centreon_version_major == 24:
self.restapi_version = "v24.04"
else:
self.restapi_version = "v24.04"
if conf.debug_mode is True:
self.Debug(server='[' + self.get_name() + ']', debug='Centreon API version used : ' + self.restapi_version)

Expand Down Expand Up @@ -486,14 +490,22 @@ def _set_acknowledge(self, host, service, author, comment, sticky, notify, persi
# host
if service == '':
host_id = self.get_host_and_service_id(host)

new_resource = {
"type": "host",
"id": host_id,
"parent": {
"id": None
if self.centreon_version_major >= 24:
new_resource = {
"type": "host",
"id": host_id,
"parent": {
"id": host_id
}
}
else:
new_resource = {
"type": "host",
"id": host_id,
"parent": {
"id": None
}
}
}

acknowledgements["resources"].append(new_resource)

Expand Down

0 comments on commit 51b8b9a

Please sign in to comment.