425 Commits

Author SHA1 Message Date
Julian Brost
69f181f98e IDO: use per-instance notification_id in history
When there are multiple active IDO instances on the same node, before this
commit, all of them would share a single DbValue object for the notification_id
column of the icinga_contactnotifications table. This resulted in the issue
that one database references the notification_id in another database.

This commit fixes this by using a separate DbValue value for each IDO instance.
This needs a new signal as the existing OnQuery and OnMultipleQueries signals
perform the same queries on all IDO instances, but different queries are needed
here per instance (they only differ in the referenced DbValue). Therefore, a
new signal OnMakeQueries is added that takes a std::function which is called
once per IDO instance and can access callbacks to perform one or multiple
queries only on this specific IDO instance.
2022-02-21 16:03:14 +01:00
Noah Hilverling
7d8be5ee69 IDO: Use own transaction for programstatus 2021-05-25 17:13:21 +02:00
Noah Hilverling
ceb00ba8c3 IDO: Do not log stats, if paused 2020-10-15 10:39:21 +02:00
Alexander Aleksandrovič Klimov
3e9a177c34
Merge pull request #8320 from Icinga/bugfix/ido-hash-groups
*DbObject#CalculateConfigHash(): sort groups to be hashed
2020-10-14 09:09:18 +02:00
Alexander Aleksandrovič Klimov
b3c5d26310
Merge pull request #8330 from Icinga/bugfix/program-status-not-inserted-2.12
IDO: Make sure to insert program status
2020-10-13 18:13:50 +02:00
Alexander Aleksandrovič Klimov
f27436e8a7
Merge pull request #8328 from Icinga/feature/improve-ido-logging-2.12.0
Improve new IDO logging
2020-10-13 18:13:36 +02:00
Alexander Aleksandrovič Klimov
81393bdda3
Merge pull request #8327 from Icinga/bugfix/do-not-update-customvar-status-on-heavy-config-update
Do not upsert customvar status on heavy config update
2020-10-13 18:13:17 +02:00
Alexander A. Klimov
cb00a7fd6a *DbObject#CalculateConfigHash(): sort groups to be hashed
... to ensure consistent hashes across config reloads.

This will likely cause a heavy update once for all objects in >1 group,
but it will ensure that this happens the last time.
2020-10-13 13:47:49 +02:00
Noah Hilverling
59d066ec2a IDO: Make sure to insert program status during reconnect() 2020-10-13 10:42:44 +02:00
Noah Hilverling
3404dd3ee7 IDO-Logging: Increase logging threshold for nearly empty queue 2020-10-13 09:16:36 +02:00
Noah Hilverling
89fcd41e08 IDO-Logging: Don't log when not connected 2020-10-13 09:16:31 +02:00
Noah Hilverling
5592d9eaf1 IDO-Logging: Remove useless ETA 2020-10-13 09:16:26 +02:00
Noah Hilverling
777c48e549 IDO-Logging: Add log timeout to log every 5 minutes 2020-10-13 09:16:20 +02:00
Noah Hilverling
22c14fd964 IDO: Always insert customvar status on heavy config update 2020-10-13 08:54:58 +02:00
Henrik Triem
329192975e IDO: Implement more accurate logging for query stats 2020-09-22 14:41:11 +02: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
Alexander A. Klimov
829d07aefe Introduce Checkable#acknowledgement_last_change
refs #7689
2019-12-10 10:44:23 +01:00
Michael Friedrich
8098f4d54d Improve type logging for notifications 2019-07-16 13:46:16 +02:00
Michael Friedrich
e659f8d2e1 DB IDO: Fix possible crash with program status updates before IcingaApplication is loaded 2019-07-11 16:06:27 +02:00
Michael Friedrich
5553438249 DB IDO: Use cached reachable state
fixes #6844
2019-05-07 13:47:09 +02:00
Michael Friedrich
78e24c53f1 DB IDO: Do not deactivate objects during application reload/restart
This follows the same principle as with the shutdown handler,
and was introduced with the changed reload handling with 2.9.
Previously IsShuttingDown() was sufficient which got set at one
location.

SigUsr2 as handler introduced a new location where m_ShuttingDown
is not necessarily set yet. Since this handler gets called when
l_Restarting is enabled, we'll use this flag to avoid config update
events resulting in object deactivation (object->IsActive() always
returns false).

refs #5996
refs #6691
refs #6970

