icinga2/lib/icinga
Julian Brost 7d0a43f926 Use Checkable::GetStateBeforeSuppression() only where relevant
This fixes an issue where recovery notifications get lost if they happen
outside of a notification time period.

Not all calls to `Checkable::NotificationReasonApplies()` need
`GetStateBeforeSuppression()` to be checked. In fact, for one caller,
`FireSuppressedNotifications()` in
`lib/notification/notificationcomponent.cpp`, the state before suppression may
not even be initialized properly, so that the default value of OK is used which
can lead to incorrect return values. Note the difference between suppressions
happening on the level of the `Checkable` object level and the `Notification`
object level. Only the first sets the state before suppression in the
`Checkable` object, but so far, also the latter used that value incorrectly.

This commit moves the check of `GetStateBeforeSuppression()` from
`Checkable::NotificationReasonApplies()` to the one place where it's actually
relevant: `Checkable::FireSuppressedNotifications()`. This made the existing
call to `NotificationReasonApplies()` unneccessary as it would always return
true: the `type` argument is computed based on the current check result, so
there's no need to check it against the current check result.
2024-10-11 13:21:10 +02:00
..
apiactions.cpp Introduce & use enum DowntimeRemovalReason 2024-05-23 09:34:15 +02:00
apiactions.hpp Refactor GetSingleObjectByNameUsingPermissions 2020-07-07 15:45:58 +02:00
apievents.cpp ApiEvents: Implement new API event streams response 2021-01-11 14:59:48 +01:00
apievents.hpp ApiEvents: Implement new API event streams response 2021-01-11 14:59:48 +01:00
checkable-check.cpp Checkable: Don't recalculate next_check while processing remotely genrated check 2024-08-16 16:15:56 +02:00
checkable-comment.cpp Checkable#RemoveAckComments(): add optional comment entry time filter 2023-03-03 15:48:11 +01:00
checkable-dependency.cpp Code style 2023-04-03 13:39:08 +02:00
checkable-downtime.cpp Remove unused Checkable#RemoveAllDowntimes() 2024-05-21 14:28:39 +02:00
checkable-event.cpp CONTEXT: use << everywhere to unify usages 2022-11-30 11:06:51 +01:00
checkable-flapping.cpp Flapping: Allow to ignore states in flapping calculation 2021-01-20 11:09:03 +01:00
checkable-notification.cpp Use Checkable::GetStateBeforeSuppression() only where relevant 2024-10-11 13:21:10 +02:00
checkable-script.cpp Fix file endings 2023-05-17 18:05:13 +02:00
checkable.cpp Use Timer::Create() instead of new Timer() 2023-04-04 10:35:20 +02:00
checkable.hpp Remove unused Checkable#RemoveAllDowntimes() 2024-05-21 14:28:39 +02:00
checkable.ti Checkable: improve state notifications after suppression ends 2022-03-03 14:25:23 +01:00
checkcommand.cpp Use ExecuteOverride to override the command 2020-07-31 17:28:33 +02:00
checkcommand.hpp Don't mark a method as virtual in a final class 2023-01-26 09:10:38 +01:00
checkcommand.ti Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
checkresult.cpp Initialize namespaces without using overrideFrozen 2023-01-19 09:53:36 +01:00
checkresult.hpp Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
checkresult.ti Make ProcessResult#ExitStatus and CheckResult#exit_status 64-bit ints 2024-04-23 17:45:31 +02:00
cib.cpp Simplify NamespaceValue class hierarchy to one struct without member functions 2023-01-19 17:55:11 +01:00
cib.hpp Use std::mutex, not boost::mutex 2021-02-03 09:54:57 +01:00
clusterevents-check.cpp Use Timer::Create() instead of new Timer() 2023-04-04 10:35:20 +02:00
clusterevents.cpp Notification#BeginExecuteNotification(): on recovery clear last_notified_state_per_user 2023-12-13 13:21:22 +01:00
clusterevents.hpp Notification#BeginExecuteNotification(): on recovery clear last_notified_state_per_user 2023-12-13 13:21:22 +01:00
CMakeLists.txt Introduce EnvResolver 2023-02-06 11:25:25 +01:00
command.cpp Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
command.hpp Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
command.ti Introduce Command#arguments[].sep 2022-05-11 17:50:12 +02:00
comment.cpp Use Timer::Create() instead of new Timer() 2023-04-04 10:35:20 +02:00
comment.hpp Introduce Comment#sticky 2022-03-24 16:42:18 +01:00
comment.ti Don't allow to change object parent,host/service_name at runtime 2022-09-09 18:26:28 +02:00
compatutility.cpp Remove CheckResultReader which has been deprecated for 5 major versions 2023-04-03 11:39:21 +02:00
compatutility.hpp Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
customvarobject.cpp Fix file endings 2023-05-17 18:05:13 +02:00
customvarobject.hpp Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
customvarobject.ti Icinga DB: Make sure object relationships are handled correctly 2021-11-12 13:34:57 +01:00
dependency-apply.cpp CONTEXT: use << everywhere to unify usages 2022-11-30 11:06:51 +01:00
dependency.cpp Forbid dependency cycles 2023-02-06 12:33:48 +01:00
dependency.hpp Forbid dependency cycles 2023-02-06 12:33:48 +01:00
dependency.ti Introduce redundancy groups for Dependency Objects 2023-02-21 16:23:36 +01:00
downtime.cpp Don't fail to remove obsolete downtimes 2024-05-23 10:09:41 +02:00
downtime.hpp Introduce & use enum DowntimeRemovalReason 2024-05-23 09:34:15 +02:00
downtime.ti Don't allow to change object parent,host/service_name at runtime 2022-09-09 18:26:28 +02:00
envresolver.cpp Introduce EnvResolver 2023-02-06 11:25:25 +01:00
envresolver.hpp Introduce EnvResolver 2023-02-06 11:25:25 +01:00
eventcommand.cpp Use ExecuteOverride to override the command 2020-07-31 17:28:33 +02:00
eventcommand.hpp Don't mark a method as virtual in a final class 2023-01-26 09:10:38 +01:00
eventcommand.ti Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
externalcommandprocessor.cpp Introduce & use enum DowntimeRemovalReason 2024-05-23 09:34:15 +02:00
externalcommandprocessor.hpp Use std::mutex, not boost::mutex 2021-02-03 09:54:57 +01:00
host.cpp Implement scheduling_source attribute (#6326) 2021-07-20 11:10:26 +02:00
host.hpp Checkable: Add test for state notifications after a suppression ends 2022-03-03 14:25:23 +01:00
host.ti Replace EventuallyAtomic with AtomicOrLocked which falls back to a mutex 2022-05-03 12:02:46 +02:00
hostgroup.cpp CONTEXT: use << everywhere to unify usages 2022-11-30 11:06:51 +01:00
hostgroup.hpp Use std::mutex, not boost::mutex 2021-02-03 09:54:57 +01:00
hostgroup.ti Replace EventuallyAtomic with AtomicOrLocked which falls back to a mutex 2022-05-03 12:02:46 +02:00
i2-icinga.hpp Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
icinga-itl.conf Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
icingaapplication.cpp MacroProcessor::ResolveMacro(): treat quasi-CV-object IcingaApplication as real CV-object 2023-05-31 16:35:09 +02:00
icingaapplication.hpp Fix that MaxConcurrentChecks constant is overridden from 'checker' feature 2019-04-16 15:04:57 +02:00
icingaapplication.ti Merge pull request #6970 from Icinga/bugfix/perfdata-gaps 2019-02-26 15:38:15 +01:00
legacytimeperiod.cpp Merge pull request #9983 from Icinga/broken-timeperiod 2024-08-20 10:05:59 +02:00
legacytimeperiod.hpp LegacyTimePeriod: Prevent modification of input parameters 2021-07-22 15:17:06 +02:00
macroprocessor.cpp MacroProcessor::ResolveMacro(): treat quasi-CV-object IcingaApplication as real CV-object 2023-05-31 16:35:09 +02:00
macroprocessor.hpp ResolverSpec: add option not to resolve "$name$" 2023-02-06 16:39:17 +01:00
macroresolver.hpp Refactor MacroResolver::OverrideMacros 2020-07-03 15:53:51 +02:00
notification-apply.cpp CONTEXT: use << everywhere to unify usages 2022-11-30 11:06:51 +01:00
notification.cpp Notification#BeginExecuteNotification(): on recovery clear last_notified_state_per_user 2023-12-13 13:21:22 +01:00
notification.hpp Notification#BeginExecuteNotification(): on recovery clear last_notified_state_per_user 2023-12-13 13:21:22 +01:00
notification.ti Notification#BeginExecuteNotification(): track state change notifications 2023-12-07 12:43:30 +01:00
notificationcommand.cpp Use ExecuteOverride to override the command 2020-07-31 17:28:33 +02:00
notificationcommand.hpp Use ExecuteOverride to override the command 2020-07-31 17:28:33 +02:00
notificationcommand.ti Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
objectutils.cpp Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
objectutils.hpp Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
pluginutility.cpp PluginUtility: Fix PerfData don't get parsed correctly 2023-04-05 15:37:54 +02:00
pluginutility.hpp PluginUtility::FormatPerfdata(): normalize UoMs if desired 2021-07-05 19:05:32 +02:00
scheduleddowntime-apply.cpp CONTEXT: use << everywhere to unify usages 2022-11-30 11:06:51 +01:00
scheduleddowntime.cpp Introduce & use enum DowntimeRemovalReason 2024-05-23 09:34:15 +02:00
scheduleddowntime.hpp Targeted apply rules: don't unnecessarily eval filter 2022-10-28 14:27:53 +02:00
scheduleddowntime.ti Don't allow to change object parent,host/service_name at runtime 2022-09-09 18:26:28 +02:00
service-apply.cpp CONTEXT: use << everywhere to unify usages 2022-11-30 11:06:51 +01:00
service.cpp Service#GetSeverity(): behave as the respective IDO query of Icinga Web 2022-01-27 12:21:06 +01:00
service.hpp Targeted apply rules: don't unnecessarily eval filter 2022-10-28 14:27:53 +02:00
service.ti Don't allow to change object parent,host/service_name at runtime 2022-09-09 18:26:28 +02:00
servicegroup.cpp CONTEXT: use << everywhere to unify usages 2022-11-30 11:06:51 +01:00
servicegroup.hpp Use std::mutex, not boost::mutex 2021-02-03 09:54:57 +01:00
servicegroup.ti Replace EventuallyAtomic with AtomicOrLocked which falls back to a mutex 2022-05-03 12:02:46 +02:00
timeperiod.cpp Check segemnt start date inclusively in TimePeriod::IsInside() 2024-08-01 16:16:48 +02:00
timeperiod.hpp Replace Copyright header with a short version, part I 2019-02-25 14:48:22 +01:00
timeperiod.ti Replace EventuallyAtomic with AtomicOrLocked which falls back to a mutex 2022-05-03 12:02:46 +02:00
user.cpp Use std::mutex, not boost::mutex 2021-02-03 09:54:57 +01:00
user.hpp Use std::mutex, not boost::mutex 2021-02-03 09:54:57 +01:00
user.ti Replace EventuallyAtomic with AtomicOrLocked which falls back to a mutex 2022-05-03 12:02:46 +02:00
usergroup.cpp Fix file endings 2023-05-17 18:05:13 +02:00
usergroup.hpp Icinga DB: Make sure object relationships are handled correctly 2021-11-12 13:34:57 +01:00
usergroup.ti Replace EventuallyAtomic with AtomicOrLocked which falls back to a mutex 2022-05-03 12:02:46 +02:00