202 Commits

Author SHA1 Message Date
Alexander Aleksandrovič Klimov
ec2080dcc1
Merge pull request #9731 from Icinga/fix-compiler-warnings-by-copy-constructing-loop-variables-explicitly
Fix compiler warnings by (copy-)constructing loop variables explicitly or not at all
2025-05-21 14:26:47 +02:00
Alexander A. Klimov
22e75f08fa Fix compiler warnings by not unnecessarily (copy-)constructing loop variables 2025-05-21 11:36:32 +02:00
Johannes Schmidt
f8d3bacc29 Fix warnings related to enum integer conversion 2025-05-19 12:31:22 +02:00
Yonas Habteab
83a0f9d217
Merge pull request #10361 from Icinga/reset-no-more-notifications-only-on-recovery
Notification: Reset internal states on (missed)recovery
2025-05-16 09:53:10 +02:00
Yonas Habteab
d750bff193 Notification: Fix incorrectly dropped recovery & ACK notifications
Previously, recovery and ACK notifications were not delivered to users
who weren't notified about the problem state while having a configured
`Problem` type filter. However, since the type filter can also be
configured on the `Notification` object level, this resulted to an
incorrect behaviour. This PR changes the existing logic so that the
recovery and ACK notifications gets dropped only if the `Problem` filter
is configured on both the `User` and `Notification` object levels.
2025-05-13 09:46:35 +02:00
Yonas Habteab
4596b44171 Reset no_more_notifications on filter mismatch correctly
Previously, if you enable flapping for a Checkable but the corresponding
`Notification` object does not have `FlappingStart` or `FlappingEnd`
types set, the `no_more_notifications` flag wasn't reset to false again.
This commit ensures that this flag is always reset on `Recovery` even
the type filter does not match including when we miss the `Recovery` due
to Flapping state.
2025-05-12 12:03:13 +02:00
Yonas Habteab
9166326876 Notification: Reset notified problem users on flapping end as well 2025-05-12 12:03:13 +02:00
Yonas Habteab
86365a4e2b Notification: Clear last notified state per user on flapping end as well 2025-05-12 12:03:13 +02:00
Yonas Habteab
89f12c2323 Notification: Reset no_more_notifications only on recovery 2025-05-12 12:03:13 +02:00
Alexander A. Klimov
c2ddd20ef3 Fix compiler warnings by (copy-)constructing loop variables explicitly
for (const T& needle : haystack) creates the illusion that haystack is a
container of T and we're just borrowing needle. In these cases that's not true.
2025-04-22 13:55:49 +02:00
Alexander A. Klimov
35a705752f Don't set Notification#no_more_notifications on custom notifications 2024-11-15 13:03:22 +01:00
Alexander A. Klimov
7a4ba59961 Remove redundant "Validation failed" prefix from ValidationError exceptions
ValidationError#ValidationError() already prefixes #m_What,
which #what() returns, with "Validation failed for object".
2024-10-23 13:06:12 +02:00
Alexander A. Klimov
97cd05db7a Notification#BeginExecuteNotification(): on recovery clear last_notified_state_per_user 2023-12-13 13:21:22 +01:00
Alexander A. Klimov
44e9c6f40d Notification#BeginExecuteNotification(): discard likely duplicate problem notifications 2023-12-13 13:21:19 +01:00
Alexander A. Klimov
2cff763295 Cluster-sync Notification#last_notified_state_per_user 2023-12-12 15:29:50 +01:00
Alexander A. Klimov
b25ba7a316 Notification#BeginExecuteNotification(): track state change notifications 2023-12-07 12:43:30 +01:00
Julian Brost
0503ca1379 Initialize namespaces without using overrideFrozen
This commit adds a new initialization priority `FreezeNamespaces` that is run
last and moves all calls to `Namespace::Freeze()` there. This allows all other
initialization functions to still update namespaces without the use of the
`overrideFrozen` flag.

It also moves the initialization of `System.Platform*` and `System.Build*` to
an initialize function so that these can also be set without setting
`overrideFrozen`.

This is preparation for a following commit that will make the frozen flag in
namespaces finial, no longer allowing it to be overriden (freezing the
namespace will disable locking, so performing further updates would be unsafe).
2023-01-19 09:53:36 +01:00
Noah Hilverling
73e0d6e61b Icinga DB: Make sure object relationships are handled correctly 2021-11-12 13:34:57 +01:00
Alexander Aleksandrovič Klimov
c549a6657e
Merge pull request #8562 from Icinga/bugfix/fix-no-renotification-for-non-ok-state-changes-8545
Fix no re-notification for non OK state changes with time delay
2021-01-14 17:49:29 +01:00
Yonas Habteab
997ad86225 Fix no re-notification for non OK state changes with time delay 2021-01-14 11:54:25 +01:00
Julian Brost
aea06a27dc Use reference-counted pointer in notification callback
`this` could be deleted after `Notification::BeginExecuteNotification`
exited and before `Notification::ExecuteNotificationHelper` finished.
This is fixed by constructing a `Notification::Ptr` and operate on that
one as it is properly reference-counted.
2021-01-12 17:19:29 +01:00
Alexander A. Klimov
c515822649 Re-send notifications previously suppressed by their time periods
refs #6167
2020-07-29 17:13:41 +02:00
Michael Friedrich
3605076f8b Revert "Add OnNewNotificationResult signal and ProcessNotificationResult handler"
This reverts commit ac483f2a8a07e4962068408d18b10a17204b6454.
2020-01-07 14:26:07 +01:00
Michael Friedrich
152709071d Revert "Implement last_notification_result handling for Notification objects"
This reverts commit 1706b297a50aceafdbbfe8ed8d46c8d01c114464.
2020-01-07 14:21:06 +01:00
Michael Friedrich
d242b41704 Revert "Make NotificationResult available for events: Cluster and Features"
This reverts commit 566e59bbfa385ec1a023c32a1feb895791950032.
2020-01-07 14:20:59 +01:00
Michael Friedrich
8098f4d54d Improve type logging for notifications 2019-07-16 13:46:16 +02:00
Alexander Stoll
471dbc79a3 Remove double whitespaces for notifications log message
Add space to checkable debug message to unify timestamp format
2019-05-22 14:13:14 +02:00
Michael Friedrich
8ae206cd5d Improve validation for times.{begin,end} in notification objects
fixes #6939
2019-05-07 15:20:06 +02:00
Michael Friedrich
566e59bbfa Make NotificationResult available for events: Cluster and Features 2019-03-28 11:42:28 +01:00
Michael Friedrich
1706b297a5 Implement last_notification_result handling for Notification objects 2019-03-28 10:43:35 +01:00
Michael Friedrich
ac483f2a8a Add OnNewNotificationResult signal and ProcessNotificationResult handler 2019-03-28 10:42:04 +01:00
Michael Friedrich
d14a88235d Replace Copyright header with a short version, part I
CLion -> replace in path
2019-02-25 14:48:22 +01:00
Michael Friedrich
30d98b49eb
Merge pull request #6896 from Icinga/bugfix/notification-delay-5561
Notification#BeginExecuteNotification(): SetNextNotification() correctly
2019-02-22 09:27:59 +01:00
Michael Friedrich
7ce30a86b8 Enhance notification logging
- More details from the local context (notification, user, checkable, command names)
- Notice logs for when this notification object is paused in HA enabled zones
- Notice logs for interval=0 reminder notifications
- Object name for skipping recovery notifications when problem hasn't been notified before
2019-02-07 15:42:09 +01:00
Alexander A. Klimov
3b2054761a Notification#BeginExecuteNotification(): SetNextNotification() correctly
refs #5561
2019-01-11 18:25:12 +01:00
Michael Friedrich
d082e8c1b1 Fix that no_more_notifications gets reset when Recovery notifications are filtered away
Hello from the OSMC hackathon :)
2018-11-08 12:13:32 +01:00
Michael Friedrich
dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich
af1f2e0c55 Only check for Problem types in user filers for Recovery/Acknowledgement notifications
refs #6047
2018-09-12 17:09:15 +02:00
Noah Hilverling
834e37d3e2 Still notify on acknowledgement and recovery if user does not get problem notifications at all
refs #6047
2018-09-12 14:54:45 +02:00
Noah Hilverling
bfe7d46a68 Only send acknowledgement notification if user received a problem notification
refs #6047
2018-09-12 14:54:45 +02:00
Gunnar Beutner
10d6f70a85 Move constants and functions into different namespaces 2018-08-13 13:44:31 +02:00
Bas Couwenberg
0891380789 Fix spelling errors.
* occured -> occurred
 * dosen't -> doesn't
2018-07-21 10:38:09 +02:00
Michael Friedrich
313b2a759e
Merge pull request #6016 from Icinga/fix/state-filters-for-custom-notifications
Check notification state filters for problems only, not for Custom, etc.
2018-03-19 15:52:37 +01:00
Gunnar Beutner
94e6be1a65 Remove unused includes 2018-01-22 09:52:29 +01:00
Michael Friedrich
cc3651ed56 Check notification state filters for problems only, not for Custom, etc.
refs #5952
2018-01-19 12:35:07 +01:00
Gunnar Beutner
9d436605f0 Fix compatibility with CMake < 3.1 2018-01-18 15:12:46 +01:00
Gunnar Beutner
21254fb610 Avoid accessing attributes for validators where not necessary 2018-01-11 08:20:16 +01:00
Gunnar Beutner
ac155d1dda Apply clang-tidy fix 'modernize-redundant-void-arg' 2018-01-04 12:24:57 +01:00
Michael Insel
158ae2188e Change copyright header for 2018 2018-01-02 12:08:55 +01:00
Jean Flach
2636e6a77a Whitespace fix
What does this change?
* Remove use of spaces for formatting
These could be found by using `grep -r -l -P '^\t+ +[^*]'
* Removal of training whitespaces
* A few lines longer than 120 chars
2017-12-20 14:53:52 +01:00