12996 Commits

Author SHA1 Message Date
Julian Brost
df1073b15c Icinga DB Check: report history and runtime update backlog separately
Probably makes little difference for an end-user, but for support and
development it's great to know which of the two is causing problems.
2022-06-28 15:35:34 +02:00
Julian Brost
ba67c102f3 Icinga DB Check: clearly state Icinga 2 Redis backlog
Should make it easier to understand that this refers to Redis queries issued by
Icinga 2.
2022-06-28 15:35:34 +02:00
Julian Brost
81feecf298 Icinga DB Check: replace nested calls to fmax() with std::max()
Improves readability, even more so after splitting it into separate lines.
2022-06-28 15:35:34 +02:00
Julian Brost
bb3ad133d0 Icinga DB Check: spell out "error" in perfdata 2022-06-28 15:35:34 +02:00
Julian Brost
3391a234b3 Icinga DB Check: fix error message on Redis query error
Not only XREAD queries are performed, so the previous error message was incorrect.
2022-06-28 15:35:34 +02:00
Julian Brost
153d5bae00 Icinga DB Check: remove unused includes 2022-06-28 15:35:34 +02:00
Julian Brost
2810350bc0 Icinga DB Check: rename keys in heartbeat stream
In both C++ and Go, the keys are only used as constant strings, so namespacing
them just adds clutter for the `general:*` keys, therefore remove it.
2022-06-28 15:35:34 +02:00
Julian Brost
dbc8995fc3 Icinga DB Check: remove *_1sec metrics
They add no additional information compared to the *_1min values as it's always
the same value divided by 60 anyways. Adding the actual value from the last
second makes little sense for realistic values of check_interval.
2022-06-28 15:35:34 +02:00
Julian Brost
437948c8f9 Icinga DB Check: read performance data string from Redis
Use the already existing format to pass performance data to Icinga 2 rather
than some new JSON structure. Has the additional benefit of doing more things
in Go than in C++.
2022-06-28 15:35:34 +02:00
Alexander A. Klimov
6eebc7868f Introduce Icinga DB check (like the IDO one) 2022-06-28 15:35:34 +02:00
Alexander A. Klimov
db249b1bde Remove Icinga DB perfdata from Icinga check
as the Icinga DB check already yields it.
2022-06-28 15:35:34 +02:00
Alexander A. Klimov
f9155a2d5f Introduce IcingaDB::AddKvsToMap() 2022-06-28 15:35:34 +02:00
Alexander A. Klimov
ce994d8135 RedisConnection::ReadRESP(): *-1\r\n is null, not [ ] 2022-06-28 15:35:34 +02:00
Alexander Aleksandrovič Klimov
323da4f06b
Merge pull request #9415 from Icinga/update-windows-openssl-version-213
Windows: Update openssl to the latest version 1_1_1p
2022-06-24 01:54:39 +02:00
Yonas Habteab
dcf06b1b6b Windows: Update openssl to the latest version 1_1_1p 2022-06-23 15:02:45 +02:00
Alexander Aleksandrovič Klimov
6bf16fe4f1
Merge pull request #9395 from Icinga/bugfix/atomic-members-2.13
Replace EventuallyAtomic with AtomicOrLocked which falls back to a mutex
2022-06-23 11:32:18 +02:00
Alexander Aleksandrovič Klimov
a46bd9f5cf
Merge pull request #9400 from Icinga/bugfix/remove-redundant-serialization-2.13
Remove redundant call to Serialize() in ConfigItem::Commit()
2022-06-23 11:31:54 +02:00
Alexander Aleksandrovič Klimov
9abc64e7d8
Merge pull request #9396 from Icinga/bugfix/icingadb-env-id-init-2.13
Icinga DB: initialize environment ID during config validation
2022-06-23 11:31:20 +02:00
Alexander Aleksandrovič Klimov
1d16c3a300
Merge pull request #9397 from Icinga/feature/parameter-delimiters-check-execution-6277-2.13
Introduce Command#arguments[].separator
2022-06-23 11:31:07 +02:00
Alexander Aleksandrovič Klimov
9eaa9c9f2e
Merge pull request #9398 from Icinga/bugfix/icingadb-command-arguments-null-2.13
IcingaDB: handle null (Empty) for value/set_if/separator in command arguments
2022-06-23 11:30:43 +02:00
Alexander Aleksandrovič Klimov
c5d66b5150
Merge pull request #9399 from Icinga/feature/add-name-suffix-to-columns-referring-to-name-2.13
IcingaDB: Add `_name` suffix to columns referring to name
2022-06-23 11:30:28 +02:00
Julian Brost
0ba703da13 Remove redundant call to Serialize() in ConfigItem::Commit()
The very same object is already serialized a few lines above, the result is
even stored in a variable, but that variable was not used before. Simply using
this variable results in a noticeable improvement of config validation times.
2022-06-15 10:57:03 +02:00
Yonas Habteab
524235872c Bump Redis schema version to 5 2022-06-14 15:07:02 +02:00
Yonas Habteab
7e12927b8a IcingaDB: Add _name suffix to columns referring to name 2022-06-14 15:07:02 +02:00
Alexander A. Klimov
20ae49ad49 Introduce Command#arguments[].separator
... for letting check commands produce argv like --key=value,
not just --key value.

