Icinga Director - Dynamic Ranges for Schedule Downtime

Hi everyone,

Is there a possible dynamic range for schedule downtime from custom variable (backup_downtime) of host? We could this without director module but I got error when I tried in director:

  • Director version : 1.11.5
  • Icinga Web 2 version and modules : 2.12.4
  • Icinga 2 version (icinga2 --version): r2.15.2-1
  • Operating System and version: Red Hat Enterprise Linux 8.10 (Ootpa)
  • Webserver, PHP versions: Server version: Apache/2.4.37 (Red Hat Enterprise Linux), PHP 8.0.30 (cli)

Thanks.

Okay do you have an example of host.vars.backup_downtime? like what value.

I set the value of host.vars.backup_downtime on a server as follows:

another host example:

The director doesn’t allow DSL in the ranges field and interprets it just as a string.

I have no idea if that works, but the $ signs are missing it should be:

$host.vars.backup_downtime$

ps it doesnt:

[2026-03-05 22:00:07 +0100] information/cli: Icinga application loader (version: r2.15.2-1)
[2026-03-05 22:00:07 +0100] information/cli: Loading configuration file(s).
[2026-03-05 22:00:07 +0100] information/ConfigItem: Committing config item(s).
[2026-03-05 22:00:07 +0100] information/ApiListener: My API identity: *********
[2026-03-05 22:00:07 +0100] critical/config: Error: Validation failed for object '*********!********!backup_downtime' of type 'ScheduledDowntime'; Attribute 'ranges': Invalid time range definition '$host.vars.backup_downtime$': Invalid timerange: $host.vars.backup_downtime$
Location: in [stage]/zones.d/master/scheduled_downtime_apply.conf: 16:5-18:5
[stage]/zones.d/master/scheduled_downtime_apply.conf(14):     fixed = true
[stage]/zones.d/master/scheduled_downtime_apply.conf(15):     assign where host.vars. backup_downtime
[stage]/zones.d/master/scheduled_downtime_apply.conf(16):     ranges = {
                                                              ^^^^^^^^^^
[stage]/zones.d/master/scheduled_downtime_apply.conf(17):         "monday" = "$host.vars.backup_downtime$"
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[stage]/zones.d/master/scheduled_downtime_apply.conf(18):     }
                                                          ^^^^^
[stage]/zones.d/master/scheduled_downtime_apply.conf(19): }
[stage]/zones.d/master/scheduled_downtime_apply.conf(20): 

thanks, the director provide many capabilities and automations but it weakened the power of DSL.

1 Like