-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timeperiod broken - not allowed segment for the next day are added #9781
Comments
Hi @Al2Klimov, Feal free to ping me when i can help or something is unclear with my provided tests. Cheers |
That issue will also be logged in debug mode:
So why should The For my understanding it all points to an issue with that function: https://github.com/Icinga/icinga2/blob/master/lib/icinga/legacytimeperiod.cpp#L582 |
In short, you think that the segments are mis-generated even before any merge across time periods (#7855) happens? |
Yes, that is what my That is easy be viewable when you dump a simple TimePeriod without any cross merges via the API. |
Duplicate of #8741 |
I have this problem too. I can also verify the cases to reproduce from @cruelsmith . Are there any plans to fix this soon? |
Describe the bug
All date timeperiod formats except the (only) weekday lead to a not allowed segment for the following day.
That also apply for Across midnight and Across several days, weeks or months while the time calculation is always working as expected.
That is a major issue for the timeperiod feature and makes it completely useless in most cases.
⚠️ Depending of the use case of the timeperiod icinga2 instances will suffer with not executed checks and/or missing notifications when used in these object definitions.
Since the inital segmets translation is broken also the include / exclude of other timeperiods lead to unwanted results. But this just followup issue since the include / exclude timeperiod has segments in it which it should not have.
To Reproduce
💥 Calendar date range (2023-05-30 - 2023-05-31)
Config
API Object /v1/objects/timeperiod
💥 Calendar date (2023-05-31)
Config
API Object /v1/objects/timeperiod
💥 Specific month date (May 31th)
Config
API Object /v1/objects/timeperiod
💥 Generic month date (Day 1)
Config
API Object /v1/objects/timeperiod
💥 Offset weekday of specific month (last Wednesday in May)
Config
API Object /v1/objects/timeperiod
💥 Offset weekday (1th Thursday)
Config
API Object /v1/objects/timeperiod
✔️ Normal weekday (Tuesday)
Config
API Object /v1/objects/timeperiod
💥 Issue also stacks per date definition
Config
API Object /v1/objects/timeperiod
All tests has been done on the 2023-06-01 with CEST as timezone on OS layer.
The segments are using floats based unixtime stamps in the api representation. Use
date -d @1685660400
to convert it in something more understandable.Expected behavior
Only the defined time frame should be rendert as segment.
Your Environment
Include as many relevant details about the environment you experienced the problem in
icinga2 --version
):Oracle Linux Server 7.9
icinga2 feature list
):Additional context
This issue relates to the following issues that describes the same issue or a followup issue that root cause is the broken date to segment mapping.
followup #8741
duplicates #9388
relates to #7398
The text was updated successfully, but these errors were encountered: