File tree 1 file changed +5
-6
lines changed 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -440,12 +440,7 @@ func (client *Client) listenEventStream() error {
440
440
case * StateChange :
441
441
// Ignore any state changes while in downtime
442
442
if respT .DowntimeDepth > 0 {
443
- stateType := "HARD"
444
- if respT .StateType == StateTypeSoft {
445
- stateType = "SOFT"
446
- }
447
-
448
- client .Logger .Debugf ("Skipping %q state change while in downtime, %#v" , stateType , respT )
443
+ client .Logger .Debugf ("Skipping state change, checkable is in downtime, %#v" , respT )
449
444
continue
450
445
}
451
446
@@ -473,13 +468,17 @@ func (client *Client) listenEventStream() error {
473
468
evTime = respT .Timestamp .Time ()
474
469
case * DowntimeStarted :
475
470
if ! respT .Downtime .IsFixed {
471
+ // This may never happen, but Icinga 2 does the same thing, and we need to ignore the start
472
+ // event for flexible downtime, as there will definitely be a triggered event for it.
476
473
continue
477
474
}
478
475
479
476
ev , err = client .buildDowntimeEvent (client .Ctx , respT .Downtime , true )
480
477
evTime = respT .Timestamp .Time ()
481
478
case * DowntimeTriggered :
482
479
if respT .Downtime .IsFixed {
480
+ // Fixed downtimes generate two events (start, triggered), the latter applies here and must
481
+ // be ignored, since we're going to process its start event to avoid duplicated notifications.
483
482
continue
484
483
}
485
484
You can’t perform that action at this time.
0 commit comments