-
Notifications
You must be signed in to change notification settings - Fork 572
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
Icinga Timeperiod exclusion exceeded to next day #8741
Comments
Hello, Notifications and timeperiods are working in general. Problem description: For example: And it seems not to depend on the duration of the exclude rule. I could also observe this behaviour for exclude rules which be set for 5 days. The day after gets always excluded as well. So basically: excludes = [ "feiertage-de-fix", "feiertage-de-dynamic" ] + 1 Before the exclude rule and after the exclude rule +1 it is running normally again. Here is our setting and config: rpm -qa |grep release rpm -qa |grep icinga rpm -qa |grep maria icinga2 feature list timeperiods.conf:
If you need more information, just let me know. Many thanks in advance! Best regards |
Hi, I have almost the exact same behavior except it is linked to I also think there are 2 problems here that might be linked in some way:
For some context, yesterday (May 13th) was a holiday in France and we always have someone on call outside of workhours. Today, I noticed that notifications are still sent though they should not be ! Below is the configuration snippet for relevant TimePeriods:
One of the notification objects is defined like this:
And the imported template:
From the API, I checked that the period for the created Notification is correct:
However, when checking TimePeriods with the API (today, May 14th), I noticed that Then, I also noticed that reloading icinga2 did affect the How to reproduceI tested it further and this behavior can be easily reproduced. Let's try to add a range inside Initial configuration + restart to have a clean config
{
"results": [
{
"attrs": {
"__name": "holidays",
"active": true,
"display_name": "holidays TimePeriod",
"excludes": [],
"ha_mode": 0.0,
"includes": [],
"is_inside": true,
"name": "holidays",
"original_attributes": null,
"package": "_etc",
"paused": false,
"prefer_includes": true,
"ranges": {
"2021-04-05": "00:00-24:00",
"2021-05-13": "00:00-24:00",
"2021-05-14": "00:00-24:00",
"2021-05-24": "00:00-24:00",
"august 15": "00:00-24:00",
"december 25": "00:00-24:00",
"january 1": "00:00-24:00",
"july 14": "00:00-24:00",
"may 1": "00:00-24:00",
"may 8": "00:00-24:00",
"november 1": "00:00-24:00",
"november 11": "00:00-24:00"
},
"segments": [
{
"begin": 1620943200.0,
"end": 1621029600.0
}
],
"source_location": {
"first_column": 1.0,
"first_line": 27.0,
"last_column": 28.0,
"last_line": 27.0,
"path": "/etc/icinga2/zones.d/master/timeperiods.conf"
},
"templates": [
"holidays",
"legacy-timeperiod"
],
"type": "TimePeriod",
"update": {
"arguments": [
"tp",
"begin",
"end"
],
"deprecated": false,
"name": "Internal#LegacyTimePeriod",
"side_effect_free": false,
"type": "Function"
},
"valid_begin": 1620943200.0,
"valid_end": 1621086153.809217,
"vars": null,
"version": 0.0,
"zone": "master"
},
"joins": {},
"meta": {},
"name": "holidays",
"type": "TimePeriod"
}
]
} {
"results": [
{
"attrs": {
"__name": "non-workhours",
"active": true,
"display_name": "Non-workhours TimePeriod",
"excludes": [],
"ha_mode": 0.0,
"includes": [
"weekends",
"holidays"
],
"is_inside": true,
"name": "non-workhours",
"original_attributes": null,
"package": "_etc",
"paused": false,
"prefer_includes": true,
"ranges": {
"friday": "00:00-09:00,18:00-24:00",
"monday": "00:00-09:00,18:00-24:00",
"thursday": "00:00-09:00,18:00-24:00",
"tuesday": "00:00-09:00,18:00-24:00",
"wednesday": "00:00-09:00,18:00-24:00"
},
"segments": [
{
"begin": 1620943200.0,
"end": 1621029600.0
},
{
"begin": 1621008000.0,
"end": 1621116000.0
}
],
"source_location": {
"first_column": 1.0,
"first_line": 56.0,
"last_column": 33.0,
"last_line": 56.0,
"path": "/etc/icinga2/zones.d/master/timeperiods.conf"
},
"templates": [
"non-workhours",
"legacy-timeperiod"
],
"type": "TimePeriod",
"update": {
"arguments": [
"tp",
"begin",
"end"
],
"deprecated": false,
"name": "Internal#LegacyTimePeriod",
"side_effect_free": false,
"type": "Function"
},
"valid_begin": 1620943200.0,
"valid_end": 1621116000.0,
"vars": null,
"version": 0.0,
"zone": "master"
},
"joins": {},
"meta": {},
"name": "non-workhours",
"type": "TimePeriod"
}
]
} We are inside both TimePeriods as expected. Remove a range in holidaysWe remove the following range entry:
{
"results": [
{
"attrs": {
"__name": "holidays",
"active": true,
"display_name": "holidays TimePeriod",
"excludes": [],
"ha_mode": 0.0,
"includes": [],
"is_inside": false,
"name": "holidays",
"original_attributes": null,
"package": "_etc",
"paused": false,
"prefer_includes": true,
"ranges": {
"2021-04-05": "00:00-24:00",
"2021-05-13": "00:00-24:00",
"2021-05-24": "00:00-24:00",
"august 15": "00:00-24:00",
"december 25": "00:00-24:00",
"january 1": "00:00-24:00",
"july 14": "00:00-24:00",
"may 1": "00:00-24:00",
"may 8": "00:00-24:00",
"november 1": "00:00-24:00",
"november 11": "00:00-24:00"
},
"segments": [],
"source_location": {
"first_column": 1.0,
"first_line": 27.0,
"last_column": 28.0,
"last_line": 27.0,
"path": "/etc/icinga2/zones.d/master/timeperiods.conf"
},
"templates": [
"holidays",
"legacy-timeperiod"
],
"type": "TimePeriod",
"update": {
"arguments": [
"tp",
"begin",
"end"
],
"deprecated": false,
"name": "Internal#LegacyTimePeriod",
"side_effect_free": false,
"type": "Function"
},
"valid_begin": 1620943200.0,
"valid_end": 1621086572.667013,
"vars": null,
"version": 0.0,
"zone": "master"
},
"joins": {},
"meta": {},
"name": "holidays",
"type": "TimePeriod"
}
]
} {
"results": [
{
"attrs": {
"__name": "non-workhours",
"active": true,
"display_name": "Non-workhours TimePeriod",
"excludes": [],
"ha_mode": 0.0,
"includes": [
"weekends",
"holidays"
],
"is_inside": true,
"name": "non-workhours",
"original_attributes": null,
"package": "_etc",
"paused": false,
"prefer_includes": true,
"ranges": {
"friday": "00:00-09:00,18:00-24:00",
"monday": "00:00-09:00,18:00-24:00",
"thursday": "00:00-09:00,18:00-24:00",
"tuesday": "00:00-09:00,18:00-24:00",
"wednesday": "00:00-09:00,18:00-24:00"
},
"segments": [
{
"begin": 1620943200.0,
"end": 1621029600.0
},
{
"begin": 1621008000.0,
"end": 1621116000.0
}
],
"source_location": {
"first_column": 1.0,
"first_line": 56.0,
"last_column": 33.0,
"last_line": 56.0,
"path": "/etc/icinga2/zones.d/master/timeperiods.conf"
},
"templates": [
"non-workhours",
"legacy-timeperiod"
],
"type": "TimePeriod",
"update": {
"arguments": [
"tp",
"begin",
"end"
],
"deprecated": false,
"name": "Internal#LegacyTimePeriod",
"side_effect_free": false,
"type": "Function"
},
"valid_begin": 1620943200.0,
"valid_end": 1621116000.0,
"vars": null,
"version": 0.0,
"zone": "master"
},
"joins": {},
"meta": {},
"name": "non-workhours",
"type": "TimePeriod"
}
]
} This time we are not inside After restarting icinga2I restart the service with {
"results": [
{
"attrs": {
"__name": "holidays",
"active": true,
"display_name": "holidays TimePeriod",
"excludes": [],
"ha_mode": 0.0,
"includes": [],
"is_inside": false,
"name": "holidays",
"original_attributes": null,
"package": "_etc",
"paused": false,
"prefer_includes": true,
"ranges": {
"2021-04-05": "00:00-24:00",
"2021-05-13": "00:00-24:00",
"2021-05-24": "00:00-24:00",
"august 15": "00:00-24:00",
"december 25": "00:00-24:00",
"january 1": "00:00-24:00",
"july 14": "00:00-24:00",
"may 1": "00:00-24:00",
"may 8": "00:00-24:00",
"november 1": "00:00-24:00",
"november 11": "00:00-24:00"
},
"segments": [],
"source_location": {
"first_column": 1.0,
"first_line": 27.0,
"last_column": 28.0,
"last_line": 27.0,
"path": "/etc/icinga2/zones.d/master/timeperiods.conf"
},
"templates": [
"holidays",
"legacy-timeperiod"
],
"type": "TimePeriod",
"update": {
"arguments": [
"tp",
"begin",
"end"
],
"deprecated": false,
"name": "Internal#LegacyTimePeriod",
"side_effect_free": false,
"type": "Function"
},
"valid_begin": 1620997472.664512,
"valid_end": 1621087617.413173,
"vars": null,
"version": 0.0,
"zone": "master"
},
"joins": {},
"meta": {},
"name": "holidays",
"type": "TimePeriod"
}
]
} {
"results": [
{
"attrs": {
"__name": "non-workhours",
"active": true,
"display_name": "Non-workhours TimePeriod",
"excludes": [],
"ha_mode": 0.0,
"includes": [
"weekends",
"holidays"
],
"is_inside": false,
"name": "non-workhours",
"original_attributes": null,
"package": "_etc",
"paused": false,
"prefer_includes": true,
"ranges": {
"friday": "00:00-09:00,18:00-24:00",
"monday": "00:00-09:00,18:00-24:00",
"thursday": "00:00-09:00,18:00-24:00",
"tuesday": "00:00-09:00,18:00-24:00",
"wednesday": "00:00-09:00,18:00-24:00"
},
"segments": [
{
"begin": 1620943200.0,
"end": 1620975600.0
},
{
"begin": 1621008000.0,
"end": 1621116000.0
}
],
"source_location": {
"first_column": 1.0,
"first_line": 56.0,
"last_column": 33.0,
"last_line": 56.0,
"path": "/etc/icinga2/zones.d/master/timeperiods.conf"
},
"templates": [
"non-workhours",
"legacy-timeperiod"
],
"type": "TimePeriod",
"update": {
"arguments": [
"tp",
"begin",
"end"
],
"deprecated": false,
"name": "Internal#LegacyTimePeriod",
"side_effect_free": false,
"type": "Function"
},
"valid_begin": 1620943200.0,
"valid_end": 1621116000.0,
"vars": null,
"version": 0.0,
"zone": "master"
},
"joins": {},
"meta": {},
"name": "non-workhours",
"type": "TimePeriod"
}
]
} Now, both are false as expected. NOTE: This can be reproduced when adding or removing ranges in an included TimePeriod. I did not test the excluded TPs but I expect to be the same behavior. ConclusionIssue 1 (tested): Adding or removing a range to an included or excluded TP does not affect the runtime Issue 2 (not tested): The effective duration for TPs are sometimes calculated incorrectly and can extend 24h after a range is expired. Let me know if a separate issue should be opened. Environment
|
Hi Guys, How is the status on the bug? |
Hey, just want to add, we had the same issue yesterday. Looking back to 6.6 and 1.5. I can see it happend too. Funny enough, it seems like a deployment with the director corrects the problem (I think its related to the agent reload on every machine.) and the check will be executed like allways. current version: r2.13.2-1
|
Any news on this ? This bug is still affecting the latest release r2.13.7-1. |
@Kaelnor Best regards |
That feature was introduced in 2.5.0 (2016 #2040) working and broke somewhere at 2.10.x (2019) ? At least when i see #7398 . Would be at least nice for any administrator that in the current online documentation a warning will be added that the include / exclude feature for timeperiod has issues and it should not be used in any production environment to avoid dropped notifications. 😒 People just looking for examples of inclusion / exclusion and get an example that have issues and lead to missing notifications: |
I can attest to that as I just had to flatten a time-period with includes & excludes before it worked for scheduling a service check. I just had to excuse a couple of false alarms before I gave up and stupidified the time-period. |
Will return every day of the year that are not holidays: * Added options to adjust the time of these days. * Added options to skip spefic week days. Replaced fixed half day for chrismas and new year with the option to add additional holidays that should be respected int he output. Needed since icinga2 has issues with excludes Icinga/icinga2#8741 (comment)
@slalomsk8er What version did you run that your stupidified timeperiod worked? Is ask because with |
@cruelsmith Version r2.13.7-1 works with the following config and I didn't get any false alarms on weekends like I did with includes and excludes.
|
@slalomsk8er Thank you. That proves my test |
We have also dealt with this issue in the course of 2.14, but have not achieved a satisfactory result in a reasonable time frame. Unfortunately, no minor bugfixes will help anymore, but the complete handling would have to be rewritten. Timeperiods for notifications will be reimplemented with Icinga Notifications and we have to ask ourselves how to proceed with timeperiods for checks. Since we are focusing on Icinga Notifications for now, honestly nothing will happen with this issue for the time being. |
ref/IP/53389 |
Describe the bug
We have an unexpected behavior with tiemperiods exclusion. When it comes to a day in the exclusion timeperiod, the exclusion effects also the next day
To Reproduce
This is ouer Icinga Holiday/exclusion timeperiod
this timeperiod are excluded in ouer work day timeperiod
if it comes to a day, in ouer exclusion timeperiod, for exemple the 25 april, the timeperiod 7to5 remains inactive, also for the 26 april the whole day. Except if I restart the Icinga service.
Here is the output of the timeperiods status, retrived with the Icinga REST API
https://localhost:5665/v1/objects/timeperiods
Here we can see, that for the timeperiod 7to5 is_inside": false"
After the restart of the Icinga service, the 7to5 returns to is_inside": true"
for completition, her is the content, of ouer timeperiods.conf file
Your Environment
icinga2 --version
): version: 2.12.3icinga2 feature list
): Enabled features: api checker ido-mysql mainlog notification perfdataicinga2 daemon -C
):zones.conf
file (oricinga2 object list --type Endpoint
andicinga2 object list --type Zone
) from all affected nodes.Icinga Master 1 (icingam01-p)
Icinga Master 2 (icingam02-p)
The text was updated successfully, but these errors were encountered: