Comments (6)
ref/IP/52794
from icinga2.
Actually a single recovery outside the notification time period is enough not to be notified. I tested the master branch with Icinga DB and no special load btw.
from icinga2.
If a recovery happens outside the notification time period, NotificationRecovery is added to Notification#suppressed_notifications
for FireSuppressedNotifications() to pick it up once inside time period again. But this function clears such bits unless Checkable#NotificationReasonApplies()
. One may think: checkable still OK = recovery still applies. But for NotificationRecovery NotificationReasonApplies() also compares the current state to Checkable#state_before_suppression
which is OK by default. In a nutshell:
- We're outside the notification time period
- A recovery happens
- NotificationRecovery is added to
Notification#suppressed_notifications
👍
- NotificationRecovery is added to
- FireSuppressedNotifications() runs (every 5s)
- Checks
Notification#suppressed_notifications
bits' validity- Consults
Checkable#NotificationReasonApplies()
for NotificationRecovery⚠️ Latter says: Yes, we're still OK, butCheckable#state_before_suppression
(completely unrelated here) is also OK (its default), so I think we just returned to our OK – so no, NotificationRecovery doesn't apply anymore
- NotificationRecovery is cleared from
Notification#suppressed_notifications
and lost 👎
- Consults
- Checks
- A recovery happens
As I consider Checkable#state_before_suppression
unrelated here, I felt free to comment out 39cee35 and it worked:
--- lib/icinga/checkable-notification.cpp
+++ lib/icinga/checkable-notification.cpp
@@ -271,7 +271,7 @@ bool Checkable::NotificationReasonApplies(NotificationType type)
case NotificationRecovery:
{
auto cr (GetLastCheckResult());
- return cr && IsStateOK(cr->GetState()) && cr->GetState() != GetStateBeforeSuppression();
+ return cr && IsStateOK(cr->GetState());// && cr->GetState() != GetStateBeforeSuppression();
}
case NotificationFlappingStart:
return IsFlapping();
@julianbrost Any opinion on this (as the commit author) before anyone codes anything?
from icinga2.
Have you checked whether the this test still passes with that change? I have the feeling that this might result in extra recovery notifications after downtimes when no problem notification was sent.
from icinga2.
That's just a PoC. My actual suggestion is not to consult GetStateBeforeSuppression() unconditionally in NotificationReasonApplies(), but only if GetSuppressedNotifications() contains NotificationRecovery or NotificationProblem. Because only then GetStateBeforeSuppression() matters IMAO:
icinga2/lib/icinga/checkable-check.cpp
Lines 512 to 521 in 9e31b8b
from icinga2.
Okay, now I think I got it. So Checkable::NotificationReasonApplies()
is used both when sending notification after the suppression reason is gone on the Checkable
level (when a downtime ends for example) and on the Notification
level (when a period
on a Notification
object enters for example) and it checks Checkable::GetStateBeforeSuppression()
in both cases even though it was only set to something useful in the first case.
My actual suggestion is not to consult GetStateBeforeSuppression() unconditionally in NotificationReasonApplies(), but only if GetSuppressedNotifications() contains NotificationRecovery or NotificationProblem. Because only then GetStateBeforeSuppression() matters IMAO:
So yes, this could work. Maybe moving the check of Checkable::GetStateBeforeSuppression()
out of Checkable::NotificationReasonApplies()
to where it's actually necessary (i.e. suppressed notifications on the Checkable
level) might be an option as well.
from icinga2.
Related Issues (20)
- [ITL] to extend the output of "icinga" check command
- API object deletion unreliable if HA zone is not connected
- Add an option for node setup to remove the default global zones
- CSR Auto sign in multi domain Setup failes with stacktrace HOT 3
- Icinga APİ execution command bug HOT 3
- IDO isn't updating host contacts if new contact is added to contact group
- Endpoints may miss events during initial config sync/replay logs
- Icinga2 Service fails when a service is created via the API for a host that doesn't exist HOT 5
- Icinga2 fails to build against LibreSSL 3.8.3 HOT 1
- Scheduled Downtime won't be changed/deleted after reload HOT 5
- [doc] Correcting a typo HOT 1
- Two separate CpuBoundWork semaphores – HTTP | JSONRPC
- Icinga Master Endpoint Loadbalancing Ignoring Database Connectivity Issues -> Icinga becomes unusable HOT 1
- gpg: no valid OpenPGP data found. HOT 5
- Extending check_disk with -n parameter in ITL template HOT 2
- ConfigPackageUtility misses atomic file operations and
- Script for telegram notification HOT 1
- [Documentation] Installation documentation for current/new versions of Amazon Linux
- Memory leak when trying to read objects from the api at /v1/objects
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from icinga2.