14132 Commits

Author SHA1 Message Date
Alexander A. Klimov
d01fc220fc JsonEncoder#GetResult(): std::move(), not copy, data 2025-04-29 11:43:57 +02:00
Alexander A. Klimov
e510c037b2 String: provide operator+ for String&&, not only const String&
so that e.g. `String("foo")+"bar"` re-uses `String("foo")` instead of copying.
2025-04-29 11:43:57 +02:00
Julian Brost
a65f2d6b41
Merge pull request #10417 from Icinga/inverted-hacluster-check
Fix inverted `IsHACluster` check
2025-04-25 11:01:52 +02:00
Johannes Schmidt
235a3e1aa5
Merge pull request #10416 from Icinga/jschmidt/sigabrt-handler-fix
Fix SIGABRT not causing a core dump
2025-04-23 16:08:13 +02:00
Yonas Habteab
1da497be89 Fix inverted IsHACluster check 2025-04-23 15:18:06 +02:00
Johannes Schmidt
f4923370ad Update AUTHORS 2025-04-23 10:33:20 +02:00
Johannes Schmidt
43f78a4b86 Fix SIGABRT not causing a core dump
A second abort() is needed at the end of `SigAbrtHandler()` to trigger the SIG_DFL action (in this case the core dump).

Also since `AttachDebugger()` disables the ability to dump core, so
it gets reenabled after returning from it.
2025-04-23 09:13:04 +02:00
Julian Brost
520aed6049
Merge pull request #10278 from Icinga/boost187
Bump Boost shipped for Windows to v1.87
2025-04-15 18:22:31 +02:00
Julian Brost
d3fae440d4
SpawnCoroutine: move callback into wrapper lambda
f isn't used otherwise in the function, so if possible, it can just be moved into the lambda, avoiding a copy.

Co-authored-by: Alexander Aleksandrovič Klimov <alexander.klimov@icinga.com>
2025-04-15 15:10:12 +02:00
Julian Brost
d1d399f8b3 Avoid multiple #if in a single function call expression
Simply giving two entire call expressions for either Boost version greatly
improves readability in my opinion.
2025-04-14 17:30:19 +02:00
Julian Brost
ccfc72267f Prefer icinga::String::GetData() over icinga::String::CStr()
Creating the string_view from the std::string (as returned by GetData()) uses
the stored length instead of having to detect it by finding '\0'.
2025-04-14 17:30:19 +02:00
Alexander A. Klimov
fb2b2e2d5b Don't use removed boost::asio::spawn() overload if Boost >= v1.87 2025-04-14 17:30:19 +02:00
Alexander A. Klimov
0662f2b719 In a coroutine, re-throw everything ex. std::exception (and inheritors)
not just boost::coroutines::detail::forced_unwind.

This is needed because as of Boost 1.87, boost::asio::spawn() uses Fiber, not Coroutine v1.
https://github.com/boostorg/asio/commit/df973a85ed69f021

This is safe because every actual exception shall inherit from std::exception. Except forced_unwind and its Fiber equivalent, so that `catch(const std::exception&)` doesn't catch them and only them.
2025-04-14 17:30:19 +02:00
Alexander Aleksandrovič Klimov
011c67964e Don't use boost::asio::io_context::strand method removed in Boost 1.87 2025-04-14 17:30:19 +02:00
Alexander Aleksandrovič Klimov
7bd35d8c6b Don't use boost::asio::ip::tcp::resolver::query
It was removed in Boost 1.87.
2025-04-14 17:30:19 +02:00
Alexander Aleksandrovič Klimov
11ab869016 Bump Boost shipped for Windows to v1.87 2025-04-14 17:30:19 +02:00
Yonas Habteab
9cc3971288
Merge pull request #10352 from Icinga/checkable-checkercomponent-fixed-timestamp-debug-logs
Fixed double output for timestamps in debug log
2025-04-14 12:16:51 +02:00
Alvar Penning
2ce34e8134
Fixed double output for timestamps in debug log
The timestamps used both in the CheckerComponent and Checkable debug
logs were printed in the scientific notation, making them effectively
useless.

> debug/CheckerComponent: Scheduling info for checkable 'host!service' (2025-02-26 14:53:16 +0100): Object 'host!service', Next Check: 2025-02-26 14:53:16 +0100(1.74058e+09).
> debug/Checkable: Update checkable 'host!service' with check interval '300' from last check time at 2025-02-26 14:48:47 +0100 (1.74058e+09) to next check time at 2025-02-26 14:58:12 +0100 (1.74058e+09).

Switching to std::fixed actually shows the complete Unix timestamp.

> debug/CheckerComponent: Scheduling info for checkable 'host!service' (2025-02-26 15:36:44 +0000): Object 'host!service', Next Check: 2025-02-26 15:36:44 +0000 (1740584204).
> debug/Checkable: Update checkable 'host!service' with check interval '60' from last check time at 2025-02-26 15:37:11 +0000 (1740584232) to next check time at 2025-02-26 15:38:09 +0000 (1740584290).
2025-04-14 10:09:42 +02:00
Julian Brost
8d607d2ef7
Merge pull request #10074 from open-i-gmbh/feature/tags-for-elasticsearchwriter-6837
Feature/tags for elasticsearchwriter
2025-04-10 10:11:15 +02:00
Yonas Habteab
cfca8909ae
Merge pull request #10403 from Icinga/drop-superfluous-cmake-modules
Drop superfluous cmake modules
2025-04-08 10:48:18 +02:00
Silas
8ab859d828
itl/ssl_cert: Add --ignore-maximum-validity option (#10396)
* Update web.conf - Include "--ignore-maximum-validity"

* Update 10-icinga-template-library.md

* Update 10-icinga-template-library.md

* Update 10-icinga-template-library.md
2025-04-08 09:18:38 +02:00
Silas
9ecf7714e3
Update command-plugins.conf to ensure compatibility with nagios-plugins' check_disk (#10395)
* Update command-plugins.conf to ensure compatibility with nagios-plugins' check_disk

* Update 10-icinga-template-library.md

* Update 10-icinga-template-library.md
2025-04-08 09:02:02 +02:00
Yonas Habteab
5a30554db9 Drop superfluous CMake modules
These modules are already provided by CMake itself, so we don't need to
ship them by ourselves.
2025-04-07 10:27:13 +02:00
Yonas Habteab
9abf482708
Merge pull request #10402 from Icinga/raise-minimum-cmake-version
Raise cmake minimum required version to `3.8...3.17`
2025-04-07 10:25:59 +02:00
Julian Brost
5a6b2044b1
Merge pull request #10290 from Icinga/icingadb-dependencies-sync
Sync dependencies to Redis
2025-04-04 15:13:05 +02:00
Yonas Habteab
cff8c60ba9 Drop superfluous MACOSX_RPATH definition
It's on by default since CMake version `3.0`
2025-04-04 14:04:47 +02:00
Yonas Habteab
28c61c904a Fix CMake doesn't export symbols of executables anymore
CMake 3.4 introduced a new policy [^1] which prevents from automatically
adding the compiler flags needed for exporting the symbols of the
executables and libraries without the `ENABLE_EXPORTS` property. So, by
defining this variable, CMake will restore the previous behaviour by
automatically adding the `ENABLE_EXPORTS` properties to all targets.

[1]: https://cmake.org/cmake/help/latest/policy/CMP0065.html
2025-04-04 14:04:47 +02:00
Yonas Habteab
7f164bda96 Raise cmake minimum required version to 3.8...3.17
CMake version `< 3.5` is no longer supported, so the new CMake minimum
policy version is set to `3.8` to support C++17 unconditionally. After
checking all the policies that might affect Icinga 2 in any way, CMake
`3.17` is used as a max supported CMake policy. Anything above that may
work but we didn't explicitly verify the policies introduced with CMake
3.18 and later and may or may not affect Icinga 2.
2025-04-04 13:56:51 +02:00
Julian Brost
d1d649ff33
Merge pull request #10401 from Icinga/gha-fix-alpine-cmake
GHA: Fix Alpine After CMAKE_OPTS Refactoring
2025-04-03 12:17:54 +02:00
Alvar Penning
33838a620a
GHA: Fix Alpine After CMAKE_OPTS Refactoring
The just merged Alpine CI run for LibreSSL from #9949 failed since it
missed the changes of the refactoring PR #10369. This change applied the
refactoring for Alpine as well, hopefully making the CI happy.
2025-04-03 09:33:42 +02:00
Yonas Habteab
0673dfa644
Merge pull request #9949 from Icinga/libressl
GHA: also build on Alpine to test LibreSSL which is used on OpenBSD
2025-04-03 09:17:33 +02:00
Julian Brost
27e1850381
Merge pull request #10399 from Icinga/severity-reachability
`Checkable::GetSeverity()`: consider reachability
2025-04-02 09:39:40 +02:00
Julian Brost
31a224c509 Checkable::GetSeverity(): always take reachability into account
So far, Service::GetSeverity() only considered the state of its own host, i.e.
the implicit service to its own host dependency, and treated it similar to
acknowledgements and downtimes. In contrast, Host::GetSeverity() considered
reachability and treated it like a state, i.e. for the severity calculation,
the host was either up, down, or unreachable.

This commit changes the following things:
1. Make the service severity also consider explicitly configured dependencies
   by using IsReachable().
2. Prefer acknowledgements and downtimes over unreachability in the severity
   calculation so that if an already acknowledged or in-downtime services (i.e.
   already handled service) becomes unreachable, it shouln't become more
   severe.
3. To unify host and service severities a bit, hosts now use the same logic
   that treats reachability more like acknowledgements/downtimes instead of
   like a state (changing the other way around would the state from the check
   plugin would not affect the severity for unrachable services anymore).
2025-03-31 15:23:51 +02:00
Julian Brost
1e05a166f1 Host::GetSeverity(): remove empty line at end of method 2025-03-31 15:23:51 +02:00
Julian Brost
d8271c6568 Host::GetSeverity(): remove explicit unlocking
No change in functionality. The ObjectLock destructor will implicitly release
the locks when returning from the function.
2025-03-31 15:23:51 +02:00
Julian Brost
2ebee010f0 Host::GetHost(): return early to remove a nesting level
No change in functionality. The first two branches actually set the final
return value for the method, so they can just return directly, removing the
need to have the rest of the function inside an else block.
2025-03-31 15:23:51 +02:00
Julian Brost
6443f8997f Host::GetSeverity(): add braces to if statements
No change in functionality, just makes the code a bit nicer.
2025-03-31 15:23:51 +02:00
Julian Brost
c899d52e2f Service::GetSeverity(): remove explicit unlocking
No change in functionality. The ObjectLock destructor will implicitly release
the locks when returning from the function.
2025-03-31 15:23:50 +02:00
Julian Brost
01acfb47a9 Service::GetHost(): return early to remove a nesting level
No change in functionality. The first two branches actually set the final
return value for the method, so they can just return directly, removing the
need to have the rest of the function inside an else block.
2025-03-31 15:23:50 +02:00
Julian Brost
5ca6047b35 Service::GetSeverity(): replace switch with if
No change in functionality, just making the code a bit more compact.
2025-03-31 15:23:50 +02:00
Julian Brost
a1865e1b43 Service::GetSeverity(): simplify nested if, add braces
No change in functionality, just making the code a bit nicer and more compact.
2025-03-31 15:23:50 +02:00
Yonas Habteab
bc2c750551 IcingaDB: Don't stream runtime state updates to Redis 2025-03-26 10:48:37 +01:00
Julian Brost
061338156c
Merge pull request #10345 from Icinga/remove-child-downtimes
ApiActions: Remove child downtimes recursively
2025-03-21 16:37:43 +01:00
Alexander Aleksandrovič Klimov
adde9cc53b
Merge pull request #10222 from Icinga/Registry-cleanup
Clean up Registry class
2025-03-21 11:00:49 +01:00
Alexander Aleksandrovič Klimov
469f94e549
Merge pull request #10369 from Icinga/cflags
GHA: Linux: use the C(++) flags recommended by each respective distro
2025-03-20 16:57:21 +01:00
Julian Brost
065118bc22 Make DependencyGroup::State an enum
The previous struct used two bools to represent three useful states. Make this
more explicit by having these three states as an enum.
2025-03-19 16:28:00 +01:00
Yonas Habteab
864e2aaae0 Drop superfluous mutex lock & don't manually unpack std::tuple 2025-03-19 16:28:00 +01:00
Julian Brost
693d094ebc DependencyGroup: don't change the keys of m_Members after construction
This prevents the use of DependencyGroup for storing the dependencies during
the early registration (m_DependencyGroupsPushedToRegistry = false),
m_PendingDependencies is introduced as a replacement to store the dependencies
at that time.
2025-03-19 16:28:00 +01:00
Yonas Habteab
945a79e37f IcingaDB: Don't send useless dependencies state updates 2025-03-19 16:28:00 +01:00
Yonas Habteab
da637c3741 IcingaDB: Always send dependencies state HSET updates to Redis 2025-03-19 16:28:00 +01:00