refs #6277
2022-06-14 15:04:09 +02:00
Julian Brost
46c33bedaf IcingaDB: handle null (Empty) for value/set_if/separator in command arguments
Icinga 2 treats null (Empty) as if the corresponding attribute is not
specified. However, without this commit, it would serialize the value as "null"
(i.e. type string), so that it ends up in the database as this string instead
of NULL. This commit adds handling for ValueEmpty so that is serialized as JSON
null value and ends up in the database as NULL.
2022-06-14 14:55:19 +02:00
Julian Brost
b3d447fd49
Merge pull request #9360 from Icinga/feature/windows-boost-1.79-2.13
Windows: update boost to version 1.79.0
2022-06-14 14:27:39 +02:00
Julian Brost
7e93de2ec5
Merge pull request #9356 from Icinga/bugfix/suppressed-notifications-host-dependency-2.13
Take host state into account when sending suppressed notifications
2022-06-14 14:25:45 +02:00
Julian Brost
d28d18f75d Icinga DB: initialize environment ID during config validation
IcingaDB may receive callbacks from Boost signals before being fully started.
This resulted in situations where m_EnvironmentId was used before it was
initialized properly. This is fixed by initializing it earlier (during the
config validation stage). However, at this stage, it should not yet write to
disk, therefore, persisting the environment ID to disk is delayed until later
in the startup process.

Initializing at this stage has an extra benefit: if there is an error for some
reason (possibly corrupt icingadb.env file), this now shows up as a nice error
during config validation.

Additionally, this replaces the use of std::call_once with std::mutex due to
bug in libstdc++ (see inline comment for reference).
2022-06-14 14:09:48 +02:00
Julian Brost
184548f4fe Replace EventuallyAtomic with AtomicOrLocked which falls back to a mutex
Apparently there was a reason for making the members of generated classes
atomic. However, this was only done for some types, others were still accessed
using non-atomic operations. For members of type T::Ptr (i.e.  intrusive_ptr<T>),
this can result in a double free when multiple threads access the same variable
and at least one of them writes to the variable.

This commit makes use of std::atomic<T> for more T (it removes the additional
constraint sizeof(T) <= sizeof(void*)) and uses a type including a mutex for
load and store operations as a fallback.
2022-06-14 13:46:40 +02:00
Julian Brost
281aeb980b Windows: update boost to version 1.79.0 2022-04-27 13:46:18 +02:00
Julian Brost
d56afbc51a Take host state into account when sending suppressed notifications
Checkable::FireSuppressedNotifications() compares the time of the current
checkable with the last recovery time of parents to avoid notification right
after a parent recovered and before the current checkable was checked.

This commit makes this check also include to host if the checkable is a
service.  This makes the behavior consistent with the documentation that states
there is an implicit dependency on the host (which isn't realized as implicitly
generating a Dependency object unfortunately).
2022-04-22 12:04:46 +02:00
Julian Brost
862057d7fe
Merge pull request #9316 from Icinga/feature/release-2.13.3
Release 2.13.3
v2.13.3
2022-04-13 10:43:40 +02:00
Julian Brost
e39b3e3fff
Merge pull request #9343 from Icinga/gha2133
Update GHA
2022-04-13 09:47:50 +02:00
Alexander Aleksandrovič Klimov
e8357a5484 GHA: add Fedora 36 2022-04-12 17:28:59 +02:00
Alexander Aleksandrovič Klimov
bfb9d90a75 GHA: add Ubuntu jammy 2022-04-12 17:28:59 +02:00
Alexander Aleksandrovič Klimov
9515a5e709 Drop Ubuntu hirsute
It's EOL.
2022-04-12 17:28:59 +02:00
Julian Brost
aa6b6ab5bc Release 2.13.3 2022-04-12 16:03:45 +02:00
Julian Brost
e289ec689e
Merge pull request #9337 from Icinga/Al2Klimov-patch-3-213
Let new cluster certificates expire after 397 days, not 15 years
2022-04-11 21:20:39 +02:00
Julian Brost
5ea4c24c0e
Merge pull request #9335 from Icinga/bugfix/startup-log-213
Place startup.log and status in /var/lib/icinga2/api, not /var/lib/icinga2/api/zones-stage
2022-04-11 18:40:16 +02:00
Julian Brost
8b58de4431
Merge pull request #9333 from Icinga/bugfix/compare-cluster-tickets-in-constant-time-213
Compare cluster tickets in constant time
2022-04-11 16:30:51 +02:00
Alexander A. Klimov
763431aa35 Protect ApiListener#m_SSLContext with a mutex 2022-04-11 12:43:54 +02:00
Alexander A. Klimov
f63b364d91 Renew certificates also periodically 2022-04-11 12:43:54 +02:00
Alexander A. Klimov
ed3862782f ApiListener#Start(): auto-renew own cert if CA owner
otherwise that particular cert would expire.
2022-04-11 12:43:54 +02:00
Alexander A. Klimov
88d2da22f4 Introduce ApiListener#RenewCert() 2022-04-11 12:43:54 +02:00
Alexander A. Klimov
83911d0e05 Introduce IsCertUptodate() 2022-04-11 12:43:54 +02:00
Alexander A. Klimov
1ffc9f8120 Request certificate renewal also master2->master1
not only sat->master to prevent master2's certificate from expiring.
2022-04-11 12:43:53 +02:00
Alexander A. Klimov
85f8496017 Let new cluster certificates expire after 397 days, not 15 years
https://cabforum.org/wp-content/uploads/CA-Browser-Forum-BR-1.7.3.pdf, section 6.3.2:

"Subscriber Certificates issued on or after 1 September 2020 SHOULD NOT have a Validity Period greater than 397 days and MUST NOT have a Validity Period greater than 398 days."
2022-04-11 12:43:53 +02:00
Alexander A. Klimov
4fb9e7421e Write also /var/lib/icinga2/api/zones-stage-startup-last-failed.log
in addition to /var/lib/icinga2/api/zones-stage-startup.log
to prevent the next success to overwrite the last failure.
2022-04-11 12:28:12 +02:00
Alexander A. Klimov
3b03050340 Place startup.log and status in /var/lib/icinga2/api, not /var/lib/icinga2/api/zones-stage
not to loose them.
2022-04-11 12:28:12 +02:00