Help with filter on custom variables

Hi all!

I have a couple of services in my Icinga defined so:

object Service “[System] System Load [T97332]” {

vars.specialperms = “Devs”

then I defined an API user as:

object ApiUser “api_devs” {
password = CONSTANT_PasswdApiUserDevs
permissions = [
permission = “actions/*”
filter = {{ regex("^Devs", service.vars.specialperms) }}

Now I’d like to define a downtime for all these services and I try so:

curl -k -s -u api_devs:mypass -H ‘Accept: application/json’
-X POST ‘https://localhost:5665/v1/actions/schedule-downtime
-d “$(jo -p pretty=true type=Service filter=“service.vars.specialperms == “Devs”)”
author=DEVS comment=“TEST”
fixed=true start_time=$(date “+%s”) end_time=$(date “+%s” -d “+1 minutes”))”

Unfortunately it does not work and I get always:

“error”: 404.0,
“status”: “No objects found.”

Could someone say me where is my error?
I use Icinga 2.10.3-1 from Debian 10 repositories.

Thanks a lot

Hello there,
sadly I can’t help you with your topic but I would like to point you to our markdown formatting guidelines so your post is more readable :slight_smile: