-
Notifications
You must be signed in to change notification settings - Fork 579
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
Flapping tests and bugs #5720
Comments
Updating the flapping status with every check makes sense imo. It's not a big operation and makes an object not require 20 check results to compute accurate results. About Flapping Notifications: I could not find any issue with it. All notifications were sent when they ought to and were not send in Downtimes. Is it possible you ran into the bug caused by endianness? |
I'm thinking as a user here - if I explicitly disable flapping, I don't expect Icinga to calculate some flapping stats (which is kind of an overhead for each check result result). About flapping notifications - this seems to be a long running bug (not checking it at all), and we should fix it. I remember seeing that in a different issue, but flapping has explicitly enabled over there. Previously it was somehow hidden, since Try it yourself with a local random check in a frequent interval. Or you'll do a vagrant up inside the icinga2x-graylog box which runs into this bug. |
The overhead should be negligible and this circumvents problems with re-enabling flapping, otherwise we'd have to clear out flapping values and state changes when flapping is toggled. I don't receive any Flapping Notifications when flapping is disabled for a Host... Edit: I see now the ApiEvent is probably being triggered |
It also triggers DbEvents and flapping history. I guess I was looking at the wrong type in Icinga Web 2's history tab, sorry. |
The bug I'm seeing relates to #5086 where enable_flapping=true. In my case I do hit it without enabling flapping. I'll investigate further while waiting for the other patch :) |
results in this Icinga Web 2 history. This is not about notifications. It causes entries in the |
I think the problem is IsFlapping() which returns I cannot confirm it from the logs though (un-commented the debug line).
|
I do have the feeling that either
I cannot hit the second condition which would call OnNotifyFlapping() in |
Ok, I see it. This is unrelated from the flapping fixes, but something which sits in there long time. Icinga Web 2 determines FlappingStart with event_type=1000 and FlappingEnd with event_type=1001. dbevents.cpp populates that correctly.
Guess what Still, this doesn't explain why NotifyFlapping as event is triggered. |
OnFlappingChanged() is not called from within checkable-check.cpp.
instead, this is an event coming from the class variable registered in checkable.ti for Meaning to say, every time you call
Which makes me believe - if I do not have flapping detection enabled, those events must not be triggered, nor flapping calculation. |
You are currently looking at an old state. The fix was reset and will follow when I get around to doing the documentation. This branch is out of date. |
Note: I'm using git master without any fixes from yours to analyze the problem. I'll wait for your branch and PR then. I do have some slight log message patches in my stash. |
Thought about on my way home - the problem is the triggered signal OnFlappingChanged (and NotifyFlapping). This fits perfectly for ido updates, cluster events and api streams. It has two problems
My proposal - use a different signal for checkable, and let ido/cluster/apisubscribe to that, similar to all other signals we have. |
Review with @gunnarbeutner
TODOs:
|
All set. |
Anything left to do, or can we merge this? |
There's a note on the comment in the PR which is unclear. |
Discussed it offline, a misunderstanding with private/public. Everything's fine. |
Fix flapping calculation and events fixes #5720
Expected Behavior
No notifications are sent if flapping is disabled.
Current Behavior
enable_flapping is false, but Icinga 2 sends Flapping Stop notifications.
This diff does not take into account if flapping detection is enabled.
The origin of the changed behaviour is coming from
where Flapping is updated every time. This would allow the above code change to work, but also here GetEnableFlapping() is missing.
Both code parts should explicitly check for GetEnableFlapping().
Possible Solution
Disable flapping detection algorithm if explicitly disabled.
Furthermore, test if flapping start is properly sent. This doesn't look like this, I don't have any downtimes set.
Steps to Reproduce (for bugs)
random
as check command and low *_interval settingsContext
This floods anyone with notifications, especially to notice the web's history tab.
Your Environment
icinga2 --version
):icinga2 feature list
):The text was updated successfully, but these errors were encountered: