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

Usage of IcingaWeb2 api command returns 404, but is successful #5183

Closed
K0nne opened this issue Jan 18, 2024 · 2 comments · Fixed by #5186
Closed

Usage of IcingaWeb2 api command returns 404, but is successful #5183

K0nne opened this issue Jan 18, 2024 · 2 comments · Fixed by #5186
Assignees
Labels
bug Something isn't working ref/IP
Milestone

Comments

@K0nne
Copy link

K0nne commented Jan 18, 2024

Describe the bug

When I use the icingaweb2 api, some commands return a 404, but the commands are successful executed.

To Reproduce

IcingaWeb2 2.9.6

curl -H "Accept: application/json" -u usr:pwd -X POST \
"https://fqdn/icingaweb2/monitoring/downtimes/delete-all?hostgroup_name=hostgroupname"

returns:
{"status":"error","message":"fqdn master1: Can't send external Icinga command: 404 No objects found.\nfqdn master2: Can't send external Icinga command: 404 No objects found."}

IcingaWeb2 2.12.1

curl -H "Accept: application/json" -u usr:pwd -X POST \
"https://fqdn/icingaweb2/monitoring/downtimes/delete-all?host_name=hostname"

Interestingly it works for single services with ?host=<hostname>&service=<servicename>

curl -H "Accept: application/json" -u usr:pwd -X POST \
"https://fqdn/icingaweb2/monitoring/downtimes/delete-all?hostgroup_name=hostgroupname"

returns:
{"status":"error","message":"fqdn master1: Can't send external Icinga command: 404 No objects found.\nfqdn master2: Can't send external Icinga command: 404 No objects found."}

Expected behavior

Successful execution should be reflected as such.

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Icinga Web 2 version and modules (System - About):
  • Web browser used: curl
  • Icinga 2 version used (icinga2 --version): 2.13.9
  • PHP version used (php --version):

RHEL7 with Icingaweb2 2.9.6:

php --version
PHP 5.4.16 (cli) (built: Oct 29 2019 09:56:22)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

RHEL8 with IcingaWeb2 2.12.1:

php --version
PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

  • Server operating system and version: RHEL7 / RHEL8

Additional context

icingaweb2 --> icinga: permissions = [ "status/query", "actions/*", "objects/modify/*", "objects/query/*", ]

WebUser permissions are the same in 2.9.6 and 2.12.1:
image

@nilmerg
Copy link
Member

nilmerg commented Jan 18, 2024

Hi,

this is hardly an issue with Icinga Web. The result you get is what Web gets from Icinga's API.

I don't know what the issue is, but it seems to me that some of the hosts in the group are not found, and some are. Or that some of the hosts have no downtime, but some have.

@nilmerg nilmerg transferred this issue from Icinga/icingaweb2 Jan 18, 2024
@K0nne K0nne changed the title Usage of IcingaWeb2 api commands returns 404, but is successful Usage of IcingaWeb2 api command returns 404, but is successful Feb 8, 2024
@nilmerg nilmerg transferred this issue from Icinga/icinga2 Feb 9, 2024
@nilmerg nilmerg self-assigned this Feb 9, 2024
@nilmerg nilmerg added this to the 2.12.2 milestone Feb 9, 2024
@nilmerg nilmerg added the bug Something isn't working label Feb 9, 2024
@nilmerg
Copy link
Member

nilmerg commented Feb 9, 2024

Looked at it again. This changed with Icinga 2.13.0 due to Icinga/icinga2#8913 and Web still tries to remove child downtimes.

ref/IP/52026

@nilmerg nilmerg added the ref/IP label Feb 9, 2024
nilmerg added a commit that referenced this issue Feb 9, 2024
nilmerg added a commit that referenced this issue Feb 9, 2024
nilmerg added a commit that referenced this issue Feb 9, 2024
nilmerg added a commit that referenced this issue Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ref/IP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants