Closed NRGYDrink closed 5 years ago
I am not able to reproduce this issue, testing without IDO but the same host.vars style configuration. Also not using a wrap-around midnight timeframe (see below).
The downtimes for each perspective window are indeed created, although it could be in an unanticipated manner.
I ran icinga2 daemon -C
before running icinga2 object list --type downtime
.
vars.wiederkehrende_downtime = "13:40-13:45,13:45-13:50"
Sat Jun 24 13:38:37 EDT 2017
Object 'testhost-timeperiod-5261!testmaster-1498325916-0' of type 'Downtime': * start_time = 1498326000 # Saturday, June 24, 2017 1:40:00 PM * end_time = 1498326300 # Saturday, June 24, 2017 1:45:00 PM
Sat Jun 24 13:40:38 EDT 2017
Object 'testhost-timeperiod-5261!testmaster-1498325916-0' of type 'Downtime': * start_time = 1498326000 # Saturday, June 24, 2017 1:40:00 PM * end_time = 1498326300 # Saturday, June 24, 2017 1:45:00 PM Object 'testhost-timeperiod-5261!testmaster-1498326036-3' of type 'Downtime': * start_time = 1498326300 # Saturday, June 24, 2017 1:45:00 PM * end_time = 1498326600 # Saturday, June 24, 2017 1:50:00 PM
Sat Jun 24 13:45:39 EDT 2017
Object 'testhost-timeperiod-5261!testmaster-1498326036-3' of type 'Downtime': * start_time = 1498326300 # Saturday, June 24, 2017 1:45:00 PM * end_time = 1498326600 # Saturday, June 24, 2017 1:50:00 PM Object 'testhost-timeperiod-5261!testmaster-1498326336-4' of type 'Downtime': * start_time = 1498412400 # Sunday, June 25, 2017 1:40:00 PM * end_time = 1498412700 # Sunday, June 25, 2017 1:45:00 PM
Sat Jun 24 13:50:41 EDT 2017
Object 'testhost-timeperiod-5261!testmaster-1498326336-4' of type 'Downtime': * start_time = 1498412400 # Sunday, June 25, 2017 1:40:00 PM * end_time = 1498412700 # Sunday, June 25, 2017 1:45:00 PM
Test system:
CentOS Linux release 7.3.1611
commit 0e423df4a0e366680dd322af6ec3968f5e8790ab
Merge: 04757d1 c8b4fee
Author: Michael Friedrich <michael.friedrich@icinga.com>
Date: Fri Jun 23 12:56:05 2017 +0200
I will set up a script to run overnight to test the edge-case specific to midnight, but wanted to provide these observations here.
While I can see how it can be observed as a bug (specifically the first iteration) and due to the caching of object list
, there doesn't seem to be a functional issue here (unless running daemon -C
circumvented an issue, but I haven't seen the issue in practice).
The test overnight seems to have produced similar results, the second downtime is created but not until the first time window is entered.
vars.wiederkehrende_downtime = "20:00-24:00,00:00-04:00"
Sat Jun 24 19:59:01 EDT 2017
Object 'testhost-timeperiod-5261!icingadev.thebes.owl-1498344314-0' of type 'Downtime': * start_time = 1498348800 # Saturday, June 24, 2017 8:00:00 PM * end_time = 1498363200 # Sunday, June 25, 2017 12:00:00 AM
Sat Jun 24 20:01:01 EDT 2017
Object 'testhost-timeperiod-5261!icingadev.thebes.owl-1498344314-0' of type 'Downtime': * start_time = 1498348800 # Saturday, June 24, 2017 8:00:00 PM * end_time = 1498363200 # Sunday, June 25, 2017 12:00:00 AM Object 'testhost-timeperiod-5261!icingadev.thebes.owl-1498348814-2' of type 'Downtime': * start_time = 1498363200 # Sunday, June 25, 2017 12:00:00 AM * end_time = 1498377600 # Sunday, June 25, 2017 4:00:00 AM
Sun Jun 25 00:01:01 EDT 2017
Object 'testhost-timeperiod-5261!icingadev.thebes.owl-1498348814-2' of type 'Downtime': * start_time = 1498363200 # Sunday, June 25, 2017 12:00:00 AM * end_time = 1498377600 # Sunday, June 25, 2017 4:00:00 AM Object 'testhost-timeperiod-5261!icingadev.thebes.owl-1498363213-3' of type 'Downtime': * start_time = 1498435200 # Sunday, June 25, 2017 8:00:00 PM * end_time = 1498449600 # Monday, June 26, 2017 12:00:00 AM
Sun Jun 25 04:01:01 EDT 2017
Object 'testhost-timeperiod-5261!icingadev.thebes.owl-1498363213-3' of type 'Downtime': * start_time = 1498435200 # Sunday, June 25, 2017 8:00:00 PM * end_time = 1498449600 # Monday, June 26, 2017 12:00:00 AM
This is still an issue, and it is very annoying that I cannot schedule a period across midnight. monday = "00:00-1:00,21:30-24:00" The above does not work. To fix i had to create two separate ScheduledDowntime
My solution over midnight is like this
ranges = {
"monday" = "20:00-26:00"
}
in my scheduledDowntimes objects.
If this workaround works reliably we should document it at least as this question comes up a lot. I did not know about this.
I found it once in an issue, but dont ask me which one :)
If the "clock overflow" @Mikesch-mp shown works... I exactly know how to fix this one...
Hello guys!
Please could you test the linked PR?
Best, AK
Just had the pleasure to encounter this bug as well. The clock overflow workaround works perfectly.
apply ScheduledDowntime "test-downtime" to Host {
author = "icingaadmin"
comment = "Scheduled downtime for test"
ranges = {
monday = "17:00-19:00,22:00-30:00"
tuesday = "17:00-19:00,22:00-30:00"
wednesday = "17:00-19:00,22:00-30:00"
thursday = "17:00-19:00,22:00-30:00"
friday = "17:00-19:00,22:00-30:00"
}
assign where host.name == "localhost"
}
What I noticed as well, is that what @leeclemens mentioned about subsequent time windows. The second time window above (22:00-30:00) is not planned by Icinga (not visible in Icinga Web 2) until the first is active. Kind of irritating, but it works.
The unit tests are a bit sparse for the timeperiod class, I'll enhance them in order to test the PR.
Unfortunately the PR doesn't work, see my comments there.
Behavior
I have set a scheduled downtime before and after midnight but only the time before 00:00 will be scheduled.
vars.wiederkehrende_downtime= "20:00-24:00,00:00-04:00"
There should be a downtime for 20:00-24:00 and 00:00-04:00 but only the downtime for 20:00-24:00 appears. Switching the times ("00:00-04:00,20:00-24:00") will still only accept the 20:00-24:00 downtime.
More info: https://monitoring-portal.org/index.php?thread/40408-scheduled-downtime-%C3%BCber-mitternacht-wird-nicht-eingerichtet/
Steps to Reproduce (for bugs)
vars.wiederkehrende_downtime= "20:00-24:00,00:00-04:00"
Context
How has this issue affected me? I cant set scheduled downtimes for daily/weekly backups so everytime the backup is running, icinga2 might not be able to check the host/service so it will send out alerts (sms)
My Environment
icinga2 --version
icinga2 feature list
icinga2 daemon -C
icinga2 object list --type Endpoint
icinga2 object list --type Zone