Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
2.01k stars 577 forks source link

Multiple downtime definitions bring undesired effect #9595

Open danielmoser96 opened 1 year ago

danielmoser96 commented 1 year ago

Bug Description

When we use the definition of downtimes (via Icinga Director) we sometimes have the case that we need to specify multiple time windows. Like in the example below for Friday. However, only the downtime entered in the first place is activated. So currently a problem at 20:30 has led to an alarm.

apply ScheduledDowntime "Server_*" to Host {
    author = "Admin"
    comment = "Downtime Server"
    fixed = true
    assign where match("Server_*", host.name)
    ranges = {
        "friday" = "22:00-22:45,20:25-21:15"
        "monday" = "22:00-22:45"
        "saturday" = "22:00-22:45"
        "sunday" = "22:00-22:45"
        "thursday" = "22:00-22:45"
        "tuesday" = "22:00-22:45"
        "wednesday" = "22:00-22:45"
    }
}

Expected behavior

Multiple downtimes per day should be created.

Our Environment

efthymiosc commented 1 year ago

Not sure if it's the same issue, but also below does not have the desired effect. Only last schedule "downtime-tuesday" is applied, not both.

apply ScheduledDowntime "service-downtime" to Service { import "downtime-monday" import "downtime-tuesday"

assign where ... }

Version used (icinga2 --version): icinga2 - The Icinga 2 network monitoring daemon (version: r2.13.6-1)

Al2Klimov commented 1 year ago

Hello Daniel!

Do you consider ordering them ascending a reasonable workaround (and a readability improvement)?