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

Centreon, 24.04, Fix ack on host #1030

Merged
merged 1 commit into from
Apr 20, 2024
Merged
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
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
Loading