I’m running into an issue with scheduled downtimes atm.
After configuring a scheduled downtime in /etc/icinga2/zones.d/master/downtimes.conf on the config master and reloading the icinga2 daemon I can see the downtime in the object list on both master nodes (icinga2 object list --type ScheduledDowntime --name mydowntime).
In Icinga Web 2 though I only see the scheduled downtime on objects where the check source is the config master. For all other objects the downtime does not show up even under Overview -> Downtimes.
I’m running two master nodes with separate IDO DBs locally on each node. enable_ha is set to false on both nodes in the ido-mysql.conf.
The scheduled downtime object looks like this:
I don’t quite understand this explanation. Do you have additional screenshots on the specific runtime Downtime objects being generated from the SD rules?
Sure, I’ve replaced some values with dummies. host01 and host02 are two hosts which each have the service service01 and this service has a ScheduledDowntime object mydowntime.
The resulting service host01!service01 has master01 (the config master) as the check source and host02!service01 has master02 as the check source.
In Icinga Web 2 I only see first type (in the Downtimes view and on the service objects), meaning a downtime on a service which has the config master node as the check source (host01!service01!mydowntime).
If the other master node is the check source, the downtime is not visible in Icinga Web 2 (host02!service01!mydowntime).
Last night the downtimes should have triggered for the first time but in the history I only see that they were triggered on the first type (where the config master is the check source), which could either mean I cannot see them because Icinga Web doesn’t know about their existence or that the Downtimes were not triggered at all. I’m still looking into that.
It won’t accept downtime/comment objects then, leaving them only active and visible on the secondary master. Try enabling this and re-checking the observed behaviour.
Oooh of course. I never made that connection. It’s working now.
So basically the ScheduledDowntime object definitions are synced to the secondary master on config reload but the secondary master enables them and needs to sync that back to the config master, right?
Close, but not exactly. The missing bit: A ScheduledDowntime object (static or via apply rule) creates a runtime Downtime object, the first from the matching ranges. This Downtime object is e.g. created by a SD on the secondary master being authoritative. The creation event triggers a runtime cluster sync, reaching the first master - this one says “no”, because of the global accept_config setting.
That being said, the configuration authority for ScheduledDowntimes is your config master. For runtime created (config) objects, each endpoint needs to accept configuration. Internally, Icinga treats Comments and Downtimes as config objects, for easier syncing and API access/filters.