I want to remove an ACK for a specific service and always get the answer:
{"error":404,"status":"No objects found."}
Here’s the curl command I’m sending:
curl -k -s -S -i -u ticket-autoack:REDACTED -X POST \
-H 'Accept: application/json'\
'https://icinga2:5665/v1/actions/remove-acknowledgement' \
-d '{ "type": "Service", "filter": "host.name==\"THE HOSTNAME\" && service.name==\"THE SERVICENAME\"" }'
Of course I’ve tripple-checked Hostname and Servicename, and for testing the filter I tried the following:
curl -k -s -S -i -u ticket-autoack:REDACTED -X POST \
-H 'Accept: application/json' \
-H 'X-HTTP-Method-Override: GET' \
'https://icinga2:5665/v1/objects/services' \
-d '{ "type": "Service", "filter": "host.name==\"THE HOSTNAME\" && service.name==\"THE SERVICENAME\"" }'
This returns the object as expected, including:
"acknowledgement": 2,
"acknowledgement_expiry": 1731989586,
"acknowledgement_last_change": 1730779987.021408,
So I don’t see what’s wrong with my filter, as it works with objects/services but not with /actions/remove-acknowledgement.
The acknowledgement I try to remove does have an expiration date.
- Version used (
icinga2 --version
) r2.14.2-1