fixes #7125
2019-05-03 15:40:48 +02:00
Michael Friedrich
a630d0185f
Merge pull request #6722 from Icinga/feature/notification-result
Add notification result store/sync
2019-04-25 15:56:14 +02:00
Michael Friedrich
2913291a17 ido Check: Add last failover timestamp to output when HA enabled IDO is running 2019-04-01 09:31:03 +02:00
Michael Friedrich
149f640fd8 Improve DB IDO HA failover behaviour
- Decrease Object Authority updates to 10s (was 30s)
- Decrease failover timeout to 30s (was 60s)
- Decrease cold startup (after (re)start) with no OA updates to 30s (was 60s)
- Immediately connect on Resume()
- Fix query priority which got broken with #6970
- Add more logging when a failover is in progress

```
[2019-03-29 16:13:53 +0100] information/IdoMysqlConnection: Last update by endpoint 'master1' was 8.33246s ago (< failover timeout of 30s). Retrying.

[2019-03-29 16:14:23 +0100] information/IdoMysqlConnection: Last update by endpoint 'master1' was 38.3288s ago. Taking over 'ido-mysql' in HA zone 'master'.
```

- Add more logging for reconnect and disconnect handling
- Add 'last_failover' attribute to IDO*Connection objects

refs #6970
2019-04-01 08:50:00 +02:00
Michael Friedrich
566e59bbfa Make NotificationResult available for events: Cluster and Features 2019-03-28 11:42:28 +01:00
Michael Friedrich
e2df11520e
Merge pull request #6970 from Icinga/bugfix/perfdata-gaps
Improve reload handling for features (metric & queue flush, activation priority)
2019-02-26 15:38:15 +01:00
Michael Friedrich
458f997a18 Replace Copyright header with a short version, part II 2019-02-25 15:09:36 +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
1bfe756cb1 DB IDO: Improve queue handling on Pause/Shutdown/Reload 2019-02-20 17:10:46 +01:00
Michael Friedrich
108b85427c Silence the debug log a bit for IDO events
They're actually not processed when the feature is paused,
and I have already seen them in user's logs when analysing why
objects are not updated or notifications sent. 'DbEvents' isn't
related to rather 'DB IDO' and is confusing.
2018-10-24 16:01:57 +02:00
Michael Friedrich
eabea68c56 icinga.com: Update config files (ITL, etc.) 2018-10-18 09:37:59 +02:00
Michael Friedrich
dea5ec614e icinga.com: Update CMakeLists.txt 2018-10-18 09:35:18 +02:00
Michael Friedrich
44c3b83769 icinga.com: Update '*.ti' 2018-10-18 09:30:00 +02:00
Michael Friedrich
dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich
c0c17fc340 Remove unused timestamp function in DB IDO
refs #6584
2018-09-17 10:06:30 +02:00
Gunnar Beutner
10d6f70a85 Move constants and functions into different namespaces 2018-08-13 13:44:31 +02:00
Gunnar Beutner
1a8692d972 Implement support for namespaces 2018-08-13 13:44:31 +02:00
Gunnar Beutner
d9c0b6f806 Refactor REGISTER_SCRIPTFUNCTION_* macros 2018-08-13 13:44:31 +02:00
Jean Flach
1da6b2c883 Fix whitespaces in CMakeLists files
Uses 2 space indentation as standard
2018-01-19 09:19:40 +01:00
Gunnar Beutner
9d436605f0 Fix compatibility with CMake < 3.1 2018-01-18 15:12:46 +01:00
Michael Friedrich
a83ad4b7f2 Explicitly pass 1 or 0 for notification filters in DB IDO 2018-01-17 13:38:48 +01:00
Gunnar Beutner
2a9dceb367 Use CMake object libraries for our libs 2018-01-17 04:28:21 +01:00
Gunnar Beutner
c2fb9fe226 Use initializer lists for arrays and dictionaries 2018-01-16 12:27:44 +01:00
Michael Friedrich
0201f8ff64 Add query thresholds for the 'ido' check: Rate and pending queries
fixes #3924
2018-01-15 16:38:15 +01:00
Michael Friedrich
50106057bf Remove obsolete locks in Livestatus; apply style guide to DB IDO 2018-01-15 13:39:34 +01:00
Michael Friedrich
ef7c80959d More cleanup for compat filters in DB IDO 2018-01-15 13:39:34 +01:00
Michael Friedrich
4da3a50711 Clean up DB IDO events code 2018-01-15 13:39:34 +01:00
Michael Friedrich
636cf62d3a DB IDO: Clean up code and group CompatUtility calls 2018-01-15 13:39:34 +01:00
Michael Friedrich
d672df3f2c DB IDO: Don't send empty columns in queries 2018-01-15 13:39:34 +01:00
Michael Friedrich
e5462ea3d1 DB IDO: Remove check_command_args column
The populated value is not entirely correct, and pulls in lots
of compat code.
2018-01-15 13:39:34 +01